# Darts API
> Darts scoring maths as an API, computed locally and deterministically — the X01 checkout and average numbers a darts player, league or scoring app runs on. The checkout endpoint solves a remaining score with an exact full-board search: whether it can be finished, the minimum number of darts and one valid combination that ends on a double or the bull — 170 finishes T20 T20 Bull (the highest possible three-dart checkout), 100 is T20 D20, 40 is simply D20, while 1 cannot be finished (the last dart must be a double, minimum 2) and the bogey numbers 169, 168, 166, 165, 163, 162 and 159 cannot be checked out in three darts at all. The average endpoint computes the three-dart average — total score ÷ darts × 3 — so 501 in 15 darts is a 100.2 average; a 100-plus average is strong play. Everything is computed locally and deterministically, so it is instant and private. Ideal for darts, league-scoring, pub-game and sports app developers, checkout-assistant and practice tools, and darts education. Pure local computation — no key, no third-party service, instant. Standard X01 rules; legs end on a double or the bull. Live, nothing stored. 2 compute endpoints. An exact scoring aid for the standard 20-segment board.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/darts-api/..."
```

## Pricing
- **Free** (Free) — 6,450 calls/Mo, 2 req/s
- **Starter** ($4/Mo) — 58,500 calls/Mo, 6 req/s
- **Pro** ($11/Mo) — 243,000 calls/Mo, 15 req/s
- **Mega** ($35/Mo) — 1,365,000 calls/Mo, 40 req/s

## Endpoints

### Darts

#### `GET /v1/average` — Three-dart average

**Parameters:**
- `total_score` (query, required, string) — Total points scored Example: `501`
- `darts_thrown` (query, required, string) — Darts thrown Example: `15`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/darts-api/v1/average?total_score=501&darts_thrown=15"
```

**Response:**
```json
{
    "data": {
        "note": "Three-dart average = total score ÷ darts × 3. A 100+ average is strong club play; pros run 95–110+ over a match.",
        "turns": 5,
        "inputs": {
            "total_score": 501,
            "darts_thrown": 15
        },
        "per_dart_average": 33.4,
        "three_dart_average": 100.2
    },
    "meta": {
        "timestamp": "2026-06-06T07:14:08.020Z",
        "request_id": "4afa61a6-72e1-48cb-863e-7958141e2ed0"
    },
    "status": "ok",
    "message": "Three-dart average",
    "success": true
}
```

#### `GET /v1/checkout` — X01 checkout solver

**Parameters:**
- `score` (query, required, string) — Remaining score (2–170) Example: `170`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/darts-api/v1/checkout?score=170"
```

**Response:**
```json
{
    "data": {
        "note": "Minimum darts to finish and one valid route, ending on a double or the bull. 170 = T20 T20 Bull; 40 = D20.",
        "inputs": {
            "score": 170
        },
        "checkable": true,
        "minimum_darts": 3,
        "suggested_checkout": "T20 T20 Bull"
    },
    "meta": {
        "timestamp": "2026-06-06T07:14:08.137Z",
        "request_id": "588af421-e5e4-4d37-934d-da4b61a46308"
    },
    "status": "ok",
    "message": "X01 checkout",
    "success": true
}
```

### Meta

#### `GET /v1/meta` — Spec

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/darts-api/v1/meta"
```

**Response:**
```json
{
    "data": {
        "notes": "X01 legs end on a double or the bull (50). 170 is the highest three-dart checkout; 169/168/166/165/163/162/159 are bogey numbers. Exact full-board search.",
        "service": "darts-api",
        "endpoints": {
            "GET /v1/meta": "This document.",
            "GET /v1/average": "Three-dart average from a total score and darts thrown.",
            "GET /v1/checkout": "Whether a remaining score can be checked out, the minimum darts and a suggested combination."
        },
        "description": "Darts maths: X01 checkout solver (finishable, minimum darts, suggested route, bogey numbers) and three-dart average."
    },
    "meta": {
        "timestamp": "2026-06-06T07:14:08.233Z",
        "request_id": "6578bbdb-aaae-4377-af66-82ef10d1ea9d"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


---
Marketplace page: https://www.oanor.com/api/darts-api
OpenAPI spec: https://www.oanor.com/api/darts-api/openapi.json
