Skip to content
FDIstats

Developers

API & downloads

Free JSON and CSV endpoints for every indicator on the site — 217+ economies plus World Bank regional and income aggregates. No API key, no sign-up, CORS enabled.
No key required CORS enabled Cached daily CC BY 4.0

Quick start

One URL, any series

All endpoints live under https://fdistats.com/api/v1 and respond to plain HTTP GET. Values in US$ are expressed in millions; add format=csv to the series and cross-section endpoints for a spreadsheet-ready file.

curl
curl "https://fdistats.com/api/v1/series?indicator=fdi_in&countries=AUS&from=2015"

Reference

Endpoints

GET/api/v1/series

Time series

Annual values for one indicator and up to 50 economies or aggregates. Returns 400 with an error message for an unknown indicator or country code.

Query parameters

ParameterTypeDefaultDescription
indicatorstringfdi_inIndicator id — see the list below.
countriesstringWLDComma-separated ISO3 codes (economies or aggregates such as WLD, EAS, HIC). Maximum 50.
frominteger1970First year to include.
tointegerlatestLast year to include.
formatjson | csvjsonCSV returns long format: iso3, country, year, value.

Example request

curl
curl "https://fdistats.com/api/v1/series?indicator=fdi_in&countries=AUS,USA&from=2022&to=2024"

Example response

json
{
  "indicator": {
    "id": "fdi_in",
    "code": "BX.KLT.DINV.CD.WD",
    "label": "FDI net inflows",
    "unit": "usd_m"
  },
  "source": "World Bank, World Development Indicators (CC BY 4.0) via fdistats.com",
  "series": [
    {
      "iso3": "AUS",
      "name": "Australia",
      "data": [
        {
          "year": 2022,
          "value": 68709.4
        },
        {
          "year": 2023,
          "value": 35316
        },
        {
          "year": 2024,
          "value": 53722.9
        }
      ]
    },
    {
      "iso3": "USA",
      "name": "United States",
      "data": [
        {
          "year": 2022,
          "value": 416890
        },
        {
          "year": 2023,
          "value": 361944
        },
        {
          "year": 2024,
          "value": 297058
        }
      ]
    }
  ]
}
GET/api/v1/cross-section

Cross-section (all economies, one year)

Every economy with data for the chosen year, ranked by value (descending). Aggregates are excluded.

Query parameters

ParameterTypeDefaultDescription
indicatorstringfdi_inIndicator id.
yearintegerlatestDefaults to the latest year with broad country coverage.
formatjson | csvjsonCSV columns: rank, iso3, country, region, income, value.

Example request

curl
curl "https://fdistats.com/api/v1/cross-section?indicator=fdi_in_gdp&year=2024"

Example response

json
{
  "indicator": "fdi_in_gdp",
  "year": 2024,
  "rows": [
    {
      "rank": 1,
      "iso3": "MLT",
      "country": "Malta",
      "region": "MEA",
      "income": "HIC",
      "value": 170.05
    },
    {
      "rank": 2,
      "iso3": "LUX",
      "country": "Luxembourg",
      "region": "ECS",
      "income": "HIC",
      "value": 113.62
    },
    {
      "rank": 3,
      "iso3": "CYM",
      "country": "Cayman Islands",
      "region": "LCN",
      "income": "HIC",
      "value": 40.92
    },
    …
  ]
}
GET/api/v1/indicators

Indicator catalogue

Metadata for every indicator: source code, unit, description, latest well-covered year and when the source was last updated.

Example request

curl
curl "https://fdistats.com/api/v1/indicators"

Example response

json
{
  "generatedAt": "2026-09-28T09:23:23.118Z",
  "indicators": [
    {
      "id": "fdi_in",
      "code": "BX.KLT.DINV.CD.WD",
      "label": "FDI net inflows",
      "unit": "usd_m",
      "description": "Net new direct investment into the economy by foreign investors during the year (equity, reinvested earnings and intra-company debt), balance-of-payments basis, current US$.",
      "latestYear": 2024,
      "sourceUpdated": "2026-07-13"
    },
    …
  ]
}
idIndicatorUnitWDI codeLatest
fdi_inFDI net inflowsUS$ millionsBX.KLT.DINV.CD.WD2024
fdi_outFDI net outflowsUS$ millionsBM.KLT.DINV.CD.WD2024
fdi_in_gdpFDI net inflows, % of GDP%BX.KLT.DINV.WD.GD.ZS2024
fdi_out_gdpFDI net outflows, % of GDP%BM.KLT.DINV.WD.GD.ZS2024
gdpGDPUS$ millionsNY.GDP.MKTP.CD2025
gdp_pcGDP per capitaUS$NY.GDP.PCAP.CD2025
popPopulationmillionsSP.POP.TOTL2025
gfcfGross fixed capital formationUS$ millionsNE.GDI.FTOT.CD2024
portfolio_eqPortfolio equity net inflowsUS$ millionsBX.PEF.TOTL.CD.WD2024
remitPersonal remittances receivedUS$ millionsBX.TRF.PWKR.CD.DT2024
odaNet official development assistance receivedUS$ millionsDT.ODA.ODAT.CD2023
trade_gdpTrade openness (% of GDP)%NE.TRD.GNFS.ZS2024
gdp_growthReal GDP growth%NY.GDP.MKTP.KD.ZG2025
inflationInflation (annual average)%FP.CPI.TOTL.ZG2025
unemploymentUnemployment rate%SL.UEM.TOTL.ZS2025
current_accountCurrent account balance, % of GDP%BN.CAB.XOKA.GD.ZS2024
exportsExports of goods & servicesUS$ millionsNE.EXP.GNFS.CD2024
importsImports of goods & servicesUS$ millionsNE.IMP.GNFS.CD2024
gni_pc_pppGNI per capita (PPP)US$NY.GNP.PCAP.PP.CD2025
govt_debtCentral government debt, % of GDP%GC.DOD.TOTL.GD.ZS2022
manuf_gdpManufacturing, % of GDP%NV.IND.MANF.ZS2024
services_gdpServices, % of GDP%NV.SRV.TOTL.ZS2025
hightech_exportsHigh-tech exports, % of manufactured exports%TX.VAL.TECH.MF.ZS2023
rnd_gdpR&D expenditure, % of GDP%GB.XPD.RSDV.GD.ZS2023
internetInternet users, % of population%IT.NET.USER.ZS2024
pop_growthPopulation growth%SP.POP.GROW2025
labour_forceLabour forcemillionsSL.TLF.TOTL.IN2025
GET/api/v1/countries

Countries and aggregates

All 295 codes the API understands: 217 economies with World Bank region and income group, plus aggregates (flagged aggregate: true).

Example request

curl
curl "https://fdistats.com/api/v1/countries"

Example response

json
{
  "countries": [
    {
      "iso3": "AUS",
      "iso2": "AU",
      "name": "Australia",
      "region": "East Asia & Pacific",
      "income": "High income",
      "aggregate": false
    },
    {
      "iso3": "WLD",
      "iso2": "1W",
      "name": "World",
      "region": null,
      "income": null,
      "aggregate": true
    },
    …
  ]
}

Downloads

Ready-made CSV files

Any API URL with format=csv downloads as a file. A few useful starting points — every chart on the site also has its own CSV button.

Code examples

Use it from your tools

Python (pandas)

python
import pandas as pd

BASE = "https://fdistats.com/api/v1"

# Long-format CSV straight into a DataFrame
df = pd.read_csv(f"{BASE}/series?indicator=fdi_in&countries=AUS,USA,CHN&from=2000&format=csv")
wide = df.pivot(index="year", columns="iso3", values="value")  # US$ millions
print(wide.tail())

# Cross-section for one year (JSON)
import requests
rows = requests.get(f"{BASE}/cross-section", params={"indicator": "fdi_in_gdp", "year": 2024}).json()["rows"]
top10 = pd.DataFrame(rows).head(10)

R

r
library(jsonlite)

base <- "https://fdistats.com/api/v1"

# CSV: long format (iso3, country, year, value)
fdi <- read.csv(paste0(base, "/series?indicator=fdi_in&countries=AUS,NZL&from=2000&format=csv"))
head(fdi)

# JSON: all economies for one year
xs <- fromJSON(paste0(base, "/cross-section?indicator=fdi_in_gdp&year=2024"))$rows
head(xs[order(-xs$value), c("country", "value")])

JavaScript (fetch)

javascript
const BASE = 'https://fdistats.com/api/v1';

async function getSeries(indicator, countries, from = 2000) {
  const url = `${BASE}/series?indicator=${indicator}&countries=${countries.join(',')}&from=${from}`;
  const res = await fetch(url);
  if (!res.ok) throw new Error((await res.json()).error);
  return res.json();
}

const { indicator, series } = await getSeries('fdi_in', ['AUS', 'USA']);
for (const s of series) {
  const last = s.data.at(-1);
  console.log(`${s.name}: ${last.value} ${indicator.unit} in ${last.year}`);
}

Fair use

Caching, freshness & licence

  • Freshness. Responses are served from a data snapshot that is regenerated weekly from the official World Bank and OECD APIs (npm run data:refresh). This snapshot was generated on 28 September 2026.
  • Caching. Responses are cached at the edge for 24 hours (s-maxage=86400), so repeated calls are fast. There is no API key and no hard rate limit — please cache results on your side rather than polling.
  • CORS. Every endpoint sends Access-Control-Allow-Origin: *, so you can call it directly from browser code.
  • Licence and attribution. The underlying data are published under CC BY 4.0. Please credit the original source — “World Bank, World Development Indicators” or “OECD” as appropriate — and mention fdistats.com.
  • Coverage. The API currently serves the World Bank indicators listed above. OECD datasets (bilateral positions, FDI restrictiveness) are shown on the Who invests where and FDI openness pages.
  • Stability. The v1 response shapes are stable; new fields may be added. Questions or requests? Get in touch.