Eurostat Statistics API — EU Inflation (HICP) & Trade Data avatar

Eurostat Statistics API — EU Inflation (HICP) & Trade Data

Pricing

from $0.01 / 1,000 results

Go to Apify Store
Eurostat Statistics API — EU Inflation (HICP) & Trade Data

Eurostat Statistics API — EU Inflation (HICP) & Trade Data

Get EU inflation (HICP/CPI, with computed YoY and 12-month moving average) and EU import/export trade statistics from Eurostat's public API as clean JSON. No key needed.

Pricing

from $0.01 / 1,000 results

Rating

0.0

(0)

Developer

Daniel Posztos

Daniel Posztos

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

16 days ago

Last modified

Share

Eurostat Statistics API — EU inflation (HICP) & trade data as JSON

SEO title: Eurostat Statistics API — EU inflation (HICP) & trade data as JSON SEO description: Get EU inflation (HICP/CPI) with computed year-over-year change and 12-month moving average, or EU import/export trade statistics, straight from Eurostat's public dissemination API as clean JSON. No API key needed — built for research, market analysis, and AI agents.

One actor, two Eurostat datasets, both wrapped in a clean, agent-friendly JSON schema instead of Eurostat's own JSON-stat 2.0 dimension-index format and cell-limited query API:

  1. hicp — Harmonised Index of Consumer Prices (inflation), with yoy_pct (year-over-year % change) and ma12_pct (12-month moving average of that) computed automatically. Eurostat's own API does not provide either field — this is the actor's whole value-add.
  2. comext — EU international trade in goods (import/export value and quantity, by product/reporter/partner country/period), from the dedicated Comext dissemination endpoint.

No scraping, no anti-bot risk, no login — both datasets are queried from Eurostat's public, unauthenticated dissemination API over HTTPS.

Use with AI agents (MCP / LangChain)

Built to be called as a tool by an AI agent, not just from the Console. The tool definition (name, description, arguments) is generated automatically from this actor's title and input schema, so an LLM can pick it and fill the arguments correctly.

MCP (Claude Desktop / Cursor / VS Code) — add to your MCP client config:

{
"mcpServers": {
"apify": {
"url": "https://mcp.apify.com",
"headers": { "Authorization": "Bearer <APIFY_TOKEN>" },
"actors": ["westerly_breaker/eurostat-statistics"]
}
}
}

LangChain:

from langchain_apify import ApifyActorsTool
eurostat = ApifyActorsTool("westerly_breaker/eurostat-statistics") # APIFY_TOKEN from env
result = eurostat.invoke({"dataset": "hicp", "countries": ["HU", "DE"],
"coicop_codes": ["CP00"], "period_from": "2025-01", "period_to": "2025-12"})

Why agents like it: no API key needed, clean flat JSON rows straight from Eurostat's public API, with year-over-year change and 12-month moving average already computed — an agent can reason over the numbers without post-processing. Narrow countries/coicop_codes/period to keep responses small.

Standby (low-latency HTTP API, no cold start) — Standby mode is enabled for this actor, so you can skip the batch run/dataset round-trip entirely and call it as a plain HTTP API. Authenticate with your own Apify token (Authorization: Bearer <APIFY_TOKEN>, or ?token=<APIFY_TOKEN>):

curl -H "Authorization: Bearer <APIFY_TOKEN>" \
"https://westerly-breaker--eurostat-statistics.apify.actor/search?dataset=hicp&countries=HU,DE&coicop_codes=CP00&period_from=2025-01&period_to=2025-06"

or POST the same fields as a JSON body (identical shape to the Console/API input):

curl -X POST "https://westerly-breaker--eurostat-statistics.apify.actor/search" \
-H "Authorization: Bearer <APIFY_TOKEN>" \
-H "Content-Type: application/json" \
-d '{"dataset": "comext", "hs_codes": ["870323"], "reporter_countries": ["HU"], "partner_countries": ["DE"], "period_from": "2024-07", "period_to": "2024-09"}'

Both return {"dataset": ..., "count": ..., "items": [...]} directly in the HTTP response — no dataset, no Actor.push_data. GET / is a free health check ({"status": "ready", ...}, never charged). Array query parameters (countries/coicop_codes/hs_codes/reporter_countries/partner_countries) accept either a comma-separated value (countries=HU,DE) or repeated params; invalid input returns HTTP 400 with a speaking error message rather than failing a run. Billing mirrors the batch flow's two events exactly: one dataset-query charge per request (at most once, right after the first upstream chunk fetch succeeds — even on a request that ends up returning 0 rows, since it's a per-query setup fee), plus one data-row charge per returned row — a budget-limited caller gets back fewer, fully-paid rows rather than a response it wasn't billed for the tail of.

Recipes

Copy-paste starting points — each returns finished JSON (with yoy_pct / ma12_pct already computed) in one call.

Chart year-over-year inflation for a set of countries. Headline HICP (CP00), yoy already computed — ready to plot in a data-journalism piece or dashboard:

curl -H "Authorization: Bearer <APIFY_TOKEN>" \
"https://westerly-breaker--eurostat-statistics.apify.actor/search?dataset=hicp&countries=HU,DE,FR,IT&coicop_codes=CP00&period_from=2024-01&period_to=2025-06"

Compare core vs headline inflation. Ask for both COICOP categories in one call and diff yoy_pct (core = ex. energy & food) against headline:

curl -H "Authorization: Bearer <APIFY_TOKEN>" \
"https://westerly-breaker--eurostat-statistics.apify.actor/search?dataset=hicp&countries=HU&coicop_codes=CP00,TOT_X_NRG_FOOD&period_from=2024-01&period_to=2025-06"

Look up bilateral trade (Comext). Monthly import value of a product (HS code) between two countries — note Comext uses GB/GR, the opposite of the HICP field's UK/EL:

curl -X POST "https://westerly-breaker--eurostat-statistics.apify.actor/search" \
-H "Authorization: Bearer <APIFY_TOKEN>" -H "Content-Type: application/json" \
-d '{"dataset": "comext", "hs_codes": ["870323"], "reporter_countries": ["HU"], "partner_countries": ["DE"], "flow": "import", "period_from": "2024-01", "period_to": "2024-12"}'

Why this exists

Eurostat's own API is powerful but awkward to use directly:

  • Responses are JSON-stat 2.0: values keyed by a flat row-major index, categories as separate code→position maps — not directly usable without a decoder.
  • The Comext (trade) endpoint enforces a hard 5,000,000-row extraction limit per query and 413s with EXTRACTION_TOO_BIG if you ask for too much at once.
  • Computing inflation's year-over-year change or a moving average yourself means manually fetching extra months of history and aligning them — tedious and easy to get subtly wrong (e.g. off-by-one month, or silently treating a missing value as zero).

This actor does all of that once, correctly, so the output is analysis-ready JSON.

Input

FieldTypeDefaultUsed byDescription
datasetstring"hicp"both"hicp" (inflation) or "comext" (EU trade).
countriesarray of strings["HU", "DE"]hicpEurostat geo codes. Note: Eurostat uses "EL" for Greece and "UK" for the United Kingdom (not "GR"/"GB").
coicop_codesarray of strings["CP00"]hicpConsumption category. "CP00" = all-items (headline). Others: "CP01" (food), "NRG" (energy), "SERV" (services), "TOT_X_NRG_FOOD" (core, ex. energy & food).
hs_codesarray of strings["870323"]comextProduct codes: 2 (HS chapter), 4 (HS heading), 6 (HS subheading), or 8 (full CN8) digits.
reporter_countriesarray of strings["HU"]comextEU/EFTA declarant countries. Note: Comext uses "GB"/"GR" (not "UK"/"EL") — the opposite convention from the hicp field above; this is Eurostat's own inconsistency between the two APIs, not this actor's.
partner_countriesarray of strings["DE"]comextTrade partner countries (ISO-3166-1 alpha-2), or "WORLD" for all partners combined.
flowstring"import"comext"import" or "export".
period_from / period_tostring ("YYYY-MM")"2025-01" / "2025-12"bothInclusive period range, max 120 months (10 years) per run. For hicp, Eurostat data 23 months before period_from is fetched automatically in the background (see "How yoy_pct/ma12_pct are computed" below) — only rows inside [period_from, period_to] are ever returned.

Fields not relevant to the selected dataset are simply ignored (logged as informational, never an error) — you can leave them at their defaults.

Worked example — input (HICP)

{
"dataset": "hicp",
"countries": ["HU", "DE"],
"coicop_codes": ["CP00"],
"period_from": "2024-11",
"period_to": "2025-12"
}

Worked example — output (HICP, real data, 4 of 28 rows)

[
{ "dataset": "hicp", "country": "HU", "coicop": "CP00", "period": "2025-01", "index_value": 171.85, "yoy_pct": 5.6758, "ma12_pct": 3.8804 },
{ "dataset": "hicp", "country": "HU", "coicop": "CP00", "period": "2025-11", "index_value": 174.66, "yoy_pct": 3.7050, "ma12_pct": 4.5746 },
{ "dataset": "hicp", "country": "DE", "coicop": "CP00", "period": "2025-01", "index_value": 129.9, "yoy_pct": 2.7690, "ma12_pct": 2.4645 },
{ "dataset": "hicp", "country": "DE", "coicop": "CP00", "period": "2025-11", "index_value": 132.6, "yoy_pct": 2.5522, "ma12_pct": 2.3333 }
]

The most recent requested month (2025-12 in this example) came back with every field null — Eurostat hadn't published that month for either country yet at fetch time. This is expected, not a bug: see "Known limitations" below.

Worked example — input (Comext)

{
"dataset": "comext",
"hs_codes": ["870323", "870324"],
"reporter_countries": ["HU"],
"partner_countries": ["DE"],
"flow": "import",
"period_from": "2024-07",
"period_to": "2024-12"
}

Worked example — output (Comext, real data, 4 of 12 rows)

[
{ "dataset": "comext", "hs_code": "870323", "reporter": "HU", "partner": "DE", "period": "2024-07", "flow": "import", "value_eur": 2387357.0, "quantity_kg": 94358.0 },
{ "dataset": "comext", "hs_code": "870323", "reporter": "HU", "partner": "DE", "period": "2024-11", "flow": "import", "value_eur": 6831941.0, "quantity_kg": 349791.0 },
{ "dataset": "comext", "hs_code": "870323", "reporter": "HU", "partner": "DE", "period": "2024-12", "flow": "import", "value_eur": null, "quantity_kg": null },
{ "dataset": "comext", "hs_code": "870324", "reporter": "HU", "partner": "DE", "period": "2024-07", "flow": "import", "value_eur": 2719538.0, "quantity_kg": 50327.0 }
]

Again, 2024-12 (the newest requested month) is null for both HS codes — not yet published for this reporter/partner/product at fetch time, consistently represented as a null row rather than a missing one (see below).

Output schema

hicp rows

FieldTypeNotes
datasetstring"hicp"
countrystringEurostat geo code
coicopstringConsumption category code
periodstring"YYYY-MM"
index_valuefloat or nullRaw HICP index, base 2015=100, as published by Eurostat
yoy_pctfloat or nullComputed. (index_value / index_value 12 months earlier - 1) × 100
ma12_pctfloat or nullComputed. Average of yoy_pct over this period and the 11 preceding ones

comext rows

FieldTypeNotes
datasetstring"comext"
hs_codestringProduct code as given in hs_codes
reporterstringReporter (declarant) country
partnerstringPartner country, or "WORLD"
periodstring"YYYY-MM"
flowstring"import" or "export"
value_eurfloat or nullTrade value in euros
quantity_kgfloat or nullTrade quantity in kilograms (converted from Eurostat's native 100kg unit)

Both modules guarantee exactly one row per requested combination (country×coicop×period for hicp; reporter×partner×hs_code×period for comext) — a period Eurostat hasn't published data for yet comes back as a row with null fields, it never simply disappears from the output. This makes the row count fully predictable ahead of time (and therefore the cost, too — see Pricing).

How yoy_pct / ma12_pct are computed

  • yoy_pct for period t needs the index value at t and at t − 12 months.
  • ma12_pct for period t is the average of yoy_pct at t, t−1, ..., t−11 — which in turn each need an index value 12 months before THEM, i.e. as far back as t − 23 months.
  • So the actor automatically fetches 23 months of Eurostat data before your requested period_from in the background — you never have to think about this, and only rows inside [period_from, period_to] are ever returned.
  • If any needed index value is missing (unpublished, withdrawn, or simply older than the country's series start), the computed field is null — it is never fabricated, and a partial/incomplete 12-month window for ma12_pct is treated as fully missing (strict: all 12 trailing yoy_pct values must be present) rather than silently averaging fewer than 12.

Pricing (pay-per-event)

EventPriceWhen it's charged
data-row$0.002Once per output row
dataset-query$0.05Once per run, right after the first upstream Eurostat chunk fetch succeeds. Never charged if every upstream fetch in the run fails.

Plus Apify's own apify-actor-start synthetic event (first 5 seconds of compute free, platform-managed).

Examples:

  • HICP: 2 countries × 1 COICOP × 12 months = 24 rows → 24 × $0.002 + $0.05 = $0.098.
  • Comext: 1 reporter × 1 partner × 1 HS code × 6 months = 6 rows → 6 × $0.002 + $0.05 = $0.062.

If a run's cost would exceed the Max total charge USD you set for it, the actor stops producing further rows at exactly that point — every delivered row was paid for, and nothing paid-for is ever dropped. It never crashes and never produces unbilled/"free" rows past the limit.

Error messages

  • No input at all: explains the minimal valid input for each dataset.
  • Unknown dataset: "'dataset' must be one of ['comext', 'hicp'], got '...'."
  • Unknown countries code (hicp): lists all 45 valid Eurostat geo codes and calls out the "EL"/"UK" naming quirk.
  • Unknown reporter_countries / partner_countries code (comext): lists all valid codes and calls out that Comext uses "GB"/"GR" (opposite of the hicp module's "UK"/"EL").
  • Malformed coicop_codes: Eurostat's full COICOP nomenclature has 468 entries, too many to hardcode as a strict allowlist — this actor validates the code shape (letters/digits/underscore, starting with a letter) rather than membership. A well-formed but nonexistent COICOP code is not a validation error; it comes back as a row with index_value/yoy_pct/ma12_pct all null (see "Known limitations").
  • Malformed hs_codes: must be digits only, 2/4/6/8 characters.
  • Bad period_from/period_to format, period_from after period_to, or span over 120 months: all rejected with the exact rule and an example fix.
  • 0 rows with otherwise valid input: the run still succeeds, but the log carries an explicit WARNING: 0 results produced despite valid input (...) line and the run's status message says so — never a silent "nothing happened." In practice, because both modules guarantee one row per requested combination (see above), this only happens when every single upstream chunk fetch failed (e.g. Eurostat is unreachable) — Eurostat genuinely having no data for a period/country/product still produces null-valued rows, not zero rows.

Known limitations (documented, not hidden)

  • HICP index base year is fixed to unit=I15 (2015=100). Eurostat periodically rebases (I05, I96 were also observed live); if/when a newer base becomes the primary one, this actor will need an update — verified 2026-07-06 that I15 is still current.
  • COICOP codes are shape-validated, not membership-validated (see Error messages) — a typo'd-but-well-formed code silently yields all-null rows rather than a hard error. Common valid codes are listed in the input field description.
  • Comext's 5,000,000-row extraction cap is worked around by chunking every fetch to one (reporter country × calendar year) pair, which stays far under the cap for any realistic hs_codes/partner_countries combination. In the extraordinarily unlikely case a single chunk is still rejected as too big, that one chunk is skipped with a loud log warning (not a crash) — narrowing hs_codes/partner_countries or the period range is the fix.
  • Eurostat's two APIs disagree on a few country codes ("EL"/"UK" for HICP vs. "GB"/"GR" for Comext) — this is Eurostat's own inconsistency between the general Statistics API and the Comext API, called out explicitly in both the input schema and validation error messages so it's never a silent surprise.
  • A requested period newer than what Eurostat has actually published for a given series is emitted as a null row, not omitted — Eurostat's own JSON-stat response simply drops that month from its time dimension entirely rather than returning an explicit null cell for it; this actor re-inserts the expected row with null fields so the row count is always predictable from the input alone.

Data sources (public, no API key, no scraping)

  • Eurostat Statistics API (JSON-stat 2.0): https://ec.europa.eu/eurostat/api/dissemination/statistics/1.0/data/prc_hicp_midx
  • Eurostat Comext dissemination API (JSON-stat 2.0): https://ec.europa.eu/eurostat/api/comext/dissemination/statistics/1.0/data/DS-045409

Both are the same public, unauthenticated endpoints Eurostat's own web tools call — no login, no key, no ToS-risk scraping.