# GDP Data API

> Get GDP (Gross Domestic Product) data for any country including current values and historical data going back to 1960. With changes=true it also returns the direction against the previous year, and on paid plans the prior year's GDP, the dollar and percent change, whether real growth is accelerating or slowing, and 5- and 10-year compound annual growth.

**Endpoint:** `GET https://api.apiverve.com/v1/gdp`  
**Category:** Finance  
**Cost:** 2 credits per call  
**Canonical page:** https://apiverve.com/marketplace/gdp

## Overview

GDP API provides comprehensive economic data from the World Bank including GDP in current USD, GDP growth rate, and GDP per capita. Query the latest data or retrieve data for a specific year for economic analysis and research. With changes=true every reading is set against the country's own stored history: whether GDP rose or fell for every plan, and on paid plans the previous year, its GDP and real growth rate, the change in dollars and percent, the per-capita change, a growth trend (accelerating, slowing or steady), the 5-year average real growth rate, and the 5- and 10-year compound annual growth rates of nominal GDP.

## Authentication

Every call carries your key in an `x-api-key` header. The same key works across the whole
APIVerve catalog — there are no per-API subscriptions. Responses always use the same three
top-level keys: `status`, `error`, and `data`.

## Example request

```bash
curl "https://api.apiverve.com/v1/gdp?country=US&year=2023&changes=true" \
  -H "x-api-key: YOUR_API_KEY"
```

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `country` | string | Yes | ISO 2 or 3-letter country code (e.g., US, USA, GB, GBR). UK and EL are accepted for GB and GR. length 2-3 |
| `year` | integer | No | Specific year to retrieve data for (1960-present). Returns latest if not specified.. range 1960-2030. Premium field |
| `changes` | boolean | No | Include the change against the previous year, the growth trend, the 5-year average growth rate and the 5- and 10-year compound annual growth rates. default false |

## Response fields

- `country` — string · ISO country code of the queried country
- `countryName` — string · Full name of the country in English
- `currency` — string · Official currency code for the country
- `year` — number · Year for which GDP data is provided
- `gdp` — number · Gross Domestic Product in current USD
- `gdpFormatted` — string · Formatted GDP value (e.g., $27.36 trillion)
- `gdpGrowth` — number · Annual GDP growth rate as percentage
- `gdpPerCapita` — number · GDP per capita in current USD
- `count` — number · Number of year records returned · (premium)
  - `years.0.year` — number · Year of the GDP data record · (premium)
  - `years.0.gdp` — number · Gross Domestic Product in current USD · (premium)
  - `years.0.gdpFormatted` — string · Formatted GDP value (e.g., $27.36 trillion) · (premium)
  - `years.0.gdpGrowth` — number · Annual GDP growth rate as percentage · (premium)
  - `years.0.gdpPerCapita` — number · GDP per capita in current USD · (premium)
- `previousYear` — number · Year of the previous GDP record, the year before the reading (with changes=true) · (premium)
- `changeDirection` — string · Whether GDP rose, fell or held against the previous year: up, down or unchanged (with changes=true)
- `previousGdp` — number · GDP in current USD for the previous year (with changes=true) · (premium)
- `gdpChange` — number · Change in GDP from the previous year, in current USD (with changes=true) · (premium)
- `gdpChangePercent` — number · Percent change in nominal GDP (current USD) from the previous year; gdpGrowth is the real, inflation-adjusted rate (with changes=true) · (premium)
- `previousGdpGrowth` — number · Real GDP growth rate for the previous year, as a percentage (with changes=true) · (premium)
- `growthTrend` — string · Whether real growth is accelerating, slowing or steady against the previous year's rate (with changes=true) · (premium)
- `gdpPerCapitaChangePercent` — number · Percent change in GDP per capita (current USD) from the previous year (with changes=true) · (premium)
- `gdpCagr5y` — number · Compound annual growth rate of nominal GDP over the 5 years ending at the reading, as a percentage (with changes=true) · (premium)
- `gdpCagr10y` — number · Compound annual growth rate of nominal GDP over the 10 years ending at the reading, as a percentage (with changes=true) · (premium)
- `averageGrowth5y` — number · Average real GDP growth rate over the 5 years ending at the reading, as a percentage; null unless all 5 years are reported (with changes=true) · (premium)

## Sample response

```json
{
  "status": "ok",
  "error": null,
  "data": {
    "country": "US",
    "countryName": "United States",
    "currency": "USD",
    "year": 2025,
    "gdp": 30769700000000,
    "gdpFormatted": "$30.77 trillion",
    "gdpGrowth": 2.16,
    "gdpPerCapita": 90027,
    "count": 1,
    "years": [
      {
        "year": 2025,
        "gdp": 30769700000000,
        "gdpFormatted": "$30.77 trillion",
        "gdpGrowth": 2.16,
        "gdpPerCapita": 90027
      }
    ],
    "previousYear": 2024,
    "changeDirection": "up",
    "previousGdp": 29298013000000,
    "gdpChange": 1471687000000,
    "gdpChangePercent": 5.02,
    "previousGdpGrowth": 2.79,
    "growthTrend": "slowing",
    "gdpPerCapitaChangePercent": 4.48,
    "gdpCagr5y": 7.56,
    "gdpCagr10y": 5.34,
    "averageGrowth5y": 3.31
  },
  "code": 200
}
```

## Use cases

- **Sovereign Risk Assessment** — To assess national debt sustainability, credit rating agencies compare a government's outstanding obligations against total economic output and per capita income.
- **Cross-Border Expansion Benchmarking** — When evaluating consumer purchasing power in emerging markets, retail strategists benchmark local gross domestic product per capita against established regional markets.
- **Macroeconomic Dashboard Widgets** — Feed annual growth rates and formatted dollar outputs directly into financial intelligence portals to track national output shifts across continents.
- **Academic Research Modeling** — Economists track multi-decade development trajectories by pulling historical national production numbers and yearly growth percentages for statistical regression models.

## SDKs

- **npm** — `npm install @apiverve/gdp` (https://www.npmjs.com/package/@apiverve/gdp)
- **NuGet** — `dotnet add package APIVerve.API.GDPData` (https://www.nuget.org/packages/APIVerve.API.GDPData)
- **Source** — https://github.com/apiverve/gdp-api

## More

- Full reference: https://docs.apiverve.com/ref/gdp
- Get an API key: https://dashboard.apiverve.com
- Full catalog: https://apiverve.com/marketplace
