개요
아래 엔드포인트는 API 키 없이 호출할 수 있는 공개 구간입니다. 회원·관리자 전용, 웹훅, 크론 등은 포함하지 않습니다. 응답은 기본적으로 JSON이며, 많은 목록 API에 Cache-Control이 설정되어 있습니다.
기준 URL: https://www.lottopig.kr
Postman: Import → Link → https://www.lottopig.kr/api-docs/openapi.json
AI·에이전트용 통합 문서 (토큰)
LLM·RAG·CI에 한 번에 주입하기 좋은 마크다운 단일 문서입니다. 서버 환경 변수 AI_DOCS_TOKEN(8자 이상)을 아는 경우에만 열람할 수 있습니다.
- 브라우저: /ai-docs 에서 토큰 입력 후 30일 쿠키
- HTTP:
GET https://www.lottopig.kr/api/ai-docs+Authorization: Bearer …(또는X-Lottopig-AI-Docs-Token) - JSON으로 받기:
Accept: application/json→{ format, version, body }
curl -sS -H "Authorization: Bearer $AI_DOCS_TOKEN" \
-H "Accept: text/markdown" \
"https://www.lottopig.kr/api/ai-docs"GET /api/time
서버 UTC·KST 시각, Unix 타임스탬프.
curl -sS "https://www.lottopig.kr/api/time"GET /api/lotto/latest-round
최신 완료 회차 번호만 { "round": number }.
curl -sS "https://www.lottopig.kr/api/lotto/latest-round"GET /api/lotto/draws
?round=1200— 단건?limit=30&offset=0— 페이지 (total,draws)- 쿼리 없음 — 기본 최신 200건 (
limited: true) ?all=1— 전체 (대용량)
curl -sS "https://www.lottopig.kr/api/lotto/draws?round=1200"POST /api/lotto/draws-batch
본문 { "rounds": [1199, 1200] } 최대 80개 회차.
curl -sS -X POST "https://www.lottopig.kr/api/lotto/draws-batch" \
-H "Content-Type: application/json" \
-d '{"rounds":[1199,1200,1201]}'GET /api/lotto/history
cursor, limit, machineNo, numbers, oddCount, lowCount 등 필터·페이지네이션.
curl -sS "https://www.lottopig.kr/api/lotto/history?limit=10"GET /api/lotto/rounds
전체 배열(최신 우선). 용량이 크므로 필요 시 draws/draws-batch 권장.
curl -sS "https://www.lottopig.kr/api/lotto/rounds" | head -c 500GET /api/round/{id}
회차 단건 (레거시 경로, draws?round= 와 동일 계열).
curl -sS "https://www.lottopig.kr/api/round/1200"GET /api/lotto/statistics
선택 쿼리 ?recent=100 — 최근 N회만 반영해 집계.
curl -sS "https://www.lottopig.kr/api/lotto/statistics?recent=52"GET /api/lotto/ensemble-recommend
다음 회 추천 6·제외 10 및 백테스트. ?machine=latest 또는 기본 추첨기 예측. ?backtestN=100 · 생략/all · backtestN=0 으로 백테스트 범위 조절.
curl -sS "https://www.lottopig.kr/api/lotto/ensemble-recommend?backtestN=0"POST /api/lotto/combination
추천·제외 번호와 알고리즘·전략으로 조합 생성. 필드 상세는 OpenAPI JSON의 CombinationPostBody 참고.
curl -sS -X POST "https://www.lottopig.kr/api/lotto/combination" \
-H "Content-Type: application/json" \
-d '{"recommendedNumbers":[3,12,19,22,31,40],"excludeNumbers":[1,2],"count":3,"algorithm":"smart"}'로또피그는 공식 기관이 아니며, API 결과는 참고용입니다. 상업적 대량 이용 전 support@lottopig.kr로 문의해 주세요.