# OECD Data Scraper (`crawlerbros/oecd-data-scraper`) Actor

Scrape OECD economic and social statistics via the SDMX REST API - GDP, employment, trade, inequality, house prices, and more for 38+ OECD member countries.

- **URL**: https://apify.com/crawlerbros/oecd-data-scraper.md
- **Developed by:** [Crawler Bros](https://apify.com/crawlerbros) (community)
- **Categories:** Automation, Developer tools, Integrations
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## OECD Data Scraper

Access economic and social statistics from the **OECD (Organisation for Economic Co-operation and Development)** via the official SDMX REST API. Covers GDP, employment, trade, inequality, housing, and more for 38+ OECD member countries and partners.

No API key required. Data is publicly available at [data-explorer.oecd.org](https://data-explorer.oecd.org/).

---

### What Can It Do?

- **Browse available datasets** — discover all OECD datasets with descriptions and categories
- **Fetch time-series data** — get indicator values for specific countries and date ranges
- **Multi-country queries** — pull data for multiple countries in one run
- **Diverse indicators** — GDP growth, unemployment, trade flows, Gini coefficients, house prices, and more
- **Standard SDMX format** — uses the official OECD SDMX JSON API

---

### Input

| Field | Type | Description | Example |
|-------|------|-------------|---------|
| `mode` | select | `searchDatasets` or `getIndicator` | `searchDatasets` |
| `datasetCode` | string | OECD dataflow ID (from searchDatasets) | `DSD_NAMAIN1@DF_QNA_EXPENDITURE_GROWTH_OECD` |
| `countries` | array | ISO-3 country codes | `["USA", "GBR", "AUS"]` |
| `startYear` | integer | First year (1990–2030) | `2020` |
| `endYear` | integer | Last year (1990–2030) | `2022` |
| `maxItems` | integer | Records cap (1–1000) | `100` |

---

### Available Datasets

| Dataset Code | Name | Category |
|-------------|------|----------|
| `DSD_NAMAIN1@DF_QNA_EXPENDITURE_GROWTH_OECD` | Quarterly National Accounts: GDP & Expenditure (OECD) | National Accounts |
| `DSD_NAMAIN1@DF_QNA_EXPENDITURE_GROWTH_NON_OECD` | Quarterly National Accounts: GDP & Expenditure (Non-OECD) | National Accounts |
| `DSD_ALFS@DF_SUMTAB` | Annual Labour Force Statistics — Summary Tables | Labour |
| `DSD_BATIS@DF_BATIS` | Balanced Trade in Services (BaTIS) | Trade |
| `DSD_BIMTS@DF_BIMTS_HS2017_2D` | Balanced International Merchandise Trade | Trade |
| `DSD_WISE_IDD@DF_IDD` | Income Distribution Database (IDD) | Social |
| `DSD_WEALTH@DF_WEALTH` | Wealth Distribution Database | Social |
| `DSD_AN_HOUSE_PRICES@DF_HOUSE_PRICES` | Analytical House Price Indicators | Housing |
| `DSD_FUA_CLIM@DF_TEMPERATURES` | Air Temperature — Cities and FUAs | Environment |

Run `searchDatasets` mode to get the full list with descriptions.

---

### Output

#### Dataset Record (searchDatasets mode)

| Field | Type | Description |
|-------|------|-------------|
| `datasetCode` | string | Unique dataset/dataflow identifier |
| `agencyId` | string | OECD agency responsible |
| `name` | string | Full dataset name |
| `description` | string | What the dataset covers |
| `category` | string | Thematic category |
| `frequency` | array | Available frequencies (A, Q, M) |
| `version` | string | Dataset version |
| `sourceUrl` | string | OECD data explorer URL |
| `recordType` | string | "dataset" |
| `scrapedAt` | string | ISO timestamp |

#### Indicator Record (getIndicator mode)

| Field | Type | Description |
|-------|------|-------------|
| `datasetCode` | string | Dataset identifier |
| `agencyId` | string | OECD agency |
| `countryCode` | string | ISO-3 country code (e.g. "USA") |
| `countryName` | string | Country name |
| `indicatorCode` | string | Indicator/measure code |
| `indicatorName` | string | Indicator description |
| `period` | string | Year or quarter (e.g. "2022" or "2022-Q3") |
| `value` | float | Numeric value |
| `frequency` | string | "A" (annual), "Q" (quarterly), "M" (monthly) |
| `sourceUrl` | string | OECD data explorer URL |
| `recordType` | string | "indicator" |
| `scrapedAt` | string | ISO timestamp |

---

### Example Use Cases

#### 1. Discover Available Datasets
```json
{
  "mode": "searchDatasets",
  "maxItems": 20
}
````

#### 2. US Quarterly GDP Growth (2020–2022)

```json
{
  "mode": "getIndicator",
  "datasetCode": "DSD_NAMAIN1@DF_QNA_EXPENDITURE_GROWTH_OECD",
  "countries": ["USA"],
  "startYear": 2020,
  "endYear": 2022,
  "maxItems": 100
}
```

#### 3. Multi-Country Labour Statistics

```json
{
  "mode": "getIndicator",
  "datasetCode": "DSD_ALFS@DF_SUMTAB",
  "countries": ["USA", "GBR", "AUS", "DEU"],
  "startYear": 2018,
  "endYear": 2022
}
```

#### 4. Income Inequality (Gini Coefficients)

```json
{
  "mode": "getIndicator",
  "datasetCode": "DSD_WISE_IDD@DF_IDD",
  "countries": ["USA", "FRA", "SWE"],
  "startYear": 2015,
  "endYear": 2022
}
```

#### 5. House Price Indices

```json
{
  "mode": "getIndicator",
  "datasetCode": "DSD_AN_HOUSE_PRICES@DF_HOUSE_PRICES",
  "countries": ["USA", "GBR", "AUS"],
  "startYear": 2018,
  "endYear": 2023
}
```

***

### Frequently Asked Questions

**Do I need an API key?**
No. The OECD SDMX API is publicly accessible without registration.

**How do I find the right dataset code?**
Run the actor in `searchDatasets` mode first. Each record contains the `datasetCode` you can copy into `getIndicator` mode.

**What are ISO-3 country codes?**
Three-letter codes: USA (United States), GBR (United Kingdom), AUS (Australia), DEU (Germany), FRA (France), JPN (Japan), CAN (Canada), ITA (Italy), KOR (Korea), MEX (Mexico).

**Why might I get no results for getIndicator?**
Some datasets have specific dimension requirements. Try `searchDatasets` mode to verify the dataset exists and check the description. Some datasets cover only OECD members.

**What does "frequency" mean?**
A = Annual (yearly data), Q = Quarterly (every 3 months), M = Monthly.

**How recent is the data?**
OECD data is typically 6–18 months behind the current date, depending on the dataset and country reporting speed.

***

### Data Source

Data comes from the [OECD Data Explorer](https://data-explorer.oecd.org/) via the [OECD SDMX REST API](https://sdmx.oecd.org/public/rest/). All data is © OECD and licensed under the [OECD Terms and Conditions](https://www.oecd.org/termsandconditions/).

# Actor input Schema

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

searchDatasets: list all available OECD datasets with descriptions. getIndicator: fetch actual time-series data for a dataset.

## `datasetCode` (type: `string`):

The OECD dataflow ID to fetch data from. Run searchDatasets first to get valid codes. Example: DSD\_NAMAIN1@DF\_QNA\_EXPENDITURE\_GROWTH\_OECD

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

List of ISO-3 country codes to filter data. Examples: USA, GBR, AUS, DEU, FRA, JPN, CAN, ITA. Leave empty for all countries.

## `startYear` (type: `integer`):

First year of the time period to fetch (inclusive).

## `endYear` (type: `integer`):

Last year of the time period to fetch (inclusive).

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

Maximum number of records to return (1â€“1000).

## Actor input object example

```json
{
  "mode": "searchDatasets",
  "datasetCode": "DSD_NAMAIN1@DF_QNA_EXPENDITURE_GROWTH_OECD",
  "countries": [
    "USA"
  ],
  "startYear": 2020,
  "endYear": 2022,
  "maxItems": 100
}
```

# Actor output Schema

## `indicators` (type: `string`):

Dataset containing OECD indicator records or dataset catalog entries.

# 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": "searchDatasets",
    "datasetCode": "DSD_NAMAIN1@DF_QNA_EXPENDITURE_GROWTH_OECD",
    "countries": [
        "USA"
    ],
    "startYear": 2020,
    "endYear": 2022,
    "maxItems": 100
};

// Run the Actor and wait for it to finish
const run = await client.actor("crawlerbros/oecd-data-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": "searchDatasets",
    "datasetCode": "DSD_NAMAIN1@DF_QNA_EXPENDITURE_GROWTH_OECD",
    "countries": ["USA"],
    "startYear": 2020,
    "endYear": 2022,
    "maxItems": 100,
}

# Run the Actor and wait for it to finish
run = client.actor("crawlerbros/oecd-data-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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": "searchDatasets",
  "datasetCode": "DSD_NAMAIN1@DF_QNA_EXPENDITURE_GROWTH_OECD",
  "countries": [
    "USA"
  ],
  "startYear": 2020,
  "endYear": 2022,
  "maxItems": 100
}' |
apify call crawlerbros/oecd-data-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=crawlerbros/oecd-data-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "OECD Data Scraper",
        "description": "Scrape OECD economic and social statistics via the SDMX REST API - GDP, employment, trade, inequality, house prices, and more for 38+ OECD member countries.",
        "version": "1.0",
        "x-build-id": "SWqdAql5jcM9Ru8kd"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/crawlerbros~oecd-data-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-crawlerbros-oecd-data-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/crawlerbros~oecd-data-scraper/runs": {
            "post": {
                "operationId": "runs-sync-crawlerbros-oecd-data-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/crawlerbros~oecd-data-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-crawlerbros-oecd-data-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "mode"
                ],
                "properties": {
                    "mode": {
                        "title": "Mode",
                        "enum": [
                            "searchDatasets",
                            "getIndicator"
                        ],
                        "type": "string",
                        "description": "searchDatasets: list all available OECD datasets with descriptions. getIndicator: fetch actual time-series data for a dataset.",
                        "default": "searchDatasets"
                    },
                    "datasetCode": {
                        "title": "Dataset Code",
                        "type": "string",
                        "description": "The OECD dataflow ID to fetch data from. Run searchDatasets first to get valid codes. Example: DSD_NAMAIN1@DF_QNA_EXPENDITURE_GROWTH_OECD"
                    },
                    "countries": {
                        "title": "Countries (ISO-3 codes)",
                        "type": "array",
                        "description": "List of ISO-3 country codes to filter data. Examples: USA, GBR, AUS, DEU, FRA, JPN, CAN, ITA. Leave empty for all countries.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "startYear": {
                        "title": "Start Year",
                        "minimum": 1990,
                        "maximum": 2030,
                        "type": "integer",
                        "description": "First year of the time period to fetch (inclusive).",
                        "default": 2020
                    },
                    "endYear": {
                        "title": "End Year",
                        "minimum": 1990,
                        "maximum": 2030,
                        "type": "integer",
                        "description": "Last year of the time period to fetch (inclusive).",
                        "default": 2022
                    },
                    "maxItems": {
                        "title": "Max Items",
                        "minimum": 1,
                        "maximum": 1000,
                        "type": "integer",
                        "description": "Maximum number of records to return (1â€“1000).",
                        "default": 100
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
