Aerospace & Defense · World Bank
World Bank Military Expenditure Indicator API
Datadory delivers world bank military expenditure indicator api data covering eight defense-spending series - outlays as a share of GDP, in current dollars and local currency, against government budgets, plus arms flows and personnel totals - for more than 200 countries and aggregates back to 1960, delivered daily, weekly, or hourly.
- Where it covers
- More than 200 countries plus World Bank regional and income aggregates - about 265 entities report in a given year
- How far back
- Annual observations from 1960 to the most recent reporting year, with 2024/2025 figures present as of the August 2026 research pass
- How fine
- One observation per entity per year per measure
What is the World Bank Military Expenditure Indicator API?
One number turns up in nearly every argument about defense: what share of the economy a country spends on its military. World Bank Military Expenditure Indicator API - filed under Aerospace & Defense, published by the World Bank - is that number carried in a uniform frame. The Bank folds the military spending series compiled by the Stockholm International Peace Research Institute (SIPRI) into the World Development Indicators family, and eight indicators ride along under the MS.MIL prefix: outlays as a percentage of GDP (MS.MIL.XPND.GD.ZS), in current US dollars (MS.MIL.XPND.CD), in current local currency (MS.MIL.XPND.CN), as a share of general government expenditure (MS.MIL.XPND.ZS), arms imports and exports (MS.MIL.MPRT.KD, MS.MIL.XPRT.KD), and armed-forces personnel as a headcount and a share of the labor force (MS.MIL.TOTL.P1, MS.MIL.TOTL.TF.ZS).
Scale, concretely: the headline GDP-share series holds about 17,490 observations across countries, aggregates and years, with roughly 265 entities reporting in any given recent year. The structural payoff is adjacency - because these series live inside the development-indicator frame rather than off in a defense silo, military burden sits one join away from GDP, government finance and population series built on the same country-year spine. Get a sample of this dataset and see the real rows for your country set before committing pipeline time.
What do the first rows actually look like?
A single entity for context, exactly as the observations land:
# World Bank military expenditure indicator series - country-year observations, as delivered
INDICATOR : MS.MIL.XPND.GD.ZS MEASURE: Military expenditure (% of GDP)
COUNTRY : United States ISO3: USA YEAR: 2024
VALUE : 3.42 # percent of GDP
# same country, previous year - only YEAR and VALUE move
YEAR: 2023 VALUE: 3.30
# flip the measure on the identical country-year spine
INDICATOR : MS.MIL.XPND.CD MEASURE: Military expenditure (current USD)
COUNTRY : United States ISO3: USA YEAR: 2024
VALUE : 997309000000 # current US dollars
# rules that hold across the whole panel
KEYS : indicator, country, year
ENTITIES : 200+ countries plus World Bank regional and income aggregates (~265 report in a given year)
SPAN : 1960 to the most recent reporting year
BLANKS : value arrives null where no figure is published - gaps kept, never filledRead the spine rather than the digits. indicator, country and year key every row, which means flipping from a percent-of-GDP view to a current-dollar view is a filter on the indicator column, not a second collection project. Values keep full precision - 3.41921653228044, not 3.4 - so rounding decisions stay yours instead of the publisher's. And the blanks are honest: where a country published nothing, value arrives null, which is the difference between a gap you can model and a zero that quietly lies.
What fields does the dictionary define?
Fourteen fields define each row - three that identify the observation, one that measures it, and ten that describe it or manage its retrieval. All were verified against live values during the August 2026 research pass, which is why this record carries a quality score of 9 against a cross-catalog mean of 7.81.
Two fields deserve a second look before you build. countryiso3code gives you the standard ISO-3 join key most corporate, trade and conflict tables already carry, while total reports the full observation count for a query - 17,490 for the headline series - so a partial pull announces itself instead of masquerading as the whole panel. Definitions below travel unchanged across every delivery channel.
Where does coverage run across geography, time and grain?
- Geography: more than 200 countries plus the Bank's regional and income aggregates - about 265 entities report in a given year. Aggregates are useful benchmarks and dangerous denominators; know which rows you are averaging.
- Temporal: annual observations from 1960 to the most recent reporting year, with 2024/2025 figures present as of the August 2026 research pass. Depth varies by entity - a series starts where its country's reporting starts, so availability windows ship with the sample rather than surprising you mid-build.
- Granularity: one observation per entity per year per measure. That is exactly the grain of burden-sharing analysis and country-risk features; nothing below it exists, so sub-national questions need a different dataset entirely.
Scale check: 265 entities times 65-odd possible years times eight measures yields a corpus small enough to load whole into memory and dense enough to anchor a defense thesis on.
How is the data delivered?
API, files, or your warehouse. Daily, weekly, or hourly.
You pick the channel and the cadence; the fourteen-field dictionary above stays identical across all three. Files suit analysts who want the full 1960-forward panel loaded once per planning cycle, API calls suit products that surface one country-year figure inside a dashboard or briefing tool, and warehouse delivery suits teams running burden-sharing models in SQL beside their own revenue data. Each delivery is versioned against the lastupdated stamp, so when upstream revisions restate history, the correction arrives as an explicit delta your pipeline can apply - not as a silent drift between yesterday's warehouse and today's.
Who uses this data, and for what?
Five jobs the series settles outright:
- Defense market sizing - outlays in current US dollars give TAM models a top-down ceiling per country, while the GDP-share series separates real budget growth from currency noise. The method continues on our market-sizing page.
- Burden-sharing and alliance analysis - expenditure as a share of GDP turns a political argument into a sorted table; the share-of-government-expenditure measure adds what a defense budget competes against domestically.
- Country-risk scoring - decades of annual observations make spending trajectory a model feature rather than an anecdote, joinable to sovereign and credit factors on ISO-3 codes both sides already share.
- Territory planning for defense suppliers - sales teams screen which national budgets are expanding before allocating coverage, using the same panel the analysts argue with. See competitor-tracking for the adjacent workflow.
- Model training on grounded identifiers - typed numeric values, stable ISO-3 keys and explicit nulls make the panel a clean training table; see ml-model-training.
One boundary worth stating: these are national-level outlays. Contractor revenue, program-level budgets and procurement awards live elsewhere - this dataset prices the demand side, not the supply chain.
Which personas get the most value?
Investors and quant researchers get a uniformly shaped spending panel reaching back to 1960 for stress-testing defense theses against the actual budget cycle; more in the investors and quants use cases.
Market researchers and consultants size and rank national defense markets with GDP-share and dollar measures already computed, no currency archaeology required; see market researchers use cases.
Data scientists and ML engineers get typed numeric values, stable ISO-3 keys and honest nulls on a country-year spine that joins outward to macroeconomic and corporate series; see data scientists use cases.
Competitive intelligence teams track which governments are expanding budgets before the contract announcements follow; see competitive intel teams use cases.
Persona fit has edges: journalists wanting assessed force inventories or equipment counts should pair this with an assessment source - outlays say how much, not on what.
What should I know before requesting a sample?
Three things upfront. First, coverage is broad but not uniform: reporting is uneven across entities and years, so genuine gaps exist - your sample includes the exact availability window for every country you name, which converts an afternoon of gap-hunting into a read. Second, aggregates and countries share the frame; we flag which rows are which so a regional total never sneaks into a national average. Third, definitions matter when you set these figures beside NATO or European Defence Agency numbers - different membership sets and slightly different accounting conventions produce small definitional deltas, so plan joins on country and year and expect reconciliation, not contradiction.
Which notes pair with this dataset?
Scope note - this record covers the harmonized military-spending and forces series: who spent how much, in which measure, for which entity-year. It does not carry assessed force inventories, procurement programs or transaction-level arms deals.
Completeness note - every definition above was checked against live rows during the August 2026 research pass. Figures revise over time; we re-confirm current holdings at sample-preparation time instead of asking you to trust a stale snapshot.
Where to go next - the card rail below gathers the parent SIPRI compilation, the alliance and EU-side returns, the arms-transfer ledger and the industry hub that frames the whole defence-data picture.
Field dictionary
Every field below is documented against real records. The full dictionary ships with the sample.
| field | type | definition | example |
|---|---|---|---|
indicator.id | string | Indicator code for the observation - the key that separates a GDP-share row from a dollar row. | MS.MIL.XPND.GD.ZS |
indicator.value | string | Human-readable indicator name attached to every row. | Military expenditure (% of GDP) |
country.id | string | Two-letter World Bank code for the country or aggregate. | US |
country.value | string | Country or aggregate name. | United States |
countryiso3code | string | ISO 3166-1 alpha-3 country code - the join key most external tables already carry. | USA |
date | string | Year of the observation; the series run at annual frequency. | 2024 |
value | number | The observation itself; null when no figure is published for that entity-year. | 3.41921653228044 |
unit | string | Unit qualifier; usually empty because the indicator name already fixes the unit. | (empty) |
obs_status | string | Observation status flag; usually empty. | (empty) |
decimal | integer | Recommended display precision for the value. | 1 |
page | integer | Pagination metadata: position of the current page in a full retrieval. | 1 |
pages | integer | Pagination metadata: total pages available for the query. | 2 |
total | integer | Total observation count for the query - the census denominator for the series. | 17490 |
lastupdated | date | Date the underlying figures were last revised upstream - the freshness stamp worth diffing between pulls. | 2026-07-13 |
Coverage at a glance
| chip | value |
|---|---|
| Geography | More than 200 countries plus World Bank regional and income aggregates - about 265 entities report in a given year |
| Temporal | Annual observations from 1960 to the most recent reporting year, with 2024/2025 figures present as of the August 2026 research pass |
| Granularity | One observation per entity per year per measure |
Questions buyers ask
Which measures do the world bank military expenditure indicator api data include?
Eight series carry the MS.MIL prefix: outlays as a percentage of GDP, in current US dollars, in current local currency, and as a share of general government expenditure, then arms imports and exports in SIPRI trend-indicator values, and armed-forces personnel both as a headcount and as a share of the labor force. All eight share one row shape.
How far back does the data reach?
The frame runs from 1960 to the most recent reporting year, but depth varies by entity: a country's series starts where its own reporting starts, so post-colonial histories begin at independence rather than being padded backward. Your sample lists the exact first and last published year for each entity you name.
Why do some observations arrive blank?
Because no figure was published for that entity-year. Roughly 265 entities appear in a given year, and reporting is voluntary and uneven, so genuine gaps exist alongside real zeros. Blanks are preserved as explicit nulls rather than interpolated - treating a missing budget as a zero-budget would corrupt any burden-sharing league table.
How does this relate to the SIPRI Military Expenditure Database?
Same underlying estimates, different packaging: the Bank incorporates SIPRI's compiled figures into its development-indicator frame, which puts military spending one join away from GDP, population and government-finance series built on the identical country-year spine. For pure defense-economics depth the parent database remains the deeper artifact.
Do historical military spending figures ever get restated?
Yes. Figures can be revised for past years, not just the newest one, and each observation carries a lastupdated stamp recording when the underlying value last changed. Datadory deliveries are versioned so a revision arrives as an explicit delta your pipeline can apply, rather than a silent drift in yesterday's numbers.
Can a sample be cut to specific countries, years or measures?
Yes - name the countries, the year range and which of the eight measures you work in, and the sample arrives shaped to that scope with the fourteen-field dictionary unchanged. Most teams take the full panel first, then keep their slice rotating on whatever cadence their models expect.
See the rows before you pay anything.
Name this dataset and we send real records from it — scoped to the fields you asked for.