# Quickstart (https://docs.predictorsdk.com/quickstart)

Get an API key, list matched games, find one again by a venue's ID, and read its live prices.

This guide goes from a new API key to live prices for one game on several
venues. Each call is shown with curl and with the TypeScript, Python and Go
SDKs (see [Installation](https://docs.predictorsdk.com/sdk/installation) to set one up).

### 1. Get an API key [#1-get-an-api-key]

Sign up at [app.predictorsdk.com](https://app.predictorsdk.com), open **API
Keys** and create one. Copy it straight away: it is shown only once. The free
plan covers everything in this guide. [Authentication](https://docs.predictorsdk.com/authentication) has the
details.

### 2. List matched games [#2-list-matched-games]

This first call needs no IDs. It returns a page of games that two or more
venues list, soonest first. The TypeScript examples use top-level `await`, so
run them as an ES module: from a `.mjs` or `.mts` file, or in a project whose
`package.json` has `"type": "module"`.

  **cURL**
    ```bash
    curl -s \
      -H "Authorization: Bearer YOUR_API_KEY" \
      "https://api.predictorsdk.com/v1/matching-markets/sports?limit=2"
    ```
    **TypeScript**
    ```ts
    import { PredictorSDKClient } from "@predictorsdk/client";

    const client = new PredictorSDKClient({
      token: "YOUR_API_KEY",
    });

    // A paginated call answers a page; page.data holds its events.
    const page = await client.getSportsMatchingMarkets({ limit: 2 });
    for (const event of page.data) {
      console.log(event.eventId, event.title);
    }
    ```
    **Python**
    ```python
    from predictorsdk import PredictorSDK

    client = PredictorSDK(token="YOUR_API_KEY")

    # A paginated call returns a pager; pager.items holds this page's events.
    pager = client.get_sports_matching_markets(limit=2)
    for event in pager.items:
        print(event.event_id, event.title)
    ```
    **Go**
    ```go
    import (
        "context"
        "fmt"

        predictorsdk "github.com/PredictorSDK/sdk-go"
        predictorclient "github.com/PredictorSDK/sdk-go/client"
        "github.com/PredictorSDK/sdk-go/option"
    )

    client := predictorclient.New(option.WithToken("YOUR_API_KEY"))

    // A paginated call returns a page; page.Results holds its events.
    page, err := client.GetSportsMatchingMarkets(context.TODO(), &predictorsdk.GetSportsMatchingMarketsRequest{
        Limit: predictorsdk.Int(2),
    })
    if err != nil {
        panic(err)
    }
    for _, event := range page.Results {
        fmt.Println(event.EventID, event.Title)
    }
    ```
  
Each game in `data` has a canonical `event_id` (league, away team, home team,
date), its teams, and the day it is scheduled. By default a game carries one
submarket, its full-game winner, with every venue market matched to it
(abridged here; the [API reference](https://docs.predictorsdk.com/api-reference/getSportsMatchingMarkets)
shows every field):

```json
{
  "data": [
    {
      "event_id": "nba-okc-sas-2026-10-20",
      "sport": "basketball",
      "league": "nba",
      "title": "Oklahoma City Thunder vs. San Antonio Spurs",
      "scheduled_start": "2026-10-20T23:30:00.000Z",
      "scheduled_date": "2026-10-20",
      "participants": [
        { "key": "okc", "name": "Oklahoma City Thunder", "role": "away" },
        { "key": "sas", "name": "San Antonio Spurs", "role": "home" }
      ],
      "submarkets": [
        {
          "key": "moneyline|full|winner",
          "market_type": "moneyline",
          "segment": "full",
          "display_name": "Winner",
          "outcomes": [
            { "key": "winner:okc", "label": "Oklahoma City Thunder win", "side": "win" },
            { "key": "winner:sas", "label": "San Antonio Spurs win", "side": "win" }
          ],
          "source_markets": [
            {
              "provider": "kalshi",
              "event_id": "KXNBAGAME-26OCT20OKCSAS",
              "market_id": "KXNBAGAME-26OCT20OKCSAS-OKC",
              "market_name": "Oklahoma City wins",
              "outcomes": [
                { "canonical_outcome_key": "winner:okc", "label": "Yes", "outcome_id": "yes", "side": "yes" },
                { "canonical_outcome_key": "winner:sas", "label": "No", "outcome_id": "no", "side": "no" }
              ]
            },
            {
              "provider": "kalshi",
              "event_id": "KXNBAGAME-26OCT20OKCSAS",
              "market_id": "KXNBAGAME-26OCT20OKCSAS-SAS",
              "market_name": "San Antonio wins",
              "outcomes": [
                { "canonical_outcome_key": "winner:sas", "label": "Yes", "outcome_id": "yes", "side": "yes" },
                { "canonical_outcome_key": "winner:okc", "label": "No", "outcome_id": "no", "side": "no" }
              ]
            },
            {
              "provider": "sxbet",
              "event_id": "L19766755",
              "market_id": "0xb4d047a709aae881e5ccad9d123592967644ee1df1f17078c762b388e41b81c5",
              "market_name": "San Antonio Spurs vs Oklahoma City Thunder",
              "outcomes": [
                { "canonical_outcome_key": "winner:sas", "label": "San Antonio Spurs", "outcome_id": "outcomeOne" },
                { "canonical_outcome_key": "winner:okc", "label": "Oklahoma City Thunder", "outcome_id": "outcomeTwo" }
              ]
            }
          ]
        }
      ]
    }
  ],
  "pagination": { "limit": 2, "total": 140, "has_more": true, "next_cursor": "eyJ..." },
  "snapshot": { "observed_at": "2026-10-03T23:11:41.515Z" }
}
```

Each venue market, whichever venue it comes from, has the same fields:

- `provider` names the venue: `kalshi`, `sxbet`, `polymarket` and so on.
- `market_id` is the market itself. You will use it in step 4.
- `event_id` is the venue's own parent event, for
  [`GET /v1/events/{event_id}`](https://docs.predictorsdk.com/api-reference/getEvent). It is not the
  canonical `event_id` of the game.
- `outcomes` maps each side of the market (`outcome_id`) to a side of the game
  (`canonical_outcome_key`, such as `winner:okc`).

Kalshi lists a game winner as one yes/no market per team, so it appears twice,
once per team.

A game stays in the list through the day after its scheduled date (in US
Eastern time), so the first games can be ones already played. See
[Include settled events](https://docs.predictorsdk.com/guides/filtering#include-settled-events).

**The IDs in these docs expire.**   Venues delist a game's markets after it is played, so the example IDs here
  will stop working. Use live ones from your own response to the call above.

### 3. Find a game again [#3-find-a-game-again]

You don't need to page through the list to get back to a game. Send any ID you
already have to
[`GET /v1/matching-markets/sports/lookup`](https://docs.predictorsdk.com/api-reference/lookupSportsMatchingMarkets):
a canonical key as `event_id`, or a venue's ID as `source_id={provider}:{id}`.
This looks up a Kalshi event and a Kalshi market no other venue lists:

  **cURL**
    ```bash
    curl -s \
      -H "Authorization: Bearer YOUR_API_KEY" \
      "https://api.predictorsdk.com/v1/matching-markets/sports/lookup?source_id=kalshi:KXNBAGAME-26OCT20OKCSAS&source_id=kalshi:KXNBA-27-SAS"
    ```
    **TypeScript**
    ```ts
    const response = await client.lookupSportsMatchingMarkets({
      sourceId: ["kalshi:KXNBAGAME-26OCT20OKCSAS", "kalshi:KXNBA-27-SAS"],
    });
    for (const [id, found] of Object.entries(response.lookups)) {
      console.log(id, found.eventIds);
    }
    ```
    **Python**
    ```python
    response = client.lookup_sports_matching_markets(
        source_id=["kalshi:KXNBAGAME-26OCT20OKCSAS", "kalshi:KXNBA-27-SAS"]
    )
    for identifier, found in response.lookups.items():
        print(identifier, found.event_ids)
    ```
    **Go**
    ```go
    response, err := client.LookupSportsMatchingMarkets(context.TODO(), &predictorsdk.LookupSportsMatchingMarketsRequest{
        SourceID: []*string{
            predictorsdk.String("kalshi:KXNBAGAME-26OCT20OKCSAS"),
            predictorsdk.String("kalshi:KXNBA-27-SAS"),
        },
    })
    if err != nil {
        panic(err)
    }
    for identifier, found := range response.Lookups {
        fmt.Println(identifier, found.EventIDs)
    }
    ```
  
The response lists each game it found in `data`, with every submarket.
`lookups` tells you what each ID you sent found, so an ID that found nothing
shows up with an empty list:

```json
{
  "data": [
    {
      "event_id": "nba-okc-sas-2026-10-20",
      "title": "Oklahoma City Thunder vs. San Antonio Spurs",
      "submarkets": [ … ]
    }
  ],
  "lookups": {
    "kalshi:KXNBAGAME-26OCT20OKCSAS": { "event_ids": ["nba-okc-sas-2026-10-20"] },
    "kalshi:KXNBA-27-SAS": { "event_ids": [] }
  },
  "snapshot": { "observed_at": "2026-10-03T23:11:41.515Z" }
}
```

`KXNBA-27-SAS` is a real Kalshi market, a season-long bet on the 2027 title,
but no other venue lists it, so it matches no game. One request can carry up to
100 IDs from any mix of venues.

### 4. Read live prices [#4-read-live-prices]

Matching tells you which markets are the same; it carries no prices. To price a
market, send its `market_id` and `provider` to
[`GET /v1/markets/{market_id}`](https://docs.predictorsdk.com/api-reference/getMarket), here as one ID,
`kalshi:KXNBAGAME-26OCT20OKCSAS-OKC`:

  **cURL**
    ```bash
    curl -s \
      -H "Authorization: Bearer YOUR_API_KEY" \
      "https://api.predictorsdk.com/v1/markets/kalshi:KXNBAGAME-26OCT20OKCSAS-OKC"
    ```
    **TypeScript**
    ```ts
    const market = await client.getMarket({
      marketId: "KXNBAGAME-26OCT20OKCSAS-OKC",
      provider: "kalshi",
    });
    for (const outcome of market.outcomes) {
      console.log(outcome.name, outcome.bid, outcome.ask);
    }
    ```
    **Python**
    ```python
    market = client.get_market("KXNBAGAME-26OCT20OKCSAS-OKC", provider="kalshi")
    for outcome in market.outcomes:
        print(outcome.name, outcome.bid, outcome.ask)
    ```
    **Go**
    ```go
    market, err := client.GetMarket(context.TODO(), &predictorsdk.GetMarketRequest{
        MarketID: "KXNBAGAME-26OCT20OKCSAS-OKC",
        Provider: predictorsdk.GetMarketRequestProviderKalshi.Ptr(),
    })
    if err != nil {
        panic(err)
    }
    for _, outcome := range market.Outcomes {
        // Bid and Ask are pointers, nil when that side has no quote.
        if outcome.Bid != nil && outcome.Ask != nil {
            fmt.Println(outcome.Name, *outcome.Bid, *outcome.Ask)
        }
    }
    ```
  
The answer comes straight from the venue, read when you asked (`observed_at`).
Each outcome carries its `price` and the best `bid` and `ask`, as a probability
from 0 to 1, and `trading_fees` describes the venue's fee for trading it, where
the venue publishes one (abridged here):

```json
{
  "id": "kalshi:KXNBAGAME-26OCT20OKCSAS-OKC",
  "provider": "kalshi",
  "title": "Oklahoma City wins",
  "status": "open",
  "outcomes": [
    { "name": "Yes", "outcome_id": "yes", "price": 0.45, "bid": 0.44, "ask": 0.46, "last": 0.46 },
    { "name": "No", "outcome_id": "no", "price": 0.55, "bid": 0.54, "ask": 0.56, "last": 0.54 }
  ],
  "pricing": {
    "availability": "live",
    "scale": "probability_0_1",
    "observed_at": "2026-10-17T23:45:21.908Z"
  },
  "trading_fees": { "availability": "published", "taker": { "model": "quadratic", "rate": 0.07 } }
}
```

Market detail returns the same `outcome_id`s as the matched market in step 2,
so you can line the sides up across venues by ID. `pricing.availability` says
whether the quotes are tradeable: read it before you act on a price. See
[Trading fees](https://docs.predictorsdk.com/guides/trading-fees) for turning a price and a fee into the
cost of a trade.

## Where to go next [#where-to-go-next]

- **More submarkets.** Add `include_submarkets=true` to the list to get every
  matched spread, total, half, quarter and player prop, not only the winner.
- **Narrow the list.** Filter by `league`, `scheduled_date` or `participant`,
  for example `?league=nfl&scheduled_date=2026-10-25`. See
  [Filtering](https://docs.predictorsdk.com/guides/filtering).
- **Walk every page.** The SDKs iterate pages for you; with curl, follow
  `pagination.next_cursor`. See [Pagination](https://docs.predictorsdk.com/guides/pagination).
- **Handle errors.** Every error has a stable `code`. See
  [Error handling](https://docs.predictorsdk.com/guides/error-handling).
- **Know your limits.** See [Plans & limits](https://docs.predictorsdk.com/guides/plans).