# Imf Data Mapper Scraper (`kawsar/imf-data-mapper-scraper`) Actor

Pulls IMF World Economic Outlook data like GDP growth, inflation, and debt into clean rows by country and year. Pick your indicators and countries, run it, then download the results as CSV, JSON, or Excel. Also lists all indicators and country codes. Easy to schedule for new releases.

- **URL**: https://apify.com/kawsar/imf-data-mapper-scraper.md
- **Developed by:** [Kawsar](https://apify.com/kawsar) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.99 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
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

### IMF Data Mapper Scraper: WEO Macroeconomic Indicators

<p align="center">
  <img src="https://imgur.com/1J5HmeC.png" alt="USA Automotive Leads Hub" style="max-width:100%; border-radius:14px; width:680px;" />
</p>

An efficient tool for pulling World Economic Outlook series, including real GDP growth, inflation, debt, and the complete indicator catalog. It writes structured rows per country and year without requiring any credentials or setup.

The same run can list every indicator or every country code. Results land in an Apify dataset, so you can download CSV, JSON, or Excel, or schedule the actor to keep a reliable archive.

### Use cases

- **Macro research**: Archive real GDP growth (`NGDP_RPCH`) for the United States or any other ISO3 code without clicking through charts.
- **Cross-country panels**: Request several indicator codes and filter down to the specific countries you care about.
- **Catalog lookup**: List indicator names, units, and the World Economic Outlook vintage before selecting your series.
- **Country codes**: Export the country list (ISO3 plus label) for quick spreadsheet joins.
- **Scheduled snapshots**: Run on a timer when a new WEO vintage drops and store the resulting dataset automatically.

### Input

| Parameter | Type | Default | Description |
| --- | --- | --- | --- |
| `mode` | string | `indicator_values` | Indicator observations, the indicator catalog, or the country catalog. |
| `indicators` | array | `NGDP_RPCH` | Indicator codes, one per line. Used when mode is indicator values. |
| `countries` | array | `USA` | ISO3 codes to keep. An empty list keeps all countries until max items. |
| `maxItems` | integer | `100` | Maximum rows per run, including error rows. Hard cap 1000. |
| `timeoutSecs` | integer | `300` | Overall run time limit in seconds. |
| `requestTimeoutSecs` | integer | `30` | Per-request timeout in seconds. |
| `proxyConfiguration` | object | `{"useApifyProxy": false}` | Optional proxy. Default is no proxy. |

#### Example input

```json
{
  "mode": "indicator_values",
  "indicators": ["NGDP_RPCH"],
  "countries": ["USA"],
  "maxItems": 100,
  "timeoutSecs": 300,
  "requestTimeoutSecs": 30,
  "proxyConfiguration": { "useApifyProxy": false }
}

```

### What data does this actor extract?

Indicator value mode writes one row per indicator, country, and year. Catalog modes write one row per indicator or country. Error rows preserve context so a bad code does not disrupt the rest of the run.

```json
{
  "indicatorCode": "NGDP_RPCH",
  "indicatorLabel": null,
  "indicatorText": null,
  "indicatorSource": null,
  "unit": null,
  "datasetName": null,
  "lastModified": null,
  "countryCode": "USA",
  "countryLabel": null,
  "observationYear": "2024",
  "numericValue": 2.8,
  "scrapedAt": "2026-10-12T00:00:00+00:00",
  "sourceUrl": "https://www.imf.org/external/datamapper/api/v1/NGDP_RPCH/USA",
  "error": null
}

```

| Field | Type | Description |
| --- | --- | --- |
| `indicatorCode` | string | Indicator code, such as `NGDP_RPCH`. |
| `indicatorLabel` | string | Name from the indicator catalog. |
| `indicatorText` | string | Definition text from the catalog. |
| `indicatorSource` | string | Publication credit, such as World Economic Outlook. |
| `unit` | string | Unit of measure. |
| `datasetName` | string | Dataset code, such as `WEO`. |
| `lastModified` | string | Catalog last-modified timestamp. |
| `countryCode` | string | ISO3 country code. |
| `countryLabel` | string | Country name from the country catalog. |
| `observationYear` | string | Year of the observation. |
| `numericValue` | number | Value for that country and year. |
| `scrapedAt` | string | UTC time when the row was built. |
| `sourceUrl` | string | Reference URL for the request. |
| `error` | string | Set only on error rows. |

A United States real GDP growth pull starts at 1980 and includes later years and projections. `maxItems` stops the dataset early if you only want the initial years.

### FAQ

**Why do I get every year for one country?**
Each indicator request returns the whole series. Set `maxItems` if you want a shorter dataset. Years are sorted from earliest to latest.

**What happens if an indicator code is wrong?**
A bad code can still come back as an alternate response structure. The actor writes an error row and continues processing without crashing.

**Can I export to CSV, JSON, or Excel?**
Yes. Apify stores the dataset and offers those downloads directly from your run.

**How many rows can one run return?**
Up to `maxItems`, capped at 1000 per run. The country catalog contains about 241 rows and the indicator catalog contains about 132, so adjust `maxItems` if you want the full list in one go.

#### Trademark Notice

IMF Data Mapper and related names, logos, and trademarks belong to their respective owners. Their use in this documentation is solely to identify the source of the data and does not imply affiliation, sponsorship, endorsement, or partnership.

#### Disclaimer

Disclaimer: This Actor is an independent tool and is not affiliated with, endorsed by, sponsored by, or otherwise officially associated with IMF Data Mapper or its owners. All data is collected from publicly available sources. Users are responsible for complying with the source's terms of use, rate limits, and attribution or licensing requirements.

#### Is web scraping legal?

This Actor only collects publicly available data without bypassing any access controls. Scraping public data is generally legal, but how you use it matters:

- **Personal data:** If the results include personal data (for example names, emails, or profile details), laws such as the GDPR in the EU and the CCPA in California may apply. Only collect and store personal data when you have a legitimate reason.
- **Copyright:** Some content (articles, images, descriptions) may be protected by copyright. Do not republish full copyrighted content without permission.
- **Terms of use:** Respect the source's terms, stated rate limits, and any attribution or non-commercial-use requirements.
- **Legal advice:** This is general information, not legal advice. If you're unsure, consult a lawyer.

To learn more, read Apify's guide: [Is web scraping legal?](https://blog.apify.com/is-web-scraping-legal/)

# Actor input Schema

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

Choose indicator observations, the indicator catalog, or the country catalog.

## `indicators` (type: `array`):

DataMapper indicator codes to download, one per line. Used by indicator values mode. Example: NGDP_RPCH for real GDP growth.

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

ISO3 country codes to keep, one per line. The public indicator endpoint returns every country, and the actor filters to this list. Leave empty to keep every country until max items is reached.

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

Maximum dataset rows for this run, including error rows. Values above 1000 are clamped to 1000.

## `timeoutSecs` (type: `integer`):

Overall time limit for the run, in seconds. The actor stops when this limit is reached.

## `requestTimeoutSecs` (type: `integer`):

Per-request timeout for each DataMapper call, in seconds.

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

Optional proxy for DataMapper requests. Leave Apify Proxy off unless the public endpoint blocks your IP. The actor does not use a proxy by default.

## Actor input object example

```json
{
  "mode": "indicator_values",
  "indicators": [
    "NGDP_RPCH"
  ],
  "countries": [
    "USA"
  ],
  "maxItems": 100,
  "timeoutSecs": 300,
  "requestTimeoutSecs": 30,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `datasetUrl` (type: `string`):

Default dataset for this run.

## `datasetItemsUrl` (type: `string`):

JSON items in the default dataset.

# 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 = {
    "indicators": [
        "NGDP_RPCH"
    ],
    "countries": [
        "USA"
    ],
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("kawsar/imf-data-mapper-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 = {
    "indicators": ["NGDP_RPCH"],
    "countries": ["USA"],
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("kawsar/imf-data-mapper-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 '{
  "indicators": [
    "NGDP_RPCH"
  ],
  "countries": [
    "USA"
  ],
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call kawsar/imf-data-mapper-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,kawsar/imf-data-mapper-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/NGBhGfyRkUvt8u5CH/builds/AgT1HVRPhY7e7kbt7/openapi.json
