> ## Documentation Index
> Fetch the complete documentation index at: https://docs.odds-api.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Command-Line Tool

> odds-api-cli: list sports, events and bookmakers, compare odds, and find value bets and arbitrage from 450+ bookmakers in your terminal. Install, set your key and run.

`odds-api-cli` is the official command-line client for Odds-API.io. It lists sports, bookmakers and events, prints odds for an event, and finds value bets and arbitrage, as readable tables or raw JSON. It is built on the [Node.js SDK](https://docs.odds-api.io/guides/sdks.md).

## Install

```bash theme={null}
npm install -g odds-api-cli
```

The command is `odds-api`. To try it without installing:

```bash theme={null}
npx odds-api-cli sports
```

Node.js 18 or later is required.

## Set your API key

The CLI needs an API key from a paid plan. Get one at [odds-api.io/pricing](https://odds-api.io/pricing), then set it once:

```bash theme={null}
export ODDS_API_KEY="your-api-key"
```

Or pass `--key <key>` to any command. `sports` and `bookmakers` work without a key.

## Commands

| Command | What it does |
| - | - |
| `odds-api sports` | List sports and their slugs |
| `odds-api bookmakers` | List bookmakers |
| `odds-api events --sport <slug>` | List events. Filters: `--league <slug>`, `--status pending,live,settled`, `--from <iso>`, `--to <iso>`, `--limit <n>` |
| `odds-api odds <eventId>` | Odds for one event. `--bookmakers Bet365,Unibet` (defaults to the bookmakers selected on your account), `--market ML,Totals` |
| `odds-api value-bets --bookmaker <name>` | Value bets for a bookmaker, highest expected value first. The EV column is the edge in percent (`expectedValue - 100`). Filters: `--sport`, `--league`, `--min-ev <percent>`, `--limit` |
| `odds-api arbitrage --bookmakers <a,b>` | Arbitrage opportunities across bookmakers. The Profit column is `profitMargin`, already a percentage. `--limit <n>` |

Global options:

| Option | Description |
| - | - |
| `--key <key>` | API key. Defaults to the `ODDS_API_KEY` environment variable |
| `--json` | Print the raw JSON response instead of a table |
| `-h, --help` | Show help |
| `-v, --version` | Show the version |

## Examples

Sample output below is illustrative; ids, prices and fixtures will differ.

### List sports

```bash theme={null}
odds-api sports
```

```text theme={null}
Sport              Slug
-----------------  -----------------
Football           football
Basketball         basketball
Tennis             tennis
American Football  american-football
...
```

### Find events

```bash theme={null}
odds-api events --sport football --league england-premier-league --limit 3
```

```text theme={null}
ID        Date               League          Event                        Status   Score
--------  -----------------  --------------  ---------------------------  -------  -----
123456    2026-11-08 15:00Z  Premier League  Arsenal vs Chelsea           pending
123457    2026-11-08 17:30Z  Premier League  Liverpool vs Aston Villa     pending
123458    2026-11-09 14:00Z  Premier League  Manchester City vs Brighton  pending
```

### Compare odds for an event

```bash theme={null}
odds-api odds 123456 --bookmakers Bet365,Unibet --market ML,Totals
```

```text theme={null}
Arsenal vs Chelsea  |  Premier League  |  2026-11-08 15:00Z

Bookmaker  Market  Line  Odds
---------  ------  ----  ---------------------------------
Bet365     ML            home 2.10, draw 3.40, away 3.50
Bet365     Totals  2.5   over 1.90, under 1.95
Unibet     ML            home 2.05, draw 3.45, away 3.60
Unibet     Totals  2.5   over 1.87, under 1.98
```

### Value bets

```bash theme={null}
odds-api value-bets --bookmaker Bet365 --sport basketball --league usa-nba --limit 3
```

```text theme={null}
Date               Event                              Market        Side  Odds  EV
-----------------  ---------------------------------  ------------  ----  ----  -----
2026-11-09 00:30Z  Boston Celtics vs New York Knicks  Totals 224.5  over  2.05  4.12%
2026-11-09 02:00Z  Denver Nuggets vs Phoenix Suns     ML            away  2.40  2.37%
2026-11-09 00:00Z  Miami Heat vs Chicago Bulls        Spread -4.5   home  2.20  1.25%
```

The API returns `expectedValue` as bookmaker odds / fair odds x 100, so an `expectedValue` of 104.12 shows as a 4.12% edge. Add `--min-ev 3` to keep only bets with at least a 3% edge (CLI 0.1.1 and later).

### Arbitrage

```bash theme={null}
odds-api arbitrage --bookmakers Bet365,Unibet
```

```text theme={null}
Date               Event               Market      Profit  Legs
-----------------  ------------------  ----------  ------  -----------------------------------
2026-11-08 15:00Z  Arsenal vs Chelsea  Totals 2.5  2.97%   over Bet365 2.10; under Unibet 2.02
```

### More commands

```bash theme={null}
# Live NBA games
odds-api events --sport basketball --league usa-nba --status live

# Top 10 value bets on Bet365 for MLB
odds-api value-bets --bookmaker Bet365 --sport baseball --league usa-mlb --limit 10

# Arbitrage between three bookmakers, as JSON for jq
odds-api arbitrage --bookmakers Bet365,FanDuel,Unibet --json | jq '.[0]'
```

Arbitrage rows are calculated at the quoted prices. Prices move and bookmakers can limit or void bets, so check every leg before acting. See the [Arbitrage guide](https://docs.odds-api.io/guides/arbitrage-bets.md).

## Scripting with `--json`

`--json` prints the same JSON the API returns, so you can pipe it into `jq` or another tool:

```bash theme={null}
odds-api events --sport tennis --status live --json | jq -r '.[] | "\(.id) \(.home) vs \(.away)"'
```

The exit code is `0` on success, `1` for an API error (such as a rejected key or a rate limit) and `2` for a usage error.

## Related

> [card] [SDKs & Libraries](https://docs.odds-api.io/guides/sdks.md)
>
> Node.js, Python and R clients for full API coverage.

> [card] [CLI on GitHub](https://github.com/odds-api-io/odds-api-cli)
>
> Source, issues and release notes.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.