# 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](https://www.uktradeinfo.com/)
- Licence and terms: [Open Government Licence v3.0](https://www.uktradeinfo.com/trade-data/)
- Coverage: United Kingdom
- Answers are shared and cached for 21600 seconds.

## Questions you can ask

- What is the HMRC country id for China? (operation `hmrc_country_lookup`)
- Which CN8 codes cover passenger cars? (operation `hmrc_commodity_lookup`)
- How much did the UK import in vehicles \(chapter 87\) from China in early 2024? (operation `hmrc_trade_monthly`)

## 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.

## Missing something?

Tell us what data, endpoint or feature you wish we had. It is free and needs no signup: call the MCP tool request_capability, or POST a short description to https://agentnative.dennery.ai/v1/capabilities/request.
