# Inflation Tracker API 📊 (`shahidirfan/inflation-tracker-api`) Actor

Monitor real-time inflation rates, CPI trends & economic indicators across global markets. Extract, analyze & visualize inflation data instantly. Perfect for fintech, research & market intelligence platforms. Automate economic data collection effortlessly.

- **URL**: https://apify.com/shahidirfan/inflation-tracker-api.md
- **Developed by:** [Shahid Irfan](https://apify.com/shahidirfan) (community)
- **Categories:** Automation, Developer tools, Other
- **Stats:** 8 total users, 2 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

## 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

### What does Inflation Tracker API do?

Inflation Tracker API is a World Bank inflation data extractor for collecting annual consumer price index observations across countries and years. Provide a World Bank indicator URL, optionally filter by country and year, and receive a structured Apify dataset with inflation values, country details, indicator metadata, and source links.

The default indicator is `FP.CPI.TOTL.ZG`, Inflation, consumer prices (annual %). You can collect one year, a historical range, or the complete available history for a country or for all economies. The output is suitable for economic research, dashboards, market analysis, pricing reviews, and scheduled monitoring.

### Why use Inflation Tracker API?

- **Create comparable country datasets** - Collect the same indicator for one country, several ISO3 countries, or all available economies.
- **Analyze historical trends** - Compare inflation over a selected year range or retrieve the complete historical record from 1960 onward when available.
- **Use source metadata with every result** - Keep the indicator name, database, methodology note, original organization, topics, and source URL alongside each observation.
- **Prepare data for business decisions** - Support pricing reviews, market expansion research, country risk analysis, economic dashboards, and policy research.
- **Automate recurring collection** - Run the Actor on demand or on a schedule, then send new datasets to webhooks, spreadsheets, BI tools, or other workflows.
- **Choose the output size** - Validate a small run first with `results_wanted`, then increase the limit or use `fetchAllData` for a broader dataset.

### What data can you extract from the World Bank?

| Field | Type | Description |
|-------|------|-------------|
| `indicator_id` | String | World Bank indicator code, such as `FP.CPI.TOTL.ZG`. |
| `indicator_name` | String | Human-readable name of the selected indicator. |
| `country_id` | String | Country or economy identifier used by the World Bank. |
| `country_name` | String | Country or economy name. |
| `country_iso3` | String | Three-letter ISO country code when available. |
| `year` | Integer | Observation year. |
| `inflation_rate` | Number | Annual indicator value, expressed as a percentage for the default inflation indicator. |
| `obs_status` | String | Observation status flag when supplied by the source. |
| `decimal_places` | Integer | Suggested number of decimal places for displaying the observation. |
| `source_database` | String | World Bank database containing the indicator. |
| `source_note` | String | Methodological description of the indicator. |
| `source_organization` | String | Organization that originally provided the data. |
| `topics` | String | Comma-separated topic categories associated with the indicator. |
| `source_url` | String | World Bank source URL used for the observation. |

### How to collect World Bank inflation data

1. Open Inflation Tracker API on Apify Store.
2. Optionally add a World Bank indicator URL. The prefilled URL uses the default annual inflation indicator.
3. Enter `all` for global results or add one or more comma-separated ISO3 country codes such as `USA,CAN,PAK`.
4. Set `date_from` and `date_to` for a specific period, or enable `fetchAllData` for the complete available history.
5. Set `results_wanted` and `max_pages` for a controlled run.
6. Start the Actor, review the dataset, and export the records or connect the run to your workflow.

### Input Parameters

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| `url` | String | No | UI prefill: `https://data.worldbank.org/indicator/FP.CPI.TOTL.ZG?year=2024` | World Bank indicator page or supported World Bank data URL. The indicator, year, and country can be read from the URL. |
| `location` | String | No | UI prefill: `all` | Country filter. Use `all` for global results or comma-separated ISO3 codes such as `USA,CAN,PAK`. |
| `date_from` | Integer | No | Not set | First year to include. Use a year from 1960 onward. |
| `date_to` | Integer | No | Not set | Last year to include. Use a year from 1960 onward. |
| `fetchAllData` | Boolean | No | `false` | Collect all available years and ignore the date range and `results_wanted` limit. |
| `results_wanted` | Integer | No | `20` | Maximum number of records to save when `fetchAllData` is disabled. |
| `max_pages` | Integer | No | `10` | Maximum number of source pages to process. Each page can contain up to 20,000 records. |
| `proxyConfiguration` | Object | No | `{ "useApifyProxy": false }` | Optional proxy settings for controlled network routing. |

If both a URL and separate filters are provided, the explicit `location`, `date_from`, and `date_to` values take priority over values read from the URL. If no URL is supplied, the Actor uses the default inflation indicator. If no year is supplied, the default quick run uses the 2024 observation.

### Output Data

The Actor saves one dataset item per available country-year observation. Empty source values are left out of individual records.

| Field | Type | Description |
|-------|------|-------------|
| `indicator_id` | String | Selected World Bank indicator code. |
| `indicator_name` | String | Selected indicator name. |
| `country_id` | String | World Bank country or economy identifier. |
| `country_name` | String | Country or economy name. |
| `country_iso3` | String | ISO3 country code. |
| `year` | Integer | Year of the observation. |
| `inflation_rate` | Number | Annual inflation value for the default indicator. |
| `obs_status` | String | Source observation status, when present. |
| `decimal_places` | Integer | Suggested display precision. |
| `source_database` | String | World Bank database name. |
| `source_note` | String | Indicator definition and methodology note. |
| `source_organization` | String | Original source organization. |
| `topics` | String | Indicator topic categories. |
| `source_url` | String | Source request URL for traceability. |

### Usage Examples

#### Basic Indicator Run

Collect a small set of 2024 inflation observations using the prefilled World Bank indicator URL:

```json
{
  "url": "https://data.worldbank.org/indicator/FP.CPI.TOTL.ZG?year=2024",
  "results_wanted": 20
}
```

#### Country Comparison Over a Year Range

Compare annual inflation for the United States, Canada, and Pakistan from 2020 through 2024:

```json
{
  "location": "USA,CAN,PAK",
  "date_from": 2020,
  "date_to": 2024,
  "results_wanted": 100
}
```

#### Complete Historical Dataset

Collect every available year for Pakistan. `fetchAllData` overrides the date range and record limit:

```json
{
  "location": "PAK",
  "fetchAllData": true,
  "max_pages": 5
}
```

### Sample Output

The following example shows one country-year item from the default inflation indicator:

```json
{
  "indicator_id": "FP.CPI.TOTL.ZG",
  "indicator_name": "Inflation, consumer prices (annual %)",
  "country_id": "US",
  "country_name": "United States",
  "country_iso3": "USA",
  "year": 2024,
  "inflation_rate": 2.949,
  "decimal_places": 1,
  "source_database": "World Development Indicators",
  "source_note": "Inflation as measured by the consumer price index reflects the annual percentage change in the cost to the average consumer of acquiring a basket of goods and services.",
  "source_organization": "International Financial Statistics database, International Monetary Fund (IMF)",
  "topics": "Economy & Growth, Financial Sector",
  "source_url": "https://api.worldbank.org/v2/country/USA/indicator/FP.CPI.TOTL.ZG?format=json&date=2024%3A2024&page=1&per_page=50"
}
```

### Tips for Best Results

- **Start with a small limit** - Use `results_wanted: 20` to confirm the country, year, and indicator settings before collecting a larger dataset.
- **Use ISO3 codes** - Uppercase codes such as `USA`, `GBR`, `IND`, and `PAK` make country comparisons predictable.
- **Use explicit years** - Set both `date_from` and `date_to` when you need a reproducible historical window.
- **Use `fetchAllData` carefully** - A global all-years run can return a large dataset. Begin with one country when checking the output.
- **Check source availability** - Some country-year combinations do not have an observation. Missing source values are not included in the dataset item.
- **Keep source fields** - Retain `source_note`, `source_organization`, and `source_url` when publishing analysis or building an audit trail.
- **Schedule refreshes** - For monitoring, schedule recurring runs and compare new country-year records with your previous dataset.

### Integrations and Export Formats

- **Google Sheets** - Share country comparisons and inflation snapshots with analysts and business teams.
- **Airtable** - Maintain a searchable economic indicators table.
- **Looker Studio or Power BI** - Build dashboards for country trends, pricing analysis, and risk monitoring.
- **Webhooks** - Send completed run notifications and dataset links to downstream systems.
- **Make or Zapier** - Trigger alerts, updates, or no-code workflows after a run.
- **Apify API** - Retrieve dataset records programmatically for applications and data pipelines.

Apify datasets can be exported as JSON, CSV, Excel, XML, and other supported formats.

### Frequently Asked Questions

#### Can I run the Actor without a URL?

Yes. The `url` field is optional. Without it, the Actor uses the default annual inflation indicator and can return global or country-filtered results.

#### Can I collect an indicator other than inflation?

Yes. Provide a supported World Bank indicator URL containing the indicator you want to collect. The output keeps the selected indicator code and name in each record.

#### What does `location` accept?

Use `all` for all available economies or provide comma-separated ISO3 codes such as `USA,GBR,DEU`. The explicit `location` input takes priority over a country value in the URL.

#### How do I retrieve the complete history?

Set `fetchAllData` to `true`. This ignores `date_from`, `date_to`, and `results_wanted`, while `max_pages` remains the page-processing limit.

#### Why is a field missing from a record?

A field is omitted when the World Bank source does not provide a value for that observation. Review several records before treating a missing field as a run problem.

#### Can I schedule recurring inflation monitoring?

Yes. Create an Apify schedule for daily, weekly, monthly, or another interval, then export the dataset or connect a webhook to your monitoring workflow.

#### Is this data real-time?

No. The Actor returns the latest observations made available by the World Bank when the run is executed. The source publication and revision schedule determines how current each indicator is.

#### Is it legal to collect this data?

The Actor is intended for public economic data collection. You are responsible for following the World Bank's applicable terms, attribution requirements, and any laws governing your use or redistribution of the data.

### Related Actors

- [RSS / XML Scraper](https://apify.com/shahidirfan/rss-xml-scraper) - Build recurring structured-data pipelines from public feeds and XML sources.
- [Apify Store Scraper](https://apify.com/shahidirfan/apify-store-scraper) - Collect marketplace metadata for research, monitoring, and competitive analysis workflows.
- [Polymarket Scraper](https://apify.com/shahidirfan/polymarket-scraper) - Gather market trend and prediction data for broader market intelligence projects.

### Support

For issues, feature requests, or a source-data question, use the Issues or discussion area on the Actor page. Include the input JSON, the affected country or year range, and a short example of the result that needs review.

### Legal Notice

This Actor is designed for legitimate collection and analysis of publicly available World Bank data. Users are responsible for complying with applicable laws, source terms, attribution requirements, and responsible data-use practices.

# Actor input Schema

## `url` (type: `string`):

Optional World Bank indicator URL. Supports data.worldbank.org and api.worldbank.org URL patterns. Year and country are extracted automatically.

## `location` (type: `string`):

Country filter as ISO code(s). Use 'all' for global results. Multiple countries comma-separated: USA,CAN,PAK.

## `date_from` (type: `integer`):

Start year for historical data range (e.g. 1990). Leave empty to use the URL year or default to the current year.

## `date_to` (type: `integer`):

End year for historical data range (e.g. 2024). Leave empty to use current year.

## `fetchAllData` (type: `boolean`):

When enabled, fetches data for all available years (complete history since 1960). Overrides date range settings. Results can be very large.

## `results_wanted` (type: `integer`):

Maximum number of records to return. Ignored when Fetch All Years is enabled.

## `max_pages` (type: `integer`):

Maximum number of API pages to fetch. Each page can hold up to 20,000 records.

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

Optional proxy settings. Leave empty for direct API access.

## Actor input object example

```json
{
  "url": "https://data.worldbank.org/indicator/FP.CPI.TOTL.ZG?year=2024",
  "location": "all",
  "date_from": 1990,
  "date_to": 2024,
  "fetchAllData": false,
  "results_wanted": 20,
  "max_pages": 10,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `overview` (type: `string`):

No description

# 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 = {
    "url": "https://data.worldbank.org/indicator/FP.CPI.TOTL.ZG?year=2024",
    "location": "all",
    "date_from": 1990,
    "date_to": 2024,
    "results_wanted": 20,
    "max_pages": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("shahidirfan/inflation-tracker-api").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 = {
    "url": "https://data.worldbank.org/indicator/FP.CPI.TOTL.ZG?year=2024",
    "location": "all",
    "date_from": 1990,
    "date_to": 2024,
    "results_wanted": 20,
    "max_pages": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("shahidirfan/inflation-tracker-api").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 '{
  "url": "https://data.worldbank.org/indicator/FP.CPI.TOTL.ZG?year=2024",
  "location": "all",
  "date_from": 1990,
  "date_to": 2024,
  "results_wanted": 20,
  "max_pages": 10
}' |
apify call shahidirfan/inflation-tracker-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,shahidirfan/inflation-tracker-api"
        }
    }
}

```

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/cbT8OXUsY1k4mtoyG/builds/Rtlb2SqIrTPLyPnkp/openapi.json
