REST Countries API
Get information about countries via a RESTful API
- Our call
- HTTP 200
- Latency
- 297 ms
- From a browser
- Allowed
- Key
- No key
- Docs link
- Answered
https://restcountries.com/v3.1/name/japan?fields=name,capital,populationPress Run: the request leaves from your browser, and you see what it gets back.
const res = await fetch("https://restcountries.com/v3.1/name/japan?fields=name,capital,population");
if (!res.ok) throw new Error(`HTTP ${res.status}`);
const data = await res.json();
console.log(data);curl -sS 'https://restcountries.com/v3.1/name/japan?fields=name,capital,population'import requests
r = requests.get("https://restcountries.com/v3.1/name/japan?fields=name,capital,population", timeout=10)
r.raise_for_status()
print(r.json())REST Countries docsMore Geocoding APIs
Come back to see anything that changed: answers, keys, browser access, rate limits.
Our test call Measured by us
- Request
GET https://restcountries.com/v3.1/name/japan?fields=name,capital,population- Result
- HTTP 200 in 297 ms (322 ms with the body)
- From a browser
- Browser OK Access-Control-Allow-Origin: *
- HTTPS
- Yes
- Response
- application/json, 261 bytes, a JSON object
- Fields
successdataerrors- Rate-limit headers
- none sent (that doesn't mean unlimited)
Change log Measured by us
No changes seen since we started tracking on 2026-11-06. Each check compares the answer, the key requirement, the browser (CORS) header and the rate limit with the run before.
What the list says From the public-apis list
- Category
- Geocoding
- Auth
- No key
- CORS
- Yes
- Docs link
- restcountries.com answered 200 in 3028 ms on 2026-11-06 Measured
REST Countries is listed in Geocoding. REST Countries needs no key: you can call it without signing up. The list says it sends CORS headers, so JavaScript on a web page can call it straight from the browser.
The list has 102 Geocoding APIs: 48 need no key, 53 need an API key and 1 uses OAuth, and 51 of them are marked as allowing browser calls. 23 others have the same setup, such as administrative-divisons-db, BigDataCloud's Free API and bng2latlong.
REST Countries and other Geocoding APIs
| Fact | REST Countries (this page) | BigDataCloud's Free API | Country | GeoJS | IP Address Details |
|---|---|---|---|---|---|
| Key needed From the public-apis list | No key | No key | No key | No key | No key |
| CORS, as listed From the public-apis list | Yes | Yes | Yes | Yes | Not recorded |
| Our test call Measured by us | 297 ms | 5,159 ms | 7,868 ms | 2,866 ms | 181 ms |
| Browser call Measured by us | Allowed | Allowed | Allowed | Allowed | Allowed |
| Docs link Measured by us | Answered | Answered | Answered | Answered | Answered |
Questions
Does REST Countries need an API key?
REST Countries needs no key: you can call it without signing up.
Can I call REST Countries from JavaScript in the browser?
Yes. When we called it it sent Access-Control-Allow-Origin: *, so a web page can call it directly.
Where are the REST Countries docs?
At https://restcountries.com. When we checked, the link answered 200 in 3028 ms.
What are some alternatives to REST Countries?
Other Geocoding APIs in the list include administrative-divisons-db, BigDataCloud's Free API, bng2latlong and Country.
Listing from public-apis (github.com/marcelscruz/public-apis), MIT. Measurements are ours: how we check.