Every country
Every country we hold listings for, with how many channels it has and how much is listed today.
What it is for
This is the top of the directory. Each row gives a country's two-letter code, which every country endpoint takes, with its channel count and today's activity: how many channels have listings today and how many programmes are listed.
Use it to build a country picker, to check coverage before you build for a market, or to watch how busy a country's schedule is from day to day. UK listings use GB, as ISO 3166 does.
A country picker
Fill a drop-down with every country and its channel count.
Checking coverage
See which markets are deep before you build for them.
A starting point
Take a code and list that country's channels next.
Try it
Calls the real API with your key and shows the answer below. Your key stays in this browser and fills in on every docs page.
Every country
Works on the free keyNo key yet? Get a free key. It fills in here by itself once made.
Code
Built from the form above, with your key in place. The language you pick is remembered.
curl "https://api.tvschedule.org/v1/countries" \ -H "X-API-Key: <your key>"
Parameters
None. The key is all it needs.
Returns
A list under data, with meta.count beside it.
| Field | Type | Example | What it holds |
|---|---|---|---|
code | string | AD | The country's ISO 3166 two-letter code. The UK is GB. |
name | string | Andorra | Its name |
channels | integer | 1 | How many channels we hold for the country. |
channels_on_air_today | integer | 1 | How many of them have listings today, UTC. |
programmes_today | integer | 20 | How many programmes are listed across the country today, UTC. |
Example answer
A real answer from our data, cut to three rows, so you can see the shape before you run anything.
{
"data": [
{
"code": "AD",
"name": "Andorra",
"channels": 1,
"channels_on_air_today": 1,
"programmes_today": 20
},
{
"code": "AE",
"name": "United Arab Emirates",
"channels": 669,
"channels_on_air_today": 678,
"programmes_today": 20275
},
{
"code": "AF",
"name": "Afghanistan",
"channels": 1,
"channels_on_air_today": 1,
"programmes_today": 49
}
],
"meta": {
"count": 179,
"took_ms": 2
}
}Errors
| Status | Code | When | What to do |
|---|---|---|---|
| 401 | unauthorized | No key was sent, or it is not an active TV Schedule key. | Send it as Authorization: Bearer <key> or X-API-Key. Your keys are in your account. |
| 400 | bad_request | A value is the wrong shape: a date that is not YYYY-MM-DD, a two-character search, a key sent in the address. | Fix the value the message names and send it again. |
| 429 | rate_limited | Faster than your plan's pace per minute. | Wait for Retry-After seconds. The X-RateLimit headers show where you are. |
| 429 | quota_exceeded | Your plan's allowance for the day or month is used. | It resets at the time in the message, or upgrade for a bigger allowance. |
| 500 | server_error | Something went wrong on our side, or the data was out of reach for a moment. | Try again in a minute. It has been logged, and /status shows the state of the service. |