guides
Find league ids in the PricedOdds API without a key
GET /v1/leagues returns every league in the PricedOdds API as a flat list, and it works without an API key. Each row has the league id you pass to the odds endpoints, plus name, sport, country, events and live_events. Three filters narrow it down: sport, q and active.
This guide shows the calls, a short Node script and the two kinds of hints the API sends when a request is off. Everything here was run against the live API on November 23, 2026.
What does GET /v1/leagues return?
A data array with one object per league, and an asOf timestamp. This is the NFL row, from a call filtered to one league:
curl -s "https://api.pricedodds.com/v1/leagues?sport=football&q=nfl"{
"data": [
{ "id": "nfl", "name": "NFL", "sport": "football", "country": "US", "events": 16, "live_events": 0 }
],
"asOf": "2026-11-23T16:12:30.192Z"
}| Field | What it is |
|---|---|
id | The league id for GET /v1/events?league= and the other odds endpoints |
name | The display name |
sport | The sport id, such as football, soccer or tennis |
country | A country code, or INTL |
events | Events the feed has for that league at the time of the call |
live_events | How many of those are in play |
events and live_events move with the schedule, so read them as "right now" and keep the asOf time next to anything you store.
How do I filter the list?
Use one filter or combine them.
| Filter | What it does | Example |
|---|---|---|
sport | One or more sport ids, separated by commas | sport=tennis,table-tennis |
q | Text in the league id, name or country | q=premier |
active | true keeps only leagues that have events | active=true |
# Soccer leagues that have events
curl -s "https://api.pricedodds.com/v1/leagues?sport=soccer&active=true"
# Every league with "premier" in its id, name or country
curl -s "https://api.pricedodds.com/v1/leagues?q=premier"A league with events: 0 is in the catalog and has nothing to price at that moment. Whether it has events depends on season and schedule.
How do I do it from code?
This script runs on Node 18 or later with no packages and no key. It lists the soccer leagues that have events, searches by text, asks for two sports at once, and then makes two mistakes on purpose.
// find-leagues.mjs: runs on Node 18 or later, no API key needed
const base = "https://api.pricedodds.com/v1/leagues";
async function leagues(params) {
const res = await fetch(`${base}?${new URLSearchParams(params)}`);
const body = await res.json();
if (!res.ok) {
const e = body.error;
console.log(`${res.status} ${e.code}: ${e.message} Did you mean: ${(e.did_you_mean ?? []).join(", ")}?`);
return [];
}
for (const w of body.warnings ?? []) console.log("warning:", w);
console.log("as of", body.asOf);
return body.data;
}
// 1. Leagues of one sport that have events right now
const soccer = await leagues({ sport: "soccer", active: "true" });
console.log(soccer.length, "soccer leagues with events");
for (const l of soccer.slice(0, 5)) {
console.log(l.id.padEnd(12), l.name.padEnd(26), `events=${l.events}`, `live=${l.live_events}`);
}
// 2. Search by text in the league id, name or country
const premier = await leagues({ q: "premier", active: "true" });
console.log(premier.slice(0, 4).map((l) => l.id).join(", "));
// 3. More than one sport in one call
const rackets = await leagues({ sport: "tennis,table-tennis", active: "true" });
for (const l of rackets.slice(0, 4)) console.log(l.id.padEnd(36), l.sport.padEnd(13), `events=${l.events}`);
// 4. A typo returns a 400 with a suggestion
await leagues({ sport: "socer" });
// 5. An unknown parameter is ignored, with a warning
await leagues({ sport: "tennis", activ: "true" });Run it with node find-leagues.mjs. This is the output of one run. Your counts will differ, because they follow the schedule.
as of 2026-11-23T16:12:57.996Z
98 soccer leagues with events
championship EFL Championship events=24 live=0
ucl UEFA Champions League events=18 live=0
uecl UEFA Conference League events=18 live=0
uel UEFA Europa League events=18 live=0
brasileirao Brasileirão Série A events=15 live=0
as of 2026-11-23T16:12:58.134Z
epl, scottish-premiership, egypt-premier-league, england-amateur-u21-premier-league-cup
as of 2026-11-23T16:12:58.236Z
table-tennis-ukraine-setka-cup table-tennis events=73
atp-challenger tennis events=68
table-tennis-international-tt-cup table-tennis events=49
table-tennis-czechia-czech-liga-pro table-tennis events=45
400 unknown_sport: Unknown sport 'socer'. Did you mean: soccer?
warning: Unknown parameter 'activ' was ignored. Accepted here: sport, q, active.
as of 2026-11-23T16:12:58.642ZWhat happens when I misspell something?
The API tells you, in two ways.
An unknown value is an error. sport=socer returns HTTP 400 with the code unknown_sport. The error object carries a did_you_mean list and a docs_url:
{
"error": {
"code": "unknown_sport",
"message": "Unknown sport 'socer'.",
"fix": "Did you mean soccer? Use a sport id from GET /v1/sports, e.g. basketball, soccer, tennis.",
"docs_url": "https://pricedodds.com/docs/errors#unknown_sport",
"request_id": "req_PCd4z6FE631y",
"did_you_mean": ["soccer"]
}
}An unknown parameter is a warning. The call still returns 200 with its data, and a warnings array names the parameter that was ignored and the ones the endpoint accepts. In the script above, activ was dropped, so that call returned every tennis league instead of the active ones. Log warnings during development, or a typo in a filter name passes unnoticed.
Both are described in the error docs.
Which other calls work without a key?
Six endpoints are public. They are enough to check what the API has before you sign up.
| Endpoint | What it returns |
|---|---|
GET /v1/leagues | The flat, searchable league list from this guide |
GET /v1/sports | Sports, each with its leagues |
GET /v1/books | Books with type and status |
GET /v1/markets | Market keys and periods |
GET /v1/coverage | Books, leagues and market types, in the catalog and with data now |
GET /v1/status | Data status and last update per book |
Odds calls need a key. With a league id in hand, the next call is the event list:
curl -s "https://api.pricedodds.com/v1/events?league=nfl" \
-H "Authorization: Bearer $PRICEDODDS_API_KEY"What should I read next?
- The docs list every endpoint and parameter.
- The coverage page shows leagues, books and market types, with what has data now.
- Pricing starts at $39 a month for any 2 books, and you can create an account when you are ready for odds calls.
- The Python tutorial goes from the public endpoints to odds from several books.
With the league ID in hand, the request builder writes the odds call for it as a URL, a curl command and Node code.