# Country Economic Snapshot — World Bank, One Flat Row (`alaudinburki/country-economic-snapshot`) Actor

GDP, population, inflation, unemployment and more for any country as one flat row — the latest available observation per indicator, each with its own year. Free, keyless World Bank data. Any World Bank indicator code also works.

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

## Pricing

from $2.00 / 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.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — 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

## Country Economic Snapshot — World Bank, One Flat Row

Market-research and expansion-planning teams pull country macro
indicators one at a time from the World Bank's data portal, then
reassemble them by hand. This returns **one flat row per country** —
GDP, population, inflation, unemployment, internet penetration — with the
latest available observation per indicator and the year that value is
actually from. Free, keyless.

### Input

```json
{ "countries": ["US", "PK", "DE"] }
```

Two- or three-letter ISO codes both work. Leave `indicators` empty for
all built-ins, or pass any raw World Bank indicator code (e.g.
`EN.ATM.CO2E.PC`).

### Built-in indicators

`gdpUsd` · `gdpPerCapitaUsd` · `population` · `inflationPercent` ·
`unemploymentPercent` · `internetUsersPercent`

### Sample output

```json
{
  "countryCode": "US",
  "countryName": "United States",
  "gdpUsdValue": 30769700000000,
  "gdpUsdYear": "2025",
  "populationValue": 341784857,
  "populationYear": "2025",
  "inflationPercentValue": 2.9495,
  "inflationPercentYear": "2024",
  "indicatorsRequested": 6,
  "indicatorsWithData": 6
}
```

### Typical uses

- **Market entry / expansion research** — compare candidate countries on
  the same indicators in one table.
- **Investment and risk screening** — macro context for country exposure.
- **Report and dashboard inputs** — flat, spreadsheet-ready rows rather
  than nested time series.

### Pricing

**$0.002 per country snapshot.**

### ⚠️ Read before you act — one real quirk, handled

- **Every value carries its own year, on purpose.** Different indicators
  publish on different schedules, so one country's GDP can be 2025 while
  its inflation figure is 2024. A single shared "as of" date would be
  wrong — hence `<indicator>Value` **and** `<indicator>Year` columns.
- **The newest row from the World Bank is often empty.** Verified live:
  US inflation returns 2025 → `null` (not published yet) before 2024 →
  2.95. This actor scans for the most recent row that actually has a
  value, so a country isn't reported as "no data" when real data sits one
  row down. `indicatorsWithData` tells you how many genuinely resolved.
- **An invalid country or indicator code returns no data, not an error
  row** — check `indicatorsWithData` and the QUALITY\_REPORT rather than
  assuming a null means "the value is zero."

### FAQ

- **Do I need an API key?** No — the World Bank's API is free and keyless.
- **Can I use indicators not in the built-in list?** Yes — pass any World
  Bank indicator code directly in `indicators`.
- **Why is one country's value older than another's?** Reporting lag
  varies by country and indicator; the `Year` column makes that explicit
  rather than hiding it.

### Related actors

- **Currency & FX Rates** — live and historical exchange rates, the
  companion to country-level macro data.
- **Federal Award Intelligence** — the same "official public data,
  aggregated into a usable row" approach, for US federal contracts.

# Actor input Schema

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

ISO country codes, e.g. US, PK, DE. Two-letter or three-letter codes both work.

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

Which indicators to fetch. Use the built-in keys (gdpUsd, gdpPerCapitaUsd, population, inflationPercent, unemploymentPercent, internetUsersPercent) or any raw World Bank indicator code (e.g. EN.ATM.CO2E.PC). Leave empty for all built-ins.

## Actor input object example

```json
{
  "countries": [
    "US",
    "PK"
  ]
}
```

# Actor output Schema

## `results` (type: `string`):

One flat row per country.

## `qualityReport` (type: `string`):

Countries and indicators queried, plus per-indicator problems.

# 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 = {
    "countries": [
        "US",
        "PK"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("alaudinburki/country-economic-snapshot").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 = { "countries": [
        "US",
        "PK",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("alaudinburki/country-economic-snapshot").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 '{
  "countries": [
    "US",
    "PK"
  ]
}' |
apify call alaudinburki/country-economic-snapshot --silent --output-dataset

```

## MCP server setup

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

```

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/4SpfGGLFHM91sl47V/builds/ASlttEyGSKhXvRDhz/openapi.json
