---
title: "빠른 시작"
description: "첫 배당률 요청을 보내고 응답을 읽은 뒤 Python이나 JavaScript에서 실행합니다."
canonical: https://dino.markets/ko/docs/quickstart/
---

> Index of every dino.markets page and doc for AI readers: [llms.txt](https://dino.markets/llms.txt)

# 빠른 시작

첫 배당률 요청을 보내고 응답을 읽은 뒤 Python이나 JavaScript에서 실행합니다.

## 키 받기

[대시보드의 키](https://dino.markets/dashboard#keys)를 열고 키를 만드세요. `dino_live_`로 시작하며 한 번만 표시됩니다. 셸 변수에 넣으세요.

```
export DINO_API_KEY=dino_live_your_key_here
```

키가 없어도 API 설명은 읽을 수 있습니다.

```
curl -s "https://api.dino.markets/v2/openapi.json"
```

200 OK

```
{
  "openapi": "3.1.0",
  "info": {"title": "dino.markets odds API", "version": "2"},
  "paths": {
    "/v2/odds": "...",
    "/v2/events": "...",
    "/v2/events/{event_id}/odds": "...",
    "/v2/leagues": "...",
    "/v2/books": "...",
    "/v2/openapi.json": "..."
  }
}
```

## 리그 찾기

`/v2/leagues`는 `league` 파라미터가 받는 값을 나열합니다. 무료입니다.

```
curl -s "https://api.dino.markets/v2/leagues" \
  -H "Authorization: Bearer $DINO_API_KEY"
```

200 OK

```
{
  "leagues": [
    {
      "league": "nfl",
      "sport": "americanfootball",
      "name": "NFL",
      "kind": "game"
    },
    {
      "league": "ncaaf",
      "sport": "americanfootball",
      "name": "NCAAF",
      "kind": "game"
    },
    {
      "league": "nfl_super_bowl_winner",
      "sport": "americanfootball",
      "name": "NFL Super Bowl Winner",
      "kind": "outright"
    }
  ]
}
```

여기서는 응답을 리그 3개로 줄였습니다. [전체 목록](https://dino.markets/ko/docs/leagues/#all-leagues)은 문서에 있습니다.

## 가격 받기

DraftKings의 NBA 한 경기 머니라인을 요청합니다. 이 호출은 1크레딧입니다.

```
curl -s -G "https://api.dino.markets/v2/odds" \
  -d league=nba -d markets=moneyline \
  -d limit=1 -d books=draftkings \
  -H "Authorization: Bearer $DINO_API_KEY"
```

200 OK

```
{
  "as_of": "2026-11-25T10:30:35Z",
  "events": [
    {
      "id": "8432983275030565fbdda384f9041815",
      "kind": "game",
      "sport": "basketball",
      "league": "nba",
      "start_time": "2026-11-25T22:10:00Z",
      "live": false,
      "status": "scheduled",
      "participants": [
        {"id": "p_vatyak2", "name": "Philadelphia 76ers", "role": "home"},
        {"id": "p_orpyqfo", "name": "Miami Heat", "role": "away"}
      ],
      "home": {"id": "p_vatyak2", "name": "Philadelphia 76ers"},
      "away": {"id": "p_orpyqfo", "name": "Miami Heat"},
      "books": [
        {
          "key": "draftkings",
          "name": "DraftKings",
          "markets": [
            {
              "key": "moneyline",
              "period": "game",
              "line": null,
              "main": true,
              "updated_at": "2026-11-25T10:04:29Z",
              "outcomes": [
                {
                  "name": "Philadelphia 76ers",
                  "participant_id": "p_vatyak2",
                  "side": "home",
                  "price": "1.862",
                  "american": "-116"
                },
                {
                  "name": "Miami Heat",
                  "participant_id": "p_orpyqfo",
                  "side": "away",
                  "price": "1.980",
                  "american": "-102"
                }
              ]
            }
          ]
        }
      ]
    }
  ],
  "next_cursor": "MjAyNi0xMS0yNVQyMjoxMDowMFp8ODQzMjk4MzI3NTAzMDU2NWZiZGRhMzg0ZjkwNDE4MTU"
}
```

## 응답 읽기

- `events`에는 경기가 가까운 순서로 담깁니다.
- `live`는 경기가 시작되면 `true`이므로, 그 가격은 경기 중 가격입니다.
- 경기의 `status`는 시작 시각까지는 `scheduled`, 그 후에는 `live`, 경기가 끝나면 `finished`입니다. `finished`는 점수가 있는 리그에서만 알 수 있습니다. 우승자 마켓(outright)은 확정될 때까지 `scheduled`입니다.
- `score`는 경기에 점수가 생기기 전까지 `null`이고, 그 뒤에는 `home`과 `away`를 문자열로 담습니다. 끝난 경기를 나열하려면 `status=finished`를 추가하세요. [끝난 경기와 점수](https://dino.markets/ko/docs/odds/#finished-games-and-scores)를 참고하세요.
- `home`과 `away`는 `participants`의 두 쪽을 그대로 다시 보여 주므로 role을 찾을 필요가 없습니다.
- 각 이벤트에는 `books`가, 각 북메이커에는 `markets`가, 각 마켓에는 `outcomes`가 있습니다.
- `price`는 문자열 형태의 소수 배당률이고 `american`은 같은 가격의 미국식 배당률입니다.
- `updated_at`은 해당 마켓의 현재 가격을 처음 본 시각입니다.
- `next_cursor`로 다음 페이지를 가져옵니다.

모든 파라미터와 필드는 [배당률과 이벤트](https://dino.markets/ko/docs/odds/)에 있습니다.

## 코드 예제

아직 공식 패키지는 없습니다. API는 HTTPS의 JSON이므로 어떤 HTTP 클라이언트든 동작합니다. Python 예제는 표준 라이브러리를 사용합니다. JavaScript 예제는 `.mjs` 파일로 저장해 Node 18 이상의 서버에서 실행합니다.

```
import json
import os
from urllib.error import HTTPError
from urllib.request import Request, urlopen

url = ("https://api.dino.markets/v2/odds"
       "?league=nba&markets=moneyline&limit=3")
key = os.environ["DINO_API_KEY"]
request = Request(url, headers={"Authorization": f"Bearer {key}"})
try:
    with urlopen(request, timeout=30) as response:
        for event in json.load(response)["events"]:
            names = {p["role"]: p["name"] for p in event["participants"]}
            print(f"{names['away']} at {names['home']}: {len(event['books'])} books")
        print(response.headers["x-requests-remaining"], "credits left")
except HTTPError as error:
    body = json.load(error)
    print(error.code, body["error"], body["message"])
```

```

    event.participants.find((p) => p.role === role).name,
  );
  console.log(`${away} at ${home}: ${event.books.length} books`);
}
console.log(response.headers.get("x-requests-remaining"), "credits left");">const url = "https://api.dino.markets/v2/odds"
  + "?league=nba&markets=moneyline&limit=3";
const response = await fetch(url, {
  headers: { Authorization: `Bearer ${process.env.DINO_API_KEY}` },
});
if (!response.ok) {
  const { error, message } = await response.json();
  throw new Error(`${response.status} ${error}: ${message}`);
}
const { events } = await response.json();
for (const event of events) {
  const [away, home] = ["away", "home"].map((role) =>
    event.participants.find((p) => p.role === role).name,
  );
  console.log(`${away} at ${home}: ${event.books.length} books`);
}
console.log(response.headers.get("x-requests-remaining"), "credits left");
```

출력

```
Miami Heat at Philadelphia 76ers: 41 books
Chicago Bulls at Charlotte Hornets: 41 books
Minnesota Timberwolves at Oklahoma City Thunder: 41 books
999956 credits left
```

## 함께 만들어 둘 것

- 호출할 때마다 `x-requests-remaining`을 읽고, 0이 되기 전에 작업을 멈추세요.
- 메시지 문구가 아니라 `error`로 분기하세요. [오류](https://dino.markets/ko/docs/errors/)를 참고하세요.
- `429 rate_limited`, `500`, `503`만 백오프를 두고 재시도하세요.
- 작은 호출을 여러 번 하지 말고, 리그 하나를 요청하면서 `limit`을 늘리세요(최대 100).

어떤 언어의 패키지를 원하는지 [support@dino.markets](mailto:support@dino.markets)로 알려 주세요.
