Holiday Sale! Get over 30% off when you subscribe to an annual plan!

GDP API

The GDP API provides current and historical GDP (Gross Domestic Product) data for countries around the world.

(4.6)

From 6,519 users

API Status

Online - All Systems Operational

API Response Times

Average
P50
P75
P90
P95
301ms324ms397ms717ms1150ms

Didn't find what you were looking for? Suggest an improvement


/v1/gdp GET

https://api.api-ninjas.com/v1/gdp

Get GDP data from given parameters. Returns GDP statistics that satisfy the parameters.

Parameters

At least one of the following parameters must be set: country, year

  • country  optional

    Country name (case-insensitive) or 2-letter ISO-3166 alpha-2 code of the country. E.g. Canada or CA.

  • year  optional

    Year for which to retrieve GDP data.

Headers

  • X-Api-Key  required

    API Key associated with your account.

Sample Request Live Demo!

country
year

Try this API endpoint with all available parameters in our API playground

https://api.api-ninjas.com/v1/gdp?country=Canada

Headers

X-Api-KeyLog in or sign up to get your API Key

Sample Response

JSON
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 [ { "country": "CAN", "year": 1980, "gdp_growth": 2.2, "gdp_nominal": 276.064, "gdp_per_capita_nominal": 11281.422, "gdp_ppp": 290.29, "gdp_per_capita_ppp": 11862.755, "gdp_ppp_share": 2.192 }, { "country": "CAN", "year": 1981, "gdp_growth": 3.5, "gdp_nominal": 307.246, "gdp_per_capita_nominal": 12396.666, "gdp_ppp": 328.886, "gdp_per_capita_ppp": 13269.808, "gdp_ppp_share": 2.224 }, ... ]

Code Examples

1 2 curl -X GET "https://api.api-ninjas.com/v1/gdp?country=United%20States" \ -H "X-Api-Key: YOUR_API_KEY"

If your programming language is not listed in the Code Example above, you can still make API calls by using a HTTP request library written in your programming language and following the above documentation.