# Sports Game Score (`sports.game`)

One game by id: teams, start time, status, score, period scores and live clock. Ids come from sports.games or odds.events.

Docs: https://primaryapi.com/docs/api-reference/sports/game

- Endpoint: `POST https://api.primaryapi.com/v1/run/sports.game`
- Category: Knowledge & Data · Platform: `sports` · Kind: lookup · Status: live
- Price: 1 credit per call. Every call costs the same, including calls that were retried automatically.
- Billing unit: per successful call
- Reliability: routed to a healthy upstream and retried automatically when an attempt fails; live 30-day status: `GET https://api.primaryapi.com/v1/status/apis?sku=sports.game`
- Execution: synchronous (answers 202 only if it outlives the wait window)

## Input

| Field | Type | Required | Default | Constraints | Description |
|---|---|---|---|---|---|
| `id` | string | yes |  | max 200 chars | Game id from sports.games or odds.events. |
| `clock` | boolean | no | true |  | Include the live game clock. Set false for monitors that should fire only when the score or status changes. |

Unknown fields are rejected with `400 invalid_input`. The routing controls `preferLatencyUnderMs` and `maxCredits` may be sent in the same JSON body.

## Output

When `output.found` is `true`, `output.data` has this shape:

| Field | Type | Description |
|---|---|---|
| `id` | string | Game id for sports.game and odds.event. |
| `league` | string | League key. |
| `sport` | string |  |
| `startTime` | string | Scheduled start, ISO-8601 UTC. |
| `status` | enum |  |
| `statusDetail` | string \| null | Status as published, e.g. "Final/OT" or "Top 3rd". |
| `homeTeam` | object |  |
| `homeTeam.name` | string |  |
| `homeTeam.abbreviation` | string \| null |  |
| `awayTeam` | object |  |
| `awayTeam.name` | string |  |
| `awayTeam.abbreviation` | string \| null |  |
| `homeScore` | integer \| null | null before the game starts. |
| `awayScore` | integer \| null |  |
| `periods` | object[] | Score per period (quarter, half, inning, period), when published. |
| `periods[].period` | string |  |
| `periods[].home` | integer \| null |  |
| `periods[].away` | integer \| null |  |
| `period` | string \| null | Current period of a live game. |
| `clock` | string \| null | Game clock of a live game (omitted when clock=false). |
| `venue` | string \| null |  |
| `attribution` | string \| null | Credit line the data licence asks you to show with this game, when there is one. |

When the thing you asked about does not exist (or a search matches nothing) the call still succeeds: `output.found` is `false`, `output.data` is `null` and `output.reason` says why (`not_found`, `private`, `no_results`, …). Misses are free unless the notes below say misses are billed.

## Example request

```bash
curl -sS -X POST "https://api.primaryapi.com/v1/run/sports.game" \
  -H "Authorization: Bearer $PRIMARYAPI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"id":"WyJvIiw3NzM0MCwiYnVuZGVzbGlnYSJd","clock":false}'
```

## Example response

_Values are placeholders that follow the output schema; `credits` is what this call would cost at the usual price._

```json
{
  "output": {
    "found": true,
    "data": {
      "id": "WyJvIiw3NzM0MCwiYnVuZGVzbGlnYSJd",
      "league": "bundesliga",
      "sport": "soccer",
      "startTime": "2025-11-07T19:30:00.000Z",
      "status": "final",
      "statusDetail": "Full time",
      "homeTeam": {
        "name": "SV Werder Bremen",
        "abbreviation": null
      },
      "awayTeam": {
        "name": "VfL Wolfsburg",
        "abbreviation": null
      },
      "homeScore": 2,
      "awayScore": 1,
      "periods": [
        {
          "period": "1H",
          "home": 0,
          "away": 0
        },
        {
          "period": "2H",
          "home": 2,
          "away": 1
        }
      ],
      "period": null,
      "clock": null,
      "venue": null,
      "attribution": "Data from OpenLigaDB (www.openligadb.de), licensed under ODbL 1.0"
    }
  },
  "provider": "PrimaryAPI",
  "credits": 1,
  "items": 1,
  "requestId": "req_01JBXK6Y2N9V8T4R3Q2P1M0A7Z"
}
```

## Pricing and reliability

- Usual price: 1 credit per call
- Price ceiling: the usual price, even when a call is retried. A quote’s `maxCredits` is the most a given call can cost; the `maxCredits` routing control caps it per call
- Live 30-day status, success rate, uptime and latency: `GET https://api.primaryapi.com/v1/status/apis?sku=sports.game`

## Errors to handle

`invalid_input`, `unauthorized`, `insufficient_balance`, `key_limit_reached`, `trial_cap_reached`, `forbidden`, `not_found`, `idempotency_conflict`, `rate_limited`, `all_sources_failed`, `service_unavailable`, `timeout`. See https://primaryapi.com/docs/errors.

## Notes

Monitor recipe for a final score: schedule sports.game with clock=false; the webhook fires when the score or status changes, and status "final" marks the end. An unknown id returns found=false.

## Legal

Scores and schedules are informational; they are not official league data and are not suitable for settling bets. Team and league names are trademarks of their owners.

