# Betting Odds API
> Betting-odds maths as an API, computed locally and deterministically. The convert endpoint translates a price between every format used by bookmakers — decimal (European), fractional (UK), American (moneyline) and the implied probability — give it any one and it returns all the others, with the implied probability that the odds represent (1 ÷ decimal). The payout endpoint computes the profit and total return for a stake at given decimal or American odds. The parlay endpoint combines several decimal-odds selections into one accumulator by multiplying them, returning the combined odds, the implied probability and the payout for a stake — every leg must win, so the payout grows fast while the probability shrinks. Decimal odds are the total return per unit staked, American odds are at least +100 for an underdog or −100 or lower for a favourite, and fractional odds look like 5/2. Everything is computed locally and deterministically, so it is instant and private. Ideal for sports-betting, fantasy, odds-comparison and gaming app developers, bet-slip and value tools, and probability education. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is odds conversion; for probability distributions use a probability API.

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

## Pricing
- **Free** (Free) — 3,000 calls/Mo, 2 req/s
- **Starter** ($4/Mo) — 40,000 calls/Mo, 5 req/s
- **Pro** ($12/Mo) — 250,000 calls/Mo, 15 req/s
- **Mega** ($39/Mo) — 1,544,000 calls/Mo, 40 req/s

## Endpoints

### Odds

#### `GET /v1/convert` — Convert odds

**Parameters:**
- `decimal` (query, optional, string) — Decimal odds Example: `2.5`
- `american` (query, optional, string) — Or American/moneyline odds
- `fractional` (query, optional, string) — Or fractional odds (e.g. 5/2)
- `probability` (query, optional, string) — Or implied probability (0–1)

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/odds-api/v1/convert?decimal=2.5"
```

**Response:**
```json
{
    "data": {
        "note": "Decimal = total return per 1 staked; American ≥ +100 underdog or ≤ −100 favourite; implied probability = 1/decimal.",
        "inputs": {
            "source": "decimal"
        },
        "decimal": 2.5,
        "american": "+150",
        "fractional": "3/2",
        "american_value": 150,
        "implied_probability": 0.4,
        "implied_probability_percent": 40
    },
    "meta": {
        "timestamp": "2026-06-05T03:08:59.151Z",
        "request_id": "5c76c5be-72a8-47ab-bfb7-19aa1e549140"
    },
    "status": "ok",
    "message": "Odds convert",
    "success": true
}
```

#### `GET /v1/parlay` — Parlay / accumulator

**Parameters:**
- `odds` (query, required, string) — Comma-separated decimal odds Example: `1.5,2.0,3.0`
- `stake` (query, optional, string) — Stake Example: `10`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/odds-api/v1/parlay?odds=1.5%2C2.0%2C3.0&stake=10"
```

**Response:**
```json
{
    "data": {
        "note": "A parlay multiplies the decimal odds of every leg; all selections must win. Higher payout, lower probability.",
        "inputs": {
            "legs": 3,
            "stake": 10
        },
        "profit": 80,
        "american": "+800",
        "total_return": 90,
        "combined_decimal_odds": 9,
        "implied_probability_percent": 11.1111
    },
    "meta": {
        "timestamp": "2026-06-05T03:08:59.243Z",
        "request_id": "f7e2359f-cdf9-4d53-86c9-d50298224f63"
    },
    "status": "ok",
    "message": "Parlay",
    "success": true
}
```

#### `GET /v1/payout` — Payout

**Parameters:**
- `stake` (query, required, string) — Stake Example: `100`
- `decimal` (query, optional, string) — Decimal odds Example: `2.5`
- `american` (query, optional, string) — Or American odds

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/odds-api/v1/payout?stake=100&decimal=2.5"
```

**Response:**
```json
{
    "data": {
        "note": "Total return = stake × decimal odds; profit = total return − stake.",
        "inputs": {
            "stake": 100,
            "decimal_odds": 2.5
        },
        "profit": 150,
        "total_return": 250,
        "implied_probability_percent": 40
    },
    "meta": {
        "timestamp": "2026-06-05T03:08:59.320Z",
        "request_id": "3baadbea-2127-4174-a108-50abb1dc3c96"
    },
    "status": "ok",
    "message": "Payout",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "notes": "Decimal odds are the total return per 1 staked (must be > 1). American odds are ≥ +100 or ≤ −100. Fractional like '5/2'.",
        "service": "odds-api",
        "formulae": {
            "parlay": "product of the legs' decimal odds",
            "american_to_decimal": "+a → a/100 + 1 ; −a → 100/|a| + 1",
            "implied_probability": "1 / decimal"
        },
        "endpoints": {
            "GET /v1/meta": "This document.",
            "GET /v1/parlay": "Combine several decimal odds into one accumulator with its payout.",
            "GET /v1/payout": "Profit and total return for a stake at given odds.",
            "GET /v1/convert": "Convert any odds format (decimal, fractional, American, probability) to all the others."
        },
        "description": "Betting-odds calculator: convert between decimal, fractional, American (moneyline) odds and implied probability, compute payouts, and combine a parlay."
    },
    "meta": {
        "timestamp": "2026-06-05T03:08:59.412Z",
        "request_id": "5a51eca0-e57f-4089-adc7-c6810e364629"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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