# Farkle Score API
> Farkle dice-scoring maths as an API, computed locally and deterministically — the points a Farkle (Zilch, Ten Thousand) scoring app tallies a roll by. The score endpoint takes up to six dice and returns the value by the common ruleset: a single 1 is 100 and a single 5 is 50; three of a kind scores the face times 100 (three 1s being the exception at 1000); four, five and six of a kind are 1000, 2000 and 3000; a 1-to-6 straight or three pairs is 1500; and two triplets is 2500 — so 1-1-1-5-5-5 scores 2500 as two triplets rather than 1100, a 1-2-3-4-5-6 straight is 1500, and 6-6-6-2-3 is 600 with the 2 and 3 dead. It flags a farkle when nothing scores (you lose the turn’s points) and tells you whether every die counted — a hot dice that lets you roll all six again. Rulesets vary, so it scores the widely-used set and says so. Everything is computed locally and deterministically, so it is instant and private. Ideal for dice-game, party-game and scoring app developers, score-helper and game-night tools, and board-game-companion software. Pure local computation — no key, no third-party service, instant. Scores a roll; it does not roll the dice. Live, nothing stored. 1 compute endpoint.

## 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/farkle-api/..."
```

## Pricing
- **Free** (Free) — 7,460 calls/Mo, 2 req/s
- **Starter** ($4/Mo) — 56,700 calls/Mo, 6 req/s
- **Pro** ($12/Mo) — 232,800 calls/Mo, 15 req/s
- **Mega** ($36/Mo) — 1,353,000 calls/Mo, 40 req/s

## Endpoints

### Farkle

#### `GET /v1/score` — Score a Farkle roll

**Parameters:**
- `dice` (query, required, string) — 1–6 dice (1–6) Example: `1,1,1,5,5,5`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/farkle-api/v1/score?dice=1%2C1%2C1%2C5%2C5%2C5"
```

**Response:**
```json
{
    "data": {
        "note": "Common Farkle scoring: single 1 = 100, single 5 = 50; three of a kind = face × 100 (three 1s = 1000); four/five/six of a kind = 1000/2000/3000; a 1-6 straight or three pairs = 1500; two triplets = 2500. No scoring dice is a 'farkle' and you lose the turn's points. Rulesets vary — check your house rules.",
        "score": 2500,
        "farkle": false,
        "inputs": {
            "dice": [
                1,
                1,
                1,
                5,
                5,
                5
            ]
        },
        "breakdown": [
            {
                "combo": "two triplets",
                "points": 2500
            }
        ],
        "all_dice_score": true
    },
    "meta": {
        "timestamp": "2026-06-06T15:30:50.791Z",
        "request_id": "a69b89cb-a10b-4508-b154-3c47548654a8"
    },
    "status": "ok",
    "message": "Farkle score",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "notes": "Dice 1–6, up to six. 1=100, 5=50; three of a kind face×100 (1s=1000); 4/5/6-of-a-kind 1000/2000/3000; straight or three pairs 1500; two triplets 2500. 'all_dice_score' tells you if every die counted (a hot dice). Scores a roll; does not roll.",
        "service": "farkle-api",
        "endpoints": {
            "GET /v1/meta": "This document.",
            "GET /v1/score": "Score 1–6 dice and report the breakdown and whether it's a farkle."
        },
        "description": "Farkle (Zilch / Ten Thousand) dice scoring: score a set of up to six dice and flag a farkle."
    },
    "meta": {
        "timestamp": "2026-06-06T15:30:50.880Z",
        "request_id": "d2fb5442-688f-4c64-bdfe-827fd1d4d19e"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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