Countries API¶
Endpoint¶
GET https://integrations.app.traveln.ai/api/v1/countries/?limit=20&offset=0
List available countries.
Authentication: Authorization: Api-Key <sso_hmac_secret>
Usage model: server-to-server only
Query parameters¶
| Parameter | Type | Required | Description |
|---|---|---|---|
limit | integer | No | Max items to return |
offset | integer | No | Items to skip for paging |
search | string | No | Search by country name or code |
region | string | No | Filter by region when supported upstream |
Example requests¶
curl "https://integrations.app.traveln.ai/api/v1/countries/?limit=20&offset=0" \
-H "Authorization: Api-Key <sso_hmac_secret>" \
-H "Accept: application/json"
const res = await fetch("https://integrations.app.traveln.ai/api/v1/countries/?limit=20&offset=0", {
headers: {
Authorization: "Api-Key <sso_hmac_secret>",
Accept: "application/json",
},
})
const payload = await res.json()
console.log(payload)
import requests
res = requests.get(
"https://integrations.app.traveln.ai/api/v1/countries/",
params={"limit": 20, "offset": 0},
headers={
"Authorization": "Api-Key <sso_hmac_secret>",
"Accept": "application/json",
},
timeout=30,
)
payload = res.json()
print(payload)
Example response¶
{
"success": true,
"message": "Countries retrieved.",
"data": {
"count": 2,
"next": null,
"previous": null,
"results": [
{
"id": "e50e73e1-003a-4127-bacc-8e562662b332",
"code": "lb",
"name": "Lebanon",
"phone_code": "+961",
"supported": true,
"flag": "https://s3.me-south-1.amazonaws.com/traveln.media.data/countries-flag/dummy_data/flags/lb.png"
},
{
"id": "c3e7bb7a-2a01-4281-b9fa-b4c48032fce9",
"code": "ae",
"name": "United Arab Emirates",
"phone_code": "+971",
"supported": true,
"flag": "https://s3.me-south-1.amazonaws.com/traveln.media.data/countries-flag/dummy_data/flags/ae.png"
}
]
},
"error": null
}
Error responses¶
401 Unauthorized: missing or invalid integrations API secret.502 Bad Gateway: upstream API could not be reached.503 Service Unavailable: tenant backend API key is not configured.- Upstream
4xxand5xx: returned with the same HTTP status and wrapped in the integrations error envelope.