Retrieve information about the seven continents and their constituent countries.
Standards Used
- ISO 3166-1
The Continent object#
| Field | Type | Required | Description |
|---|---|---|---|
| code | string | Yes | Two-letter continent code. Example: AS |
| countries | string[] | Yes | Countries in this continent (alpha-2 codes). Example: ["JP","CN","KR","IN"] |
| name | string | Yes | Continent name. Example: Asia |
Endpoints#
Response
| Field | Type | Required | Description |
|---|---|---|---|
| code | string | Yes | Two-letter continent code. Example: AS |
| countries | string[] | Yes | Countries in this continent (alpha-2 codes). Example: ["JP","CN","KR","IN"] |
| name | string | Yes | Continent name. Example: Asia |
Example Request
const response = await fetch(
'https://worlddataapi.com/v1/continents',
{
headers: {
'X-API-Key': 'YOUR_API_KEY'
}
}
);
const data = await response.json();import requests
response = requests.get(
'https://worlddataapi.com/v1/continents',
headers={
'X-API-Key': 'YOUR_API_KEY'
}
)
data = response.json()curl "https://worlddataapi.com/v1/continents"
-H "X-API-Key: YOUR_API_KEY"Error Responses
| Status | Description |
|---|---|
| 429 | Rate limit exceeded |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| identifierpath | string | Yes | Continent code (e.g., 'AS', 'EU') or name |
Response
| Field | Type | Required | Description |
|---|---|---|---|
| code | string | Yes | Two-letter continent code. Example: AS |
| countries | string[] | Yes | Countries in this continent (alpha-2 codes). Example: ["JP","CN","KR","IN"] |
| name | string | Yes | Continent name. Example: Asia |
Example Request
const response = await fetch(
'https://worlddataapi.com/v1/continents/example',
{
headers: {
'X-API-Key': 'YOUR_API_KEY'
}
}
);
const data = await response.json();import requests
response = requests.get(
'https://worlddataapi.com/v1/continents/example',
headers={
'X-API-Key': 'YOUR_API_KEY'
}
)
data = response.json()curl "https://worlddataapi.com/v1/continents/example"
-H "X-API-Key: YOUR_API_KEY"Error Responses
| Status | Description |
|---|---|
| 404 | Continent not found |