HMRC UK overseas trade in goods
HM Revenue and Customs UK Trade Info: monthly UK imports and exports of goods by commodity, country and flow, plus lookups for commodity codes and countries.
No API key needed to call
- Source
- HM Revenue and Customs UK Trade Info
- Licence and terms
- Open Government Licence v3.0
- Coverage
- United Kingdom
- Refresh cadence
- Answers are shared and cached for 21600 seconds.
Questions you can ask
- What is the HMRC country id for China?
- Which CN8 codes cover passenger cars?
- How much did the UK import in vehicles (chapter 87) from China in early 2024?
Operations
HMRC trade country id lookup
Answers: what is the HMRC country id of a country, from its name or two-letter code? The id is needed for hmrc_trade_monthly.
| name | required, string, Part of the country name, or a two-letter ISO code such as CN. |
|---|
Example: What is the HMRC country id for China?
Over MCP
{"tool":"call_connector_operation","arguments":{"connector":"hmrc","operation":"hmrc_country_lookup","params":{"name":"China"}}}Over HTTP
curl '/v1/connectors/hmrc/hmrc_country_lookup?name=China'HMRC trade commodity code lookup
Answers: which 8-digit CN commodity codes sit under a 2 to 8 digit code prefix, with their HS group descriptions? Gives the CommodityId used by hmrc_trade_monthly.
| prefix | required, string, Start of the commodity code, 2 to 8 digits. |
|---|
Example: Which CN8 codes cover passenger cars?
Over MCP
{"tool":"call_connector_operation","arguments":{"connector":"hmrc","operation":"hmrc_commodity_lookup","params":{"prefix":"8703"}}}Over HTTP
curl '/v1/connectors/hmrc/hmrc_commodity_lookup?prefix=8703'HMRC monthly UK trade value by commodity and country
Answers: how much (value in pounds sterling and net mass in kg) did the UK import or export of a commodity chapter (2 digits) or CN8 product to or from one country in each month of a period? Sums over ports.
| commodity_id | required, integer, HMRC CommodityId: a 2-digit HS chapter such as 87 (vehicles) or an 8-digit CN8 code such as 87031011. Use hmrc_commodity_lookup. |
|---|---|
| country_id | required, integer, HMRC CountryId, for example 720 for China. Use hmrc_country_lookup. |
| flow | required, string, 1 | 2 | 3 | 4, 1 = EU imports, 2 = EU exports, 3 = non-EU imports, 4 = non-EU exports. |
| from | required, integer, First month as YYYYMM. |
| to | required, integer, Last month as YYYYMM, at most 24 months after the first. |
Example: How much did the UK import in vehicles (chapter 87) from China in early 2024?
Over MCP
{"tool":"call_connector_operation","arguments":{"connector":"hmrc","operation":"hmrc_trade_monthly","params":{"commodity_id":87,"country_id":720,"flow":"3","from":202401,"to":202403}}}Over HTTP
curl '/v1/connectors/hmrc/hmrc_trade_monthly?commodity_id=87&country_id=720&flow=3&from=202401&to=202403'Source notice
Source: HM Revenue and Customs UK Trade Info. Contains information licensed under the Open Government Licence v3.0. Terms: "You are free to: copy, publish, distribute and transmit the Information; adapt the Information; exploit the Information commercially and non-commercially" under the Open Government Licence v3.0, which asks for attribution. Values are trimmed and reordered here; the publisher does not endorse this presentation.