Browse all documentation

Remittances and investment API reference

Remittances received and foreign direct investment inflows by country and year

Overview

Money workers abroad send home, and foreign direct investment coming into a country, per year in US dollars, from the World Bank's World Development Indicators.

A country is its ISO 3166 alpha-3 code, such as IDN. Remittances are personal remittances received. Investment is foreign direct investment net inflows, which is negative when more left than arrived. Both are in current US dollars, as decimal strings.

The route without observations returns the newest year the World Bank gives. observations returns every year it gives, oldest first. Every answer carries the World Bank attribution, licence_url, the day the World Bank last updated the data and the time Narwhal read it.

Base URL: https://api.narwhalapi.com. Each route below is an MCP tool of its own, with the same parameters.

What every account gets

WhatEvery account
One country and measureOne Economics call

See pricing for what a call costs. A request is charged at the price of its API unless a route says otherwise.

  • A year the World Bank gives no value for is left out, never filled. The newest year differs between countries.
  • The World Bank revises earlier years. Narwhal serves the current figures, not earlier versions of them.
  • A series is read from the World Bank when it is not cached, within a daily limit of new reads per account.
  • When the World Bank cannot be reached, the last copy is served with stale true and is not charged.
  • A country with no figure is 404 not_covered. A range with no year is 404 not_found. Neither is charged.
  • The Any series API reads the same figures by the series_id each answer names. These figures are for analysis, not financial, investment, legal or tax advice.

Endpoints

Every route is a GET and needs your key in the Authorization: Bearer header. The examples show the shape of an answer, not live data.

Get Remittances

GET /v1/economics/{country}/remittances

MCP: tool economics_get_remittances.

Parameters

ParameterWhereRequiredTypeMeaning
countrypathYesstringISO 3166 alpha-3 country code, for example DEU.

Response fields

FieldTypeSentMeaning
yearintegerAlwaysThe year of the value.
valuestringAlwaysUS dollars at current prices, as the World Bank gives it. Investment can be negative.
countrystringAlwaysThe country asked for, ISO 3166 alpha-3.
indicatorone of remittances_received, foreign_direct_investment_net_inflowsAlwaysremittances_received or foreign_direct_investment_net_inflows.
series_idstringAlwaysThe same series in the catalogue routes.
unitalways "USD"AlwaysThe unit of every value.
sourcestringAlwaysThe attribution the World Bank's licence asks for.
licence_urlstringAlwaysThe licence the World Bank publishes the data under.
source_updatedstringAlwaysThe day the World Bank says it last updated the data.
fetched_atdate-timeAlwaysWhen Narwhal read the World Bank.
stalebooleanAlwaysTrue when the World Bank could not be reached and the last copy is served, which is not charged.
Request
curl -H "Authorization: Bearer $NARWHAL_API_KEY" \
  "https://api.narwhalapi.com/v1/economics/IDN/remittances"
Example response
{
  "country": "IDN",
  "indicator": "remittances_received",
  "series_id": "wdi:bx.trf.pwkr.cd.dt/idn",
  "unit": "USD",
  "source": "World Bank, World Development Indicators, CC BY 4.0. Values normalised by Narwhal.",
  "licence_url": "https://creativecommons.org/licenses/by/4.0/",
  "source_updated": "2026-11-11",
  "fetched_at": "2026-11-26T08:13:11Z",
  "stale": false,
  "year": 2025,
  "value": "17601348404.982"
}

Get Remittances History

GET /v1/economics/{country}/remittances/observations

MCP: tool economics_get_remittances_history.

Parameters

ParameterWhereRequiredTypeMeaning
countrypathYesstringISO 3166 alpha-3 country code, for example DEU.
startqueryNostringFirst year to return, as YYYY.
endqueryNostringLast year to return, as YYYY.

Response fields

FieldTypeSentMeaning
countrystringAlwaysThe country asked for, ISO 3166 alpha-3.
indicatorone of remittances_received, foreign_direct_investment_net_inflowsAlwaysremittances_received or foreign_direct_investment_net_inflows.
series_idstringAlwaysThe same series in the catalogue routes.
unitalways "USD"AlwaysThe unit of every value.
sourcestringAlwaysThe attribution the World Bank's licence asks for.
licence_urlstringAlwaysThe licence the World Bank publishes the data under.
source_updatedstringAlwaysThe day the World Bank says it last updated the data.
fetched_atdate-timeAlwaysWhen Narwhal read the World Bank.
stalebooleanAlwaysTrue when the World Bank could not be reached and the last copy is served, which is not charged.
observationslist of objectAlwaysOne row per year, oldest first.
observations[].yearintegerAlwaysThe year of the value.
observations[].valuestringAlwaysUS dollars at current prices, as the World Bank gives it. Investment can be negative.
Request
curl -H "Authorization: Bearer $NARWHAL_API_KEY" \
  "https://api.narwhalapi.com/v1/economics/IDN/remittances/observations?start=2024"
Example response
{
  "country": "IDN",
  "indicator": "remittances_received",
  "series_id": "wdi:bx.trf.pwkr.cd.dt/idn",
  "unit": "USD",
  "source": "World Bank, World Development Indicators, CC BY 4.0. Values normalised by Narwhal.",
  "licence_url": "https://creativecommons.org/licenses/by/4.0/",
  "source_updated": "2026-11-11",
  "fetched_at": "2026-11-26T08:13:11Z",
  "stale": false,
  "observations": [
    {
      "year": 2024,
      "value": "16038366972.4451"
    },
    {
      "year": 2025,
      "value": "17601348404.982"
    }
  ]
}

Get Foreign Direct Investment

GET /v1/economics/{country}/foreign-direct-investment

MCP: tool economics_get_foreign_direct_investment.

Parameters

ParameterWhereRequiredTypeMeaning
countrypathYesstringISO 3166 alpha-3 country code, for example DEU.

Response fields

FieldTypeSentMeaning
yearintegerAlwaysThe year of the value.
valuestringAlwaysUS dollars at current prices, as the World Bank gives it. Investment can be negative.
countrystringAlwaysThe country asked for, ISO 3166 alpha-3.
indicatorone of remittances_received, foreign_direct_investment_net_inflowsAlwaysremittances_received or foreign_direct_investment_net_inflows.
series_idstringAlwaysThe same series in the catalogue routes.
unitalways "USD"AlwaysThe unit of every value.
sourcestringAlwaysThe attribution the World Bank's licence asks for.
licence_urlstringAlwaysThe licence the World Bank publishes the data under.
source_updatedstringAlwaysThe day the World Bank says it last updated the data.
fetched_atdate-timeAlwaysWhen Narwhal read the World Bank.
stalebooleanAlwaysTrue when the World Bank could not be reached and the last copy is served, which is not charged.
Request
curl -H "Authorization: Bearer $NARWHAL_API_KEY" \
  "https://api.narwhalapi.com/v1/economics/IDN/foreign-direct-investment"
Example response
{
  "country": "IDN",
  "indicator": "foreign_direct_investment_net_inflows",
  "series_id": "wdi:bx.klt.dinv.cd.wd/idn",
  "unit": "USD",
  "source": "World Bank, World Development Indicators, CC BY 4.0. Values normalised by Narwhal.",
  "licence_url": "https://creativecommons.org/licenses/by/4.0/",
  "source_updated": "2026-11-11",
  "fetched_at": "2026-11-26T08:13:13Z",
  "stale": false,
  "year": 2025,
  "value": "22698158405.2659"
}

Get Foreign Direct Investment History

GET /v1/economics/{country}/foreign-direct-investment/observations

MCP: tool economics_get_foreign_direct_investment_history.

Parameters

ParameterWhereRequiredTypeMeaning
countrypathYesstringISO 3166 alpha-3 country code, for example DEU.
startqueryNostringFirst year to return, as YYYY.
endqueryNostringLast year to return, as YYYY.

Response fields

FieldTypeSentMeaning
countrystringAlwaysThe country asked for, ISO 3166 alpha-3.
indicatorone of remittances_received, foreign_direct_investment_net_inflowsAlwaysremittances_received or foreign_direct_investment_net_inflows.
series_idstringAlwaysThe same series in the catalogue routes.
unitalways "USD"AlwaysThe unit of every value.
sourcestringAlwaysThe attribution the World Bank's licence asks for.
licence_urlstringAlwaysThe licence the World Bank publishes the data under.
source_updatedstringAlwaysThe day the World Bank says it last updated the data.
fetched_atdate-timeAlwaysWhen Narwhal read the World Bank.
stalebooleanAlwaysTrue when the World Bank could not be reached and the last copy is served, which is not charged.
observationslist of objectAlwaysOne row per year, oldest first.
observations[].yearintegerAlwaysThe year of the value.
observations[].valuestringAlwaysUS dollars at current prices, as the World Bank gives it. Investment can be negative.
Request
curl -H "Authorization: Bearer $NARWHAL_API_KEY" \
  "https://api.narwhalapi.com/v1/economics/IDN/foreign-direct-investment/observations?start=2024"
Example response
{
  "country": "IDN",
  "indicator": "foreign_direct_investment_net_inflows",
  "series_id": "wdi:bx.klt.dinv.cd.wd/idn",
  "unit": "USD",
  "source": "World Bank, World Development Indicators, CC BY 4.0. Values normalised by Narwhal.",
  "licence_url": "https://creativecommons.org/licenses/by/4.0/",
  "source_updated": "2026-11-11",
  "fetched_at": "2026-11-26T08:13:13Z",
  "stale": false,
  "observations": [
    {
      "year": 2024,
      "value": "24275445280.2272"
    },
    {
      "year": 2025,
      "value": "22698158405.2659"
    }
  ]
}

Errors

Errors use the shared problem shape with a request_id. See Errors and credits for the shape and the credit headers. Failed requests are not charged.

CodeStatusMeaning
invalid_query400The country is not a three letter code, or start or end is not a year, or start is after end. Not charged.
not_found404No year in this range is held for this country. Not charged.
not_covered404The World Bank gives no figure for this country. Not charged.
insufficient_credits402Your credit balance is less than the request costs.
fetch_limit_reached429Your daily limit of new reads from the source is used up. Cached series still answer. Not charged.
upstream_busy503The World Bank could not be read now and no copy is held. Try again shortly. Not charged.
area_unavailable503Live source reads are not available right now. Not charged.
invalid_api_key401The Bearer key is missing, malformed, unknown, or inactive.
rate_limit_exceeded429The network or account per-minute limit was reached. Retry after the time in the Retry-After header.

Was this page helpful?