# 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:** 2 total users, 1 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## 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/platform/actors/running/actors-in-store#pay-per-usage

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

## Inflation Tracker API

Track inflation and consumer price index data from World Bank indicators across countries and years. Collect country-level inflation values for a single year, a historical date range, or the complete dataset since 1960. Built for analysts, researchers, dashboards, and economic monitoring workflows.

---

### Features

- **Flexible input modes** - Use a World Bank URL, keyword, or indicator code with optional country and date filters.
- **Historical data mode** - Fetch data for any year range from 1960 to the present day.
- **Complete dataset mode** - Enable `fetchAllData` to retrieve the entire World Bank history in a single fast API call.
- **Global or country-level tracking** - Collect records for all countries or selected ISO codes.
- **Concurrent page fetching** - Multiple API pages are fetched in parallel for maximum speed.
- **Indicator metadata** - Each record includes source database, methodological notes, source organization, and topic categories.
- **Clean dataset output** - Records are stored without null or empty fields.
- **Ready for automation** - Works with schedules, webhooks, and downstream BI pipelines.

---

### Use Cases

#### Economic Monitoring
Track inflation changes across countries and monitor macroeconomic pressure in near real-time.

#### Historical Analysis
Retrieve decades of inflation data to identify long-term trends, turning points, and economic cycles.

#### Market Expansion Research
Compare inflation trends across candidate regions before launching products or adjusting pricing strategy.

#### Investment and Risk Analysis
Use country-level inflation values as an input signal for portfolio allocation, country scoring, and risk models.

#### Academic and Policy Research
Build reproducible inflation datasets for policy briefs, classroom projects, and econometrics studies.

---

### Input Parameters

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| `url` | String | No | `"https://data.worldbank.org/indicator/FP.CPI.TOTL.ZG?year=2024"` | Optional World Bank URL. Year and country are extracted automatically. |
| `location` | String | No | `"all"` | Country filter using ISO code(s), for example `USA` or `USA,CAN,PAK`. |
| `date_from` | Integer | No | — | Start year for historical data (e.g. `1990`). Leave empty to use URL year or default to current year. |
| `date_to` | Integer | No | — | End year for historical data (e.g. `2024`). Leave empty to use current year. |
| `fetchAllData` | Boolean | No | `false` | When enabled, fetches all available years (complete history since 1960). Overrides date range. |
| `results_wanted` | Integer | No | `20` | Maximum number of records to return. Ignored when `fetchAllData` is enabled. |
| `max_pages` | Integer | No | `10` | Maximum number of API pages to fetch. Each page holds up to 20,000 records. |
| `proxyConfiguration` | Object | No | `{ "useApifyProxy": false }` | Optional proxy settings for controlled network routing. |

---

### Output Data

Each item in the dataset can contain:

| Field | Type | Description |
|-------|------|-------------|
| `indicator_id` | String | World Bank indicator code. |
| `indicator_name` | String | Human-readable indicator name. |
| `country_id` | String | Country identifier from source. |
| `country_name` | String | Country or economy name. |
| `country_iso3` | String | ISO3 country code. |
| `year` | Number | Observation year. |
| `inflation_rate` | Number | Annual inflation rate percentage. |
| `obs_status` | String | Observation status flag. |
| `decimal_places` | Number | Suggested decimal precision. |
| `source_database` | String | World Bank database name for the indicator. |
| `source_note` | String | Methodological description of how the indicator is measured. |
| `source_organization` | String | Organization that originally provided the data. |
| `topics` | String | Comma-separated topic categories. |
| `source_url` | String | API endpoint URL used to retrieve this record. |

---

### Usage Examples

#### Basic Run With URL

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

#### Keyword and Global Scope

```json
{
	"location": "all",
	"results_wanted": 50,
	"max_pages": 5
}
```

#### Multi-Country Run

```json
{
	"location": "USA,CAN,PAK",
	"results_wanted": 30,
	"max_pages": 3
}
```

#### Historical Date Range

```json
{
	"location": "USA,GBR",
	"date_from": 1990,
	"date_to": 2000,
	"results_wanted": 100
}
```

#### Complete History for One Country

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

#### All Countries, All Years

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

***

### Sample Output

```json
{
	"indicator_id": "FP.CPI.TOTL.ZG",
	"indicator_name": "Inflation, consumer prices (annual %)",
	"country_id": "GB",
	"country_name": "United Kingdom",
	"country_iso3": "GBR",
	"year": 2000,
	"inflation_rate": 1.18295624210408,
	"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%3BGBR/indicator/FP.CPI.TOTL.ZG?format=json&date=1990%3A2000&page=1&per_page=50"
}
```

***

### Tips for Best Results

#### Start Small First

- Begin with `results_wanted: 20` to validate your configuration quickly.
- Increase limits only after confirming the expected output structure.

#### Use ISO Codes for Precise Filters

- Use uppercase country codes such as `USA` or `PAK` for targeted results.
- For multiple countries, use comma-separated values.

#### Historical Data

- Use `date_from` and `date_to` for a specific year window.
- Set `fetchAllData: true` to get the full history for any country or globally.
- The World Bank database goes back to 1960 for most indicators.

#### Keep Pagination Intentional

- Each API page holds up to 20,000 records, so most requests complete in a single page.
- Set `max_pages` according to your expected dataset size.

***

### Proxy Configuration

```json
{
	"proxyConfiguration": {
		"useApifyProxy": true,
		"apifyProxyGroups": ["RESIDENTIAL"]
	}
}
```

***

### Integrations

- **Google Sheets** - Share inflation snapshots with teams.
- **Airtable** - Build searchable economic intelligence tables.
- **Looker Studio** - Visualize country-level inflation trends.
- **Power BI** - Merge inflation data with internal business metrics.
- **Webhooks** - Push fresh records into your own systems.
- **Make / Zapier** - Trigger alerts and no-code automations.

Export formats supported by Apify include JSON, CSV, Excel, and XML.

***

### Frequently Asked Questions

#### Can I run this actor without a URL?

Yes. You can use `keyword` and `location` only.

#### What location format should I use?

Use `all` for global data or ISO codes like `USA` and `CAN`.

#### Why are some rows missing fields?

The actor excludes null and empty values from output, so only meaningful fields are stored.

#### How can I get more records?

Increase `results_wanted` and optionally increase `max_pages`.

#### Is this suitable for scheduled monitoring?

Yes. It is designed to run repeatedly and feed automated dashboards.

***

### Support

For issues or feature requests, open a discussion in your Apify Console actor page.

***

### Legal Notice

This actor is intended for legitimate data collection and analysis. Users are responsible for compliance with applicable laws, policies, and data usage terms.

# 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("💾 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 '{
  "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": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=shahidirfan/inflation-tracker-api",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Inflation Tracker API 📊",
        "description": "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.",
        "version": "0.0",
        "x-build-id": "0QjpgSTMf7iT1B9Oc"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/shahidirfan~inflation-tracker-api/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-shahidirfan-inflation-tracker-api",
                "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/shahidirfan~inflation-tracker-api/runs": {
            "post": {
                "operationId": "runs-sync-shahidirfan-inflation-tracker-api",
                "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/shahidirfan~inflation-tracker-api/run-sync": {
            "post": {
                "operationId": "run-sync-shahidirfan-inflation-tracker-api",
                "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",
                "properties": {
                    "url": {
                        "title": "URL",
                        "type": "string",
                        "description": "Optional World Bank indicator URL. Supports data.worldbank.org and api.worldbank.org URL patterns. Year and country are extracted automatically."
                    },
                    "location": {
                        "title": "Location",
                        "type": "string",
                        "description": "Country filter as ISO code(s). Use 'all' for global results. Multiple countries comma-separated: USA,CAN,PAK."
                    },
                    "date_from": {
                        "title": "Start Year",
                        "minimum": 1960,
                        "type": "integer",
                        "description": "Start year for historical data range (e.g. 1990). Leave empty to use the URL year or default to the current year."
                    },
                    "date_to": {
                        "title": "End Year",
                        "minimum": 1960,
                        "type": "integer",
                        "description": "End year for historical data range (e.g. 2024). Leave empty to use current year."
                    },
                    "fetchAllData": {
                        "title": "Fetch All Years",
                        "type": "boolean",
                        "description": "When enabled, fetches data for all available years (complete history since 1960). Overrides date range settings. Results can be very large.",
                        "default": false
                    },
                    "results_wanted": {
                        "title": "Results wanted",
                        "minimum": 1,
                        "type": "integer",
                        "description": "Maximum number of records to return. Ignored when Fetch All Years is enabled.",
                        "default": 20
                    },
                    "max_pages": {
                        "title": "Max pages",
                        "minimum": 1,
                        "type": "integer",
                        "description": "Maximum number of API pages to fetch. Each page can hold up to 20,000 records.",
                        "default": 10
                    },
                    "proxyConfiguration": {
                        "title": "Proxy configuration",
                        "type": "object",
                        "description": "Optional proxy settings. Leave empty for direct API access.",
                        "default": {
                            "useApifyProxy": false
                        }
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
