Get GDP for Any Country in One API Request
A working example against the real /v1/latest endpoint — one request, any of 50 countries, with source attribution in the response.
The fastest way to understand an API is a request that actually works. Here's GDP for Germany, end to end, against the real production endpoint — no placeholder values.
The request
GET https://api.economicsapi.com/v1/latest?country=germany&indicator=gdp
Authorization: Bearer sk_live_xxxxxxxxxxxxxxxxxxxx
country accepts an ISO3 code (DEU), the slug (germany), or a group token like g20 or eu27 — see the full country list for every slug we support. indicator accepts the KPI ID or the slug; gdp is one of the 20 indicators covered for every country that carries it.
The response
{
"data": [
{
"series_id": "DEU.NA.GDP.CUR.USD",
"country_id": "DEU",
"country": "Germany",
"kpi_id": "NA.GDP.CUR.USD",
"indicator": "GDP, current prices, USD",
"slug": "gdp",
"group": "gdp",
"latest_value": 5050922925047.05,
"latest_value_date": "2025-12-31",
"previous_value": 4685592577804.69,
"previous_value_date": "2024-12-31",
"highest_value": 5050922925047.05,
"highest_value_date": "2025-12-31",
"lowest_value": 84619845881.26,
"lowest_value_date": "1960-12-31",
"unit": "USD bn",
"frequency": "annual",
"source_name": "World Bank",
"source_url": "https://data.worldbank.org"
}
]
}
That's the same figure shown on the Germany hub and the Germany GDP page — this is a live production endpoint, not a demo dataset with different numbers than the site.
Multiple countries in one call
Comma-list the country parameter to avoid one request per country:
GET https://api.economicsapi.com/v1/latest?country=germany,france,japan&indicator=gdp
Authorization: Bearer sk_live_xxxxxxxxxxxxxxxxxxxx
Or use a group token to get an entire cohort — g20 for the G20, eu27 for every EU member state — in a single request rather than looping through 20+ separate calls.
Reading the response fields
latest_value and latest_value_date are the current reading. previous_value, highest_value, and lowest_value give you trend context — up, down, near a historical extreme — without a second request. source_name and source_url are the attribution: here, World Bank World Development Indicators, the same source cited on every GDP-related page on this site. The full field reference, including the other 19 indicators (inflation, unemployment, policy rates, and more), is in the indicator catalog.
Beyond GDP: history and other indicators
Swap indicator=gdp for any other slug — inflation-rate, unemployment-rate, government-debt-to-gdp — against the same /v1/latest shape, or point the same country and indicator parameters at /v1/history for the full time series instead of just the latest reading. If you're wiring this up for an AI agent rather than a script, the same data is available as an MCP tool — see giving your agent live economics data for that version of this walkthrough. Every field returned here traces back to a documented source — see how we source and verify the data for the full picture.
FAQ
Common questions
Related articles
Where to Get Free Economic Data in 2026
A practical, honest guide to FRED, the World Bank, the IMF, and where EconomicsAPI fits alongside them — not a sales pitch dressed as a list.
Ten Years of German Trade Data: What Changed
German exports grew from $1.29 trillion in 2015 to $1.75 trillion in 2025 — here's what the decade of bilateral trade data actually shows.
Giving Your AI Agent Live Economics Data via MCP
How to connect an AI agent to real GDP, inflation, and trade data over MCP instead of scraping pages or hand-rolling API calls.
TradingEconomics API vs EconomicsAPI, Compared
An honest comparison of coverage, update cadence, pricing transparency, and agent support — including where TradingEconomics is still the better fit.
How We Source and Verify Economic Data
Every figure traces to IMF, BIS, World Bank WDI, or FRED — checked daily and published only when a value actually changes.