미국 복권 Powerball과 Mega Millions의 당첨 정보를 수집하고, 정적 JSON 파일로 제공하는 백엔드(데이터) 저장소입니다.
GitHub Actions를 통해 매일 자동으로 최신 데이터를 수집하며, GitHub Pages를 활용하여 별도의 서버 비용 없이 API처럼 데이터를 조회할 수 있습니다.
이 저장소의 GitHub Pages 설정을 활성화(Settings > Pages > Source: main)하면, 아래 URL 패턴으로 어디서든 데이터를 가져올 수 있습니다.
Base URL: https://<GITHUB_USERNAME>.github.io/okaylottery-back
가장 최근의 추첨 결과를 조회합니다.
GET /data/powerball/latest.jsonGET /data/megamillions/latest.json특정 날짜의 추첨 결과를 조회합니다.
GET /data/powerball/2025-12-16.jsonGET /data/megamillions/2025-12-12.json수집된 모든 회차의 날짜 목록을 조회합니다. (내림차순 정렬)
GET /data/<game>/index.json{
"game": "powerball",
"draws": ["2025-12-16", "2025-12-13", ...],
"total": 150,
"updatedAt": "2025-12-16T12:00:00.000Z"
}
/data/powerball/*.json){
"game": "powerball",
"drawDate": "2025-12-16",
"numbers": [10, 20, 30, 40, 50],
"powerBall": 5,
"powerPlay": 2, // 2x, 3x...
"jackpot": {
"estimated": 70000000,
"cash": 35000000,
"winners": 0
},
"prizeTiers": [
// 0등(Jackpot) ~ 8등 상세 당첨 정보 (당첨금, 당첨자 수 등)
{
"tier": 0,
"matchWhite": 5,
"matchSpecial": true,
"prize": { "base": "JACKPOT", "multiplier": "JACKPOT" },
"winners": { "base": 0, "multiplier": 0 }
},
...
],
"winners": [
// 당첨 지역 정보 (API 제공 시)
{ "title": "Match 5", "description": "$1 Million Winners", "locations": "NY, CA" }
],
"videoCode": "VIDEO_ID", // YouTube 영상 ID (없으면 null)
"fetchedAt": "2025-12-16T10:00:00.000Z"
}
/data/megamillions/*.json){
"game": "megamillions",
"drawDate": "2025-12-12",
"numbers": [5, 10, 15, 20, 25],
"megaBall": 7,
"megaplier": 3, // 3x
"jackpot": {
"estimated": 80000000,
"cash": 40000000,
"strValue": "$80 Million"
},
"prizeTiers": [
// 0 ~ 8 Tier 상세 정보
{
"tier": 1,
"prize": "$1 Million",
"winners": 0,
"multiplierWinners": 0
},
...
],
"winnerLocations": [
// 당첨 지역 정보
{ "type": "Match 5", "description": "$1 Million Winners", "locations": "NJ" }
],
"videoCode": "VIDEO_ID", // YouTube 영상 ID
"fetchedAt": "2025-12-16T10:00:00.000Z"
}
npm install
node scripts/powerball.js
node scripts/megamillions.js
Note: 이미 데이터가 존재하는 날짜는
Skipping...메시지와 함께 수집을 건너뜁니다.
node scripts/history_powerball.js
node scripts/history_megamillions.js
이 프로젝트는 GitHub Actions를 사용합니다.
scripts/*.js)git diff)Update ... data: 2025-12-16)