# Country Economic Data API - World Bank GDP, FX & Holidays (`centorprat/world-bank-country-economic-data`) Actor

Country economic data for any country (ISO code): World Bank GDP, GDP per capita, population, growth, inflation and unemployment, plus the live USD exchange rate and upcoming public holidays. One structured record per country for market research or agents. Keyless.

- **URL**: https://apify.com/centorprat/world-bank-country-economic-data.md
- **Developed by:** [Centor Prat](https://apify.com/centorprat) (community)
- **Categories:** Business, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $8.50 / 1,000 country briefs

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

## 🌐 Country Economic Data API: World Bank GDP, FX & Holidays

**One call, four official sources, one brief.** Give an ISO-2 country code (or many) and get a
single structured **market brief** per country — basics, key **economic indicators**, **FX rates**,
and **upcoming public holidays** — instead of making your agent stitch the World Bank, an FX API,
and a holiday API together.

Headless · **keyless** (no API keys to manage) · structured JSON out · built for AI agents.

### ⚡ Why it's different

Other actors give you *raw* World Bank data, *raw* FX, or *raw* holidays. This one **fuses** them
into one agent-ready brief: ask `"ES"`, get Spain's income level, GDP/capita, growth, inflation,
unemployment, EUR-per-USD, and the next holidays — in a single call.

### 📋 What you get (per country)

| Field | Meaning |
|---|---|
| `name`, `country`, `capital`, `region`, `incomeLevel` | Country basics (World Bank) |
| `latitude`, `longitude` | Country centroid |
| `indicators.gdpPerCapitaUsd` | GDP per capita (current US$) + year |
| `indicators.population` | Total population + year |
| `indicators.gdpGrowthPct` | Real GDP growth % + year |
| `indicators.inflationPct` | Consumer-price inflation % + year |
| `indicators.unemploymentPct` | Unemployment % + year |
| `fx.localCurrency` + `fx.localPerBase` | Local currency and its rate vs your base |
| `fx.majors` | Base → USD/EUR/GBP/JPY/CNY |
| `upcomingHolidays` | Next N public holidays (date + name + local name) |

### 📥 Input

| Field | Type | Meaning |
|---|---|---|
| `country` | string | A single ISO-2 code, e.g. `ES`, `US`, `JP` |
| `countries` | array | Many codes: `["ES","JP","US"]` (billed per country) |
| `baseCurrency` | string | FX base (default `USD`) |
| `holidaysCount` | integer | Upcoming holidays per country (default 5) |
| `webhookUrl` | string | POST the briefs here (Zapier/Make/n8n/custom) |

**Example input**

```json
{ "countries": ["ES", "JP", "US"], "baseCurrency": "USD", "holidaysCount": 5 }
```

### 📤 Output (one row per country)

```json
{
  "country": "ES", "name": "Spain", "capital": "Madrid",
  "region": "Europe & Central Asia", "incomeLevel": "High income",
  "latitude": 40.41, "longitude": -3.70,
  "indicators": {
    "gdpPerCapitaUsd": { "value": 38627.25, "year": "2025" },
    "population": { "value": 49355143, "year": "2025" },
    "gdpGrowthPct": { "value": 2.82, "year": "2025" },
    "inflationPct": { "value": 2.67, "year": "2025" },
    "unemploymentPct": { "value": 10.38, "year": "2025" }
  },
  "fx": { "base": "USD", "localCurrency": "EUR", "localPerBase": 0.8926,
          "majors": { "USD": 1, "EUR": 0.8926, "GBP": 0.7459, "JPY": 158.23, "CNY": 7.12 },
          "updated": "Mon, 12 Oct 2026 ..." },
  "upcomingHolidays": [ { "date": "2026-10-12", "name": "National Day of Spain", "localName": "Fiesta Nacional de España" } ],
  "sources": ["worldbank.org", "open.er-api.com", "date.nager.at"],
  "capturedAt": "2026-..."
}
```

### 💡 Use cases

- **Market research agents:** one call for a country snapshot instead of three integrations.
- **Travel / scheduling tools:** economy + currency + the next public holidays in one place.
- **Logistics / ops:** compare several markets (GDP/inflation/unemployment) side by side.
- **Localization / pricing:** local currency + FX to set region-appropriate prices.
- **Dashboards:** seed a country table with fresh indicators + FX on a schedule.

### 🤖 For AI agents (MCP)

Keyless, one call → a fused, structured brief. Every input is described in the schema for
programmatic/MCP use. Example MCP server config:

```json
{
  "mcpServers": {
    "country-brief": {
      "url": "https://mcp.apify.com/?tools=actors,docs,centorprat/world-bank-country-economic-data"
    }
  }
}
```

**Claude Code:** `claude mcp add --transport http apify "https://mcp.apify.com/?tools=actors,docs,centorprat/world-bank-country-economic-data" --header "Authorization: Bearer <YOUR_APIFY_TOKEN>"`

No extra setup: this Actor is callable from Claude, Cursor, ChatGPT or any MCP client through the Apify MCP server, and agents can find it on their own with the server's `search-actors` tool.

### 🚀 Ready-made tasks (one click)

Pre-configured runs for the most common jobs. Open one, change the input, run:

- [GDP, Inflation & Unemployment by Country](https://apify.com/centorprat/world-bank-country-economic-data/examples/gdp-inflation-unemployment-by-country): World Bank GDP, GDP per capita, growth, inflation, unemployment and population for any countries, plus FX rate. Structured, keyless.
- [Upcoming Public Holidays by Country](https://apify.com/centorprat/world-bank-country-economic-data/examples/public-holidays-by-country): Next public holidays for any list of countries, with dates and names, plus key economic indicators per country. Keyless holiday API.
- [Currency Exchange Rate by Country](https://apify.com/centorprat/world-bank-country-economic-data/examples/exchange-rate-by-country): Live exchange rate of any country's currency vs USD, EUR or another base, with GDP, inflation and population. Keyless FX API.

### ❓ FAQ

- **Do I need an API key?** No — all sources are keyless and free; you only pay the Actor's per-country fee.
- **How fresh is it?** FX updates daily; indicators are the most recent year the World Bank publishes.
- **Which countries?** Any with an ISO-2 code; indicators depend on World Bank coverage (some small states are sparse).
- **What if an indicator is missing?** The field returns `value: null` — the brief still composes.
- **Can I change the FX base?** Yes — `baseCurrency` (e.g. `EUR`, `GBP`).
- **How many countries per run?** As many as you pass; billed per country.
- **Why ISO-2 codes (not names)?** Codes are unambiguous and agent-friendly (`ES` not "Spain/España").
- **Is the data stored?** No — fetched, composed, returned.
- **Commercial use?** Yes — World Bank open data, ECB-derived FX (open.er-api), and Nager public-holiday data are all free to use.

### 📜 Data & attribution

Country data & indicators from the **World Bank** (open data); exchange rates from **open.er-api.com**
(ECB-sourced); public holidays from **date.nager.at**. Public data, composed and returned; nothing stored.

### 🔗 Related actors

Part of one suite of keyless, agent-ready composers by the same developer:

- [Shopify Store Leads + App Audit (Reviews, Email, Pixels)](https://apify.com/centorprat/shopify-store-leads-app-audit): Shopify stores by niche, verified and audited for missing apps (reviews, email/SMS, upsell, loyalty, chat, subscriptions), pixels and theme: scored leads with emails.
- [Google Maps Leads + Website Audit for Agencies](https://apify.com/centorprat/google-maps-leads-website-audit): local businesses from Google Maps audited for website, Google profile, reviews, booking and tracking gaps: scored, explained leads with phone and emails.
- [FEMA Flood Zone & Property Risk API - Zillow/Redfin Enricher](https://apify.com/centorprat/fema-flood-zone-property-risk): FEMA flood zone + 18-hazard FEMA risk index + neighborhood demographics per US address, or for a whole Zillow/Redfin dataset.
- [Domain Lookup API - DNS, MX, SPF, Tech & Contact Emails](https://apify.com/centorprat/domain-lookup-dns-mx-email): DNS + live homepage → IPs, MX/SPF, tech, socials and public contacts per domain.
- [Wikipedia & Wikidata API - Entity Facts, Summary & Pageviews](https://apify.com/centorprat/wikipedia-wikidata-api): Wikipedia + Wikidata + pageviews → one structured brief per company, person or place.
- [Weather, Air Quality & Earthquake Risk API by Location](https://apify.com/centorprat/weather-air-quality-earthquake-api): live weather + air quality + earthquakes → one clear/caution/hazard verdict per point, worldwide.
- [Aircraft Tracker API (ADS-B) - Approach & Military Alerts](https://apify.com/centorprat/aircraft-tracker-adsb): aircraft approaching a point with CPA/ETA + military/unidentified flags and alerts.
- [NARA Catalog Extractor](https://apify.com/centorprat/nara-catalog-extractor): US National Archives catalog search → digital-object download URLs + metadata.

# Actor input Schema

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

A single ISO 3166-1 alpha-2 country code. Example: ES (Spain), US, JP.

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

An array of ISO-2 codes, e.g. \["ES","JP","US"]. Billed per country.

## `baseCurrency` (type: `string`):

ISO-4217 base currency for the exchange-rate block. Default USD.

## `holidaysCount` (type: `integer`):

How many upcoming public holidays to return per country.

## `webhookUrl` (type: `string`):

If set, the briefs are POSTed here as JSON (Zapier/Make/n8n/custom).

## Actor input object example

```json
{
  "country": "ES",
  "baseCurrency": "USD",
  "holidaysCount": 5
}
```

# Actor output Schema

## `briefs` (type: `string`):

One fused brief per country: name/region/capital/income level, key World Bank indicators (GDP per capita, population, growth, inflation, unemployment), FX (local currency + majors), and upcoming public holidays.

# 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 = {
    "country": "ES",
    "baseCurrency": "USD"
};

// Run the Actor and wait for it to finish
const run = await client.actor("centorprat/world-bank-country-economic-data").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 = {
    "country": "ES",
    "baseCurrency": "USD",
}

# Run the Actor and wait for it to finish
run = client.actor("centorprat/world-bank-country-economic-data").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 '{
  "country": "ES",
  "baseCurrency": "USD"
}' |
apify call centorprat/world-bank-country-economic-data --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,centorprat/world-bank-country-economic-data"
        }
    }
}
```

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/sg7a3JtZ2nqmajgCg/builds/Swf809DjgiuTbw5mQ/openapi.json
