Numbeo API endpoint
Returns the global Numbeo ranking of countries for one index family, selected by the required `index`: `quality-of-life`, `crime`, `health-care`, `pollution`, `traffic` or `property-investment`. Each row has its `rank`, country and a list of named index values, such as the Crime Index and Safety Index for `crime`.
/numbeo/indices/rankings-by-countryQuery parameters:
index (required). Allowed values: quality-of-life, crime, health-care, pollution, traffic, property-investment.Response includes index, countries[] (rank, country, indices[] with name/value), source_url.
Example response (index=crime):
{"code":200,"msg":"OK","data":{"index":"crime","countries":[{"rank":1,"country":"Venezuela","indices":[{"name":"Crime Index","value":81.5},{"name":"Safety Index","value":18.5}]}],"source_url":"https://www.numbeo.com/crime/rankings_by_country.jsp"}}
| Field | Filled in, of 148 checked | Values in the sample |
|---|---|---|
| rank | 148 | 1 to 148, median 74 |
| country | 148 | “Papua New Guinea” and 147 other values |
| indices | 148 | median 2 entries |
| Parameter | Type | Required | Default | Description | Example |
|---|---|---|---|---|---|
| index | string | Yes | Index family Allowed values: quality-of-life, crime, health-care, pollution, traffic, property-investment. | quality-of-life | |
| x-api-key (header) | string | Yes | API key required |
curl -X GET "https://api.crawlora.net/api/v1/numbeo/indices/rankings-by-country?index=quality-of-life" \ -H "x-api-key: $CRAWLORA_API_KEY"
{
"code": 200,
"msg": "OK",
"data": {
"index": "crime",
"countries": [
{
"rank": 1,
"country": "Venezuela",
"indices": [
{
"name": "Crime Index",
"value": 81.5
},
{
"name": "Safety Index",
"value": 18.5
}
]
}
],
"source_url": "https://www.numbeo.com/crime/rankings_by_country.jsp"
}
}Request schema
No body schema
Response schema
#/definitions/numbeo.indicesRankingsByCountryResponseDoc
| Field | Type | Required | Enum | Bounds | Example | Description |
|---|---|---|---|---|---|---|
| code | integer | No | 200 | |||
| data | numbeo.IndicesRankingsByCountryResponse | No | ||||
| data.countries | array | No | Countries ranked for this index family, in rank order. | |||
| data.countries[].city | string | No | City name as Numbeo shows it. Set on city rankings. | |||
| data.countries[].city_slug | string | No | Numbeo city slug. Set on city rankings. | |||
| data.countries[].country | string | No | Country name as Numbeo shows it. Set on country rankings. | |||
| data.countries[].indices | array | No | Index values Numbeo publishes for this row, in table column order. | |||
| data.countries[].indices[].name | string | No | Name of the index, as Numbeo labels it, such as `Crime Index`. | |||
| data.countries[].indices[].value | number | No | Value of the index named in `name`. | |||
| data.countries[].rank | integer | No | Position in the Numbeo ranking, starting at 1. | |||
| data.index | string | No | Index family that was requested, such as `crime` or `traffic`. | |||
| data.source_url | string | No | URL the data was read from. | |||
| msg | string | No | OK |
| Status | Description | Schema |
|---|---|---|
| 400 | Bad Request | #/definitions/app.Response |
| 500 | Internal Server Error | #/definitions/app.Response |
| 503 | Service Unavailable | #/definitions/app.Response |
Use environment variables for secrets and keep Crawlora API keys server-side.
curl -X GET "https://api.crawlora.net/api/v1/numbeo/indices/rankings-by-country?index=quality-of-life" \
-H "x-api-key: $CRAWLORA_API_KEY"