All APIs

International trade data API

Query official merchandise trade statistics by country through REST or MCP. Retrieve the latest accepted value, an exact period or dated history.

Online99.99% uptime, last 30 days364 ms typical response

First request

Get the latest value

curl --request GET \
  --url "https://api.narwhalapi.com/v1/economics/USA/trade?period=2026-06" \
  --header "Authorization: Bearer $NARWHAL_API_KEY"

Endpoints

GETMerchandise trade/v1/economics/{country}/trade

Retrieve exports, imports, and the exact merchandise-trade balance for one period. Services are excluded.

Parameters

  • countryrequired

    One supported uppercase country code; see this operation’s coverage list.

  • periodoptional

    Omit it for the latest accepted complete release, or pass one exact period.

  • version_idoptional

    Optional immutable publication version. Use resource_version from a dataset.published or dataset.revised event; omit to read the current admitted indicator.

Response fields

  • countrystring

    The requested uppercase ISO alpha-3 country code.

  • periodstring

    The official observation period returned.

  • exportsnon-negative decimal string

    Total merchandise exports.

  • importsnon-negative decimal string

    Total merchandise imports.

  • balancedecimal string

    Exact exports minus imports; it may be negative.

  • currencyISO 4217 string

    The currency for all three monetary values.

  • seasonal_adjustmentstring or null

    Whether the figure is seasonally adjusted, as the publisher states it: seasonally_adjusted, not_seasonally_adjusted, calendar_adjusted or trend. null means the publisher does not say. Never read null as adjusted.

  • scopestring

    What the totals cover. goods is trade in goods only, so services are not included. A headline figure that adds services is a different series and is not served here.

  • not_seasonally_adjustedtrue

    Present, as true, only when the figures are the original series, not seasonally adjusted. Absent means the figures are seasonally adjusted, or yearly World Bank figures, which have no seasonal adjustment.

  • released_ondate

    The official publication date, not Narwhal's retrieval time.

  • sourceobject

    Who published the figure: the statistics office or central bank, for example {"publisher": "Office for National Statistics"}. Where the data reaches us through another body, distributor names that body too. If we cannot tell who published a figure, source is left out.


Full reference →
GETMerchandise trade history/v1/economics/{country}/trade/observations

Retrieve the current accepted merchandise trade time series for one country.

Parameters

  • countryrequired

    One supported uppercase country code; see this operation’s coverage list.

  • startoptional

    Inclusive first observation period. A year in YYYY format works only for countries served from World Bank annual data. A national series rejects it with 400 invalid_query.

  • endoptional

    Inclusive last observation period. A year in YYYY format works only for countries served from World Bank annual data. A national series rejects it with 400 invalid_query.

  • limitoptional

    Maximum number of periods returned. Defaults to 100. A page may contain fewer periods; follow next_cursor.

  • cursoroptional

    The next_cursor from the previous page.

  • versionoptional

    Accepts first_reported only: returns the first stored value per period with first_reported_at. Cannot be combined with as_of.

  • as_ofoptional

    Returns the series as published through the end of the specified UTC day. Cannot be combined with version.

Response fields

  • countrystring

    The requested uppercase ISO alpha-3 country code. Returned once per page, not for each observation.

  • startstring

    Present only when Narwhal moves the requested start to a later period. Earlier periods are not returned.

  • as_ofRFC 3339 timestamp

    When the source last updated the newest observation on this page, in whole seconds, UTC.

  • sourceobject

    Who published the figure: the statistics office or central bank, for example {"publisher": "Office for National Statistics"}. Where the data reaches us through another body, distributor names that body too. If we cannot tell who published a figure, source is left out.

  • frequencystring

    Present, as annual, only for yearly World Bank history. Periods are then years in YYYY format.

  • seasonal_adjustmentstring or null

    Whether the figure is seasonally adjusted, as the publisher states it: seasonally_adjusted, not_seasonally_adjusted, calendar_adjusted or trend. null means the publisher does not say. Never read null as adjusted.

  • scopestring

    What the totals cover. goods is trade in goods only, so services are not included. A headline figure that adds services is a different series and is not served here.

  • currencyISO 4217 string

    The currency for every value on the page.

  • not_seasonally_adjustedtrue

    Present, as true, only when the figures are the original series, not seasonally adjusted. Absent means the figures are seasonally adjusted, or yearly World Bank figures, which have no seasonal adjustment.

  • observationsarray

    Oldest-first accepted observations, one per period. Missing source values are omitted, never filled. A page can hold fewer observations than limit; follow next_cursor until it is null.

  • observations[].periodstring

    The official month, quarter or year represented by the observation.

  • observations[].first_reported_atRFC 3339 timestamp

    Present only with version=first_reported, this UTC timestamp records when Narwhal first stored the period (the latest time if its measures were stored separately); periods released before capture began show Narwhal's first capture.

  • observations[].exportsdecimal string

    Merchandise exports in the period. Omitted when no value is available for the period.

  • observations[].importsdecimal string

    Merchandise imports in the period. Omitted when no value is available for the period.

  • next_cursorstring or null

    Pass this unchanged as cursor to read the next page; null on the last page.


Full reference →

Use cases

Build an economic calendar

List release times in UTC for the countries and dates you choose.

Read the guide →

Get an alert before a release

Set a reminder with a calendar feed or a daily script.

Read the guide →

Backfill history

Download a full series page by page and resume if it stops.

Read the guide →

Coverage

Indicators

Countries

Show all 39 countries

Sources

  • AustraliaAustralian Bureau of Statistics (ABS)
  • AustriaStatistics Austria, Eurostat
  • BelgiumStatbel, National Bank of Belgium, Eurostat
  • BrazilBrazilian Institute of Geography and Statistics (IBGE), Secretariat of Foreign Trade (SECEX)
  • CanadaStatistics Canada
  • ChileCentral Bank of Chile (BCCh), National Statistics Institute of Chile (INE)
  • ChinaNational Bureau of Statistics of China, General Administration of Customs of China
  • ColombiaNational Administrative Department of Statistics (DANE)
  • CzechiaCzech Statistical Office (ČSÚ)
  • GermanyFederal Statistical Office of Germany (Destatis)
  • DenmarkStatistics Denmark, Eurostat
  • SpainNational Statistics Institute of Spain (INE), Spanish Tax Agency (AEAT)
Show all 39 sources
  • EstoniaStatistics Estonia
  • FinlandStatistics Finland, Finnish Customs (Tulli)
  • FranceNational Institute of Statistics and Economic Studies (INSEE), French Customs
  • United KingdomOffice for National Statistics (ONS)
  • CroatiaCroatian Bureau of Statistics (CBS)
  • IndonesiaStatistics Indonesia (BPS)
  • IrelandCentral Statistics Office (CSO)
  • ItalyItalian National Institute of Statistics (Istat), Eurostat
  • JapanStatistics Bureau of Japan, Cabinet Office of Japan, Japan Customs
  • South KoreaBank of Korea, Statistics Korea
  • LithuaniaState Data Agency of Lithuania
  • LuxembourgSTATEC, Eurostat
  • LatviaCentral Statistical Bureau of Latvia (CSB)
  • MexicoINEGI
  • MalaysiaDepartment of Statistics Malaysia (DOSM)
  • NetherlandsStatistics Netherlands (CBS)
  • NorwayStatistics Norway (SSB)
  • New ZealandStats NZ
  • PakistanPakistan Bureau of Statistics (PBS)
  • PhilippinesPhilippine Statistics Authority (PSA)
  • PolandStatistics Poland, Eurostat
  • PortugalStatistics Portugal (INE)
  • Saudi ArabiaGeneral Authority for Statistics (GASTAT)
  • SingaporeSingapore Department of Statistics (SingStat), Singapore government open-data publications
  • SloveniaStatistical Office of the Republic of Slovenia (SURS)
  • SwedenStatistics Sweden (SCB)
  • United StatesBureau of Labor Statistics (BLS), Bureau of Economic Analysis (BEA), US Census Bureau

Related APIs

Economic data API

Official indicators for prices, labour, output, trade, and rates.

Explore the API →

FAQ

What kind of trade does this cover?

This kind covers official merchandise trade statistics from national publishers.

Can I request trade data for an exact period?

Yes. The API supports exact-period requests, dated history and the latest accepted value.

Can I access trade data through MCP?

Yes. Trade data is available through MCP and REST using the same API key.