# Numbeo City Cost and Quality of Life Scraper (`nimbryxo-studio/numbeo-city-cost-and-quality-of-life-scraper`) Actor

Look up cost of living, quality of life, crime, health care, pollution, traffic and property-price data for any city on Numbeo, compare two cities side by side, or pull the annual city rankings.

- **URL**: https://apify.com/nimbryxo-studio/numbeo-city-cost-and-quality-of-life-scraper.md
- **Developed by:** [Nimbryxo-studio](https://apify.com/nimbryxo-studio) (community)
- **Categories:** Travel, Real estate, Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.49 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Numbeo City Prices, Indices and Rankings Scraper

Numbeo publishes crowd-sourced prices and liveability indices for thousands of cities and countries. This actor turns those pages into structured JSON: itemized prices with low/high ranges, quality-of-life and safety indices, commute details, property metrics, two-city comparisons, country profiles, food/restaurant/gas/grocery prices, and historical or current rankings. It reads public pages without cookies, logins or API keys.

### What it does

- Scrapes every core Numbeo section: cost of living, quality of life, crime, health care, pollution, traffic, and property prices.
- Adds country profiles (national-average prices plus the ranked city table) and four market-price pages: food, restaurant menus, gasoline/vehicles, and groceries.
- Resolves city names through Numbeo's own city-search endpoint, so `New York`, `New York, NY`, `São Paulo` and pasted city URLs all reach the right page.
- Supports two-city comparisons with the site's own summary sentences and the equivalent-amount calculation.
- Returns all ranking families for cities, countries, regions, or the current rolling edition, with editions back to 2009.
- Converts prices to any of Numbeo's supported currencies and switches between metric and US units.
- Includes contributor counts, data-point counts and last-update dates when the page publishes them.
- Omits empty fields at every depth; no nulls, blank strings or placeholder values.

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `mode` | string | `costOfLiving` | Page family: `costOfLiving`, `costOfLivingComparison`, `qualityOfLife`, `crime`, `healthCare`, `pollution`, `traffic`, `propertyInvestment`, `topCities`, `country`, `foodPrices`, `restaurantPrices`, `gasPrices`, `groceryPrices` or `byUrl`. |
| `city` | string | – | City name or Numbeo city URL for city and market modes (the form pre-fills `New York`). |
| `cities` | array | `[]` | Additional cities to scrape in the same run. |
| `country` | string | `""` | Country name for `country`, `foodPrices`, `restaurantPrices`, `gasPrices` and `groceryPrices` modes. |
| `countries` | array | `[]` | Additional countries for the same modes. |
| `countrySections` | array | `["costOfLiving"]` | Sections to scrape in `country` mode: cost of living, quality of life, crime, health care, pollution, traffic, property. |
| `country1` | string | – | Country hint for city 1 in comparison mode (the form pre-fills `United States`). |
| `city1` | string | – | City 1 in comparison mode. |
| `country2` | string | – | Country hint for city 2 in comparison mode (the form pre-fills `Germany`). |
| `city2` | string | – | City 2 in comparison mode. |
| `rankingType` | string | `costOfLiving` | Ranking family: cost of living, quality of life, crime, health care, pollution, traffic or property. |
| `rankingScope` | string | `cities` | `cities`, `countries`, `region` or `current`. |
| `rankingPeriod` | string | `""` | Historical edition such as `2024`, `2024-mid` or `2009`; empty means the latest edition. |
| `region` | string | `world` | Region for `rankingScope=region`: `world`, `africa`, `northern-america`, `south-america`, `asia`, `europe` or `oceania`. |
| `urls` | array | `[]` | Direct Numbeo URLs; each is routed to the matching parser in `byUrl` mode. |
| `displayCurrency` | string | `""` | ISO currency code for every price; empty keeps local currencies. |
| `measurementSystem` | string | `metric` | `metric` or `US` units. |
| `maxItems` | integer | `5` | Maximum records to emit (1–1000). Raise it for full ranking tables. |
| `useProxy` | boolean | `false` | Route requests through Apify Proxy. |
| `autoEscalateOnBlock` | boolean | `true` | Retry through Apify Proxy after a direct rate-limit or challenge. |
| `proxyConfiguration` | object | `{"useApifyProxy": true, "apifyProxyGroups": []}` | Proxy settings used when `useProxy` is on or escalation triggers. |

Examples:

```json
{"mode": "costOfLiving", "city": "Berlin", "displayCurrency": "EUR", "maxItems": 1}
```

```json
{"mode": "costOfLivingComparison", "city1": "New York, NY", "country1": "United States", "city2": "Berlin", "country2": "Germany"}
```

```json
{"mode": "topCities", "rankingType": "propertyInvestment", "rankingScope": "countries", "rankingPeriod": "2024", "maxItems": 100}
```

```json
{"mode": "country", "country": "Germany", "countrySections": ["costOfLiving", "qualityOfLife", "crime"], "displayCurrency": "EUR"}
```

```json
{"mode": "byUrl", "urls": ["https://www.numbeo.com/cost-of-living/in/Tokyo", "https://www.numbeo.com/quality-of-life/rankings.jsp?title=2024"]}
```

### Output

Every record carries `recordType`, `siteName`, `scrapedAt` and `sourceUrl`. City and country records add `pageTitle`, `title`, `country`, `city`/`cityLabel`, `cityId` when resolved, `currency`, `displayCurrency`, `measurementSystem`, `contributors`, `dataPoints`, `lastUpdate` and `nearbyCities` when the page provides them.

- **Cost of living:** `prices` (`item`, `category`, `price`, `currency`, `priceCurrency`, `rangeLow`, `rangeHigh`), `summary` (family-of-four and single-person monthly costs in local and display currency, comparison city and percent), `categoryTotals`.
- **Quality of life:** `qualityOfLifeIndex`, `qualityOfLifeIndexRating`, `indices`, `indexDetails`, `components` (label, value, rating label), `contributorsMin`, `contributorsMax`.
- **Crime, health care, pollution:** `indices`, `indexDetails`, `sections` (each with `title` and `rows` of label/value/rating), `whoPollutionData` and `whoPollutionDetails` for pollution.
- **Traffic:** `indices`, `indexDetails`, `transportModes` (mode share), `averageCommute`, `commuteByMode`, `co2EmissionsKgPerYear`, `treesToOffsetCo2`.
- **Property:** `indices`, `indexDetails`, `rents` (rent and buy-price rows with category), `countryStatistics` (GDP per capita, GDP growth, population growth).
- **Comparison:** `comparison` rows with primary and alternate-currency prices per city plus `differencePercent`; `comparisonSummary`; specific difference fields; `standardOfLiving` equivalent amounts; `city1Label`, `city2Label`.
- **Rankings:** `rank`, `city` or `country`, the index fields for that ranking type, `rankingType`, `rankingScope`, `rankingPeriod`, `region` when applicable.
- **Country profiles:** the same price/index/section fields with `countrySection`, plus `cityRankings` for that country.
- **Market pages:** `prices` for food, gas and grocery pages; `menuItems` (with category) and `cityRankings` for restaurant pages.
- **Errors:** `recordType: "error"`, `errorKind`, `message`, and the attempted `url`/`city`/`country`.

### Notes and limits

- Numbeo rate-limits bursts from one IP (HTTP 429). The actor paces requests and retries with backoff; `autoEscalateOnBlock` can continue through Apify Proxy.
- Rankings are complete server-rendered tables, typically 300–600 cities or 90–150 countries. There is no pagination; `maxItems` is the only cap.
- Numbeo's city-search endpoint returns a short suggestion list. The actor picks the best exact match and accepts a country hint for ambiguous names.
- The premium “Prices by City” and “Prices by Country” tables require a paid Numbeo plan and are not scraped.
- Single-city pages show current data only; historical coverage is available through rankings.
- Data is crowd-sourced and changes as contributors update it. Each run reflects the pages at fetch time.

### FAQ

**Is this an official Numbeo API?**
No. It is an independent reader of Numbeo's public pages, not affiliated with Numbeo.

**Do I need a proxy or cookies?**
No cookies or login are used. Numbeo is usually reachable directly; proxy escalation is optional and automatic.

**Why are some ranges missing?**
Numbeo shows a low/high range only when enough contributions exist for that item. The field is omitted when the page does not show it.

**How do I get every ranking row?**
Set `maxItems` above the table size (for example `1000`). The daily test uses `1` to stay cheap.

**Can I scrape more than two cities in a comparison?**
Numbeo's comparison page is two cities only. Use `cities` with a city mode to compare many places from the resulting records.

# Actor input Schema

## `mode` (type: `string`):

What to scrape. City modes accept one city or a batch; country modes accept one country or a batch.

## `city` (type: `string`):

City name as shown on Numbeo, or a Numbeo city URL. Examples: `New York`, `Berlin`, `Tokyo`, `Sao Paulo`, `Cambridge, MA`. The actor resolves the exact Numbeo city automatically.

## `cities` (type: `array`):

Additional cities to scrape in the same run. Each city is resolved and scraped in turn.

## `country` (type: `string`):

Country name as shown on Numbeo (English). Used by `country`, `foodPrices`, `restaurantPrices`, `gasPrices` and `groceryPrices` modes.

## `countries` (type: `array`):

Additional country names for the country and market-price modes.

## `countrySections` (type: `array`):

Which country-level pages to scrape in `country` mode. Each selected section emits one record.

## `country1` (type: `string`):

Country of city 1, used to disambiguate the city name in comparison mode.

## `city1` (type: `string`):

First city in the comparison (e.g. `New York, NY` or `Berlin`).

## `country2` (type: `string`):

Country of city 2, used to disambiguate the city name in comparison mode.

## `city2` (type: `string`):

Second city in the comparison (e.g. `Berlin`).

## `rankingType` (type: `string`):

Which Numbeo index table to scrape in `topCities` mode.

## `rankingScope` (type: `string`):

Cities worldwide, countries, one region, or Numbeo's current (rolling) ranking where available.

## `rankingPeriod` (type: `string`):

Historical edition (Numbeo publishes a year-end and mid-year table back to 2009). Leave empty for the latest edition.

## `region` (type: `string`):

Region filter used when `rankingScope` is `region`.

## `urls` (type: `array`):

Direct Numbeo URLs (city, comparison, country, ranking, food, restaurant, gas or grocery pages). Each URL is routed to the matching parser.

## `displayCurrency` (type: `string`):

Convert every price to this ISO 4217 currency. Leave empty to keep each page's local currency.

## `measurementSystem` (type: `string`):

Metric (litres, kilograms, square metres) or US (gallons, pounds, square feet).

## `maxItems` (type: `integer`):

Hard cap on emitted records. Rankings can return 500+ rows; raise this to get the full table.

## `useProxy` (type: `boolean`):

Route requests through Apify Proxy. Numbeo is usually reachable directly; enable this if your runs see 429 rate-limit pages.

## `autoEscalateOnBlock` (type: `boolean`):

When a direct request is rate-limited (HTTP 429) or challenged, retry through Apify Proxy for the rest of the run.

## `proxyConfiguration` (type: `object`):

Apify Proxy configuration. Used when `useProxy` is enabled or auto-escalation triggers.

## Actor input object example

```json
{
  "mode": "costOfLiving",
  "city": "New York",
  "cities": [],
  "country": "",
  "countries": [],
  "countrySections": [
    "costOfLiving"
  ],
  "country1": "United States",
  "country2": "Germany",
  "rankingType": "costOfLiving",
  "rankingScope": "cities",
  "rankingPeriod": "",
  "region": "world",
  "urls": [],
  "displayCurrency": "",
  "measurementSystem": "metric",
  "maxItems": 1,
  "useProxy": false,
  "autoEscalateOnBlock": true,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": []
  }
}
```

# Actor output Schema

## `records` (type: `string`):

Dataset with one JSON object per city, country, comparison or ranking row. Fields vary by recordType; see the README for the full field list.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "mode": "costOfLiving",
    "city": "New York",
    "cities": [],
    "country": "",
    "countries": [],
    "countrySections": [
        "costOfLiving"
    ],
    "country1": "United States",
    "country2": "Germany",
    "rankingType": "costOfLiving",
    "rankingScope": "cities",
    "rankingPeriod": "",
    "region": "world",
    "urls": [],
    "displayCurrency": "",
    "measurementSystem": "metric",
    "maxItems": 1,
    "useProxy": false,
    "autoEscalateOnBlock": true,
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": []
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("nimbryxo-studio/numbeo-city-cost-and-quality-of-life-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "mode": "costOfLiving",
    "city": "New York",
    "cities": [],
    "country": "",
    "countries": [],
    "countrySections": ["costOfLiving"],
    "country1": "United States",
    "country2": "Germany",
    "rankingType": "costOfLiving",
    "rankingScope": "cities",
    "rankingPeriod": "",
    "region": "world",
    "urls": [],
    "displayCurrency": "",
    "measurementSystem": "metric",
    "maxItems": 1,
    "useProxy": False,
    "autoEscalateOnBlock": True,
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": [],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("nimbryxo-studio/numbeo-city-cost-and-quality-of-life-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "mode": "costOfLiving",
  "city": "New York",
  "cities": [],
  "country": "",
  "countries": [],
  "countrySections": [
    "costOfLiving"
  ],
  "country1": "United States",
  "country2": "Germany",
  "rankingType": "costOfLiving",
  "rankingScope": "cities",
  "rankingPeriod": "",
  "region": "world",
  "urls": [],
  "displayCurrency": "",
  "measurementSystem": "metric",
  "maxItems": 1,
  "useProxy": false,
  "autoEscalateOnBlock": true,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": []
  }
}' |
apify call nimbryxo-studio/numbeo-city-cost-and-quality-of-life-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,nimbryxo-studio/numbeo-city-cost-and-quality-of-life-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/AadLBFDKJ72EgjkFY/builds/8L3VwdbJfPdV4MYIA/openapi.json
