API reference
Parameters, response fields and errors.
Read the docs →Government debt and budget balance as a percent of GDP for 192 countries, from the IMF World Economic Outlook, with forecasts marked.
curl --request GET \
--url "https://api.narwhalapi.com/v1/economics/IDN/government/debt" \
--header "Authorization: Bearer $NARWHAL_API_KEY"{
"country": "IDN",
"indicator": "government_debt_gdp",
"unit": "percent of GDP",
"year": 2025,
"value": "40.879735",
"kind": "actual",
"source": "IMF World Economic Outlook",
"edition": "2026-10"
}/v1/economics/{country}/government/debtThe newest actual year of general government gross debt, as a percent of GDP.
countryrequiredThree letter country code, such as IDN.
/v1/economics/{country}/government/debt/observationsEvery year held, oldest first, each marked actual or forecast.
countryrequiredThree letter country code, such as IDN.
startoptionalFirst day or year of the range.
endoptionalLast day or year of the range.
/v1/economics/{country}/government/balanceThe newest actual year of net lending (positive) or net borrowing (negative), as a percent of GDP.
countryrequiredThree letter country code, such as IDN.
/v1/economics/{country}/government/balance/observationsEvery year held, oldest first, each marked actual or forecast.
countryrequiredThree letter country code, such as IDN.
startoptionalFirst day or year of the range.
endoptionalLast day or year of the range.
192 countries. The last actual year differs between countries, and later years are IMF forecasts.
Only the newest edition of the World Economic Outlook is served. For earlier rounds of a forecast, use the forecasts API.
IMF World Economic Outlook, republished unchanged and checked weekly. Every answer names the source and its edition.
Parameters, response fields and errors.
Read the docs →Official indicators for prices, labour, output, trade, and rates.
Explore the API →General government gross debt as a percent of the country's economic output in the year.
Yes. Each year is marked actual or forecast. Years are actual up to the last year the IMF calls actual for that country.
The government borrowed that share of GDP in the year. A positive figure is a surplus.
Each answer is one Economics call from your prepaid credit. Every account gets $10 free every month, with no card.
Free $10 credits every month, no card.Free $10 credits a month, no card.