Skip to main content

GOV.UK Trade Tariff API

The GOV.UK Trade Tariff API makes it easy to access Trade Tariff data from https://www.gov.uk/trade-tariff. The data includes commodity codes, duty and VAT rates.

It is accessed via HTTPS and returns data in a JSON format. The reference documentation provides a thorough overview of the endpoints and the response format.

The OTT team maintains a status page that indicates the overall health of various services including the backend and FPO applications.

This can be reviewed here

For internal documentation on the management of the API, please see the internal documentation.

What you can do with this API

The data provided by this API is used on GOV.UK Trade Tariff.

With the Trade Tariff API, you can access Commodity codes, which classify goods for import and export. Commodity codes allow you to:

  • fill in declarations and other paperwork
  • check if there’s duty or VAT to pay
  • find out about duty reliefs and preferential rates
  • find out if import or export licenses are needed
  • Search by free-form text or goods_nomenclature_item_id
  • Scope some API calls by date, i.e. /api/v2/goods_nomenclatures/*
  • Provide resources for all headings and all commodities
  • Search for quota measures with criteria, including goods nomenclature, year, geographic area, etc.

This API is useful for applications that incorporate content from GOV.UK Trade Tariff and for keeping that content up to date. It is meant to provide a predictable and stable interface to Trade Tariff data.

The API documentation is built from an OpenAPI specification file for the Trade Tariff API. This file describes the API and provides example requests and responses.

Quick start

You can use GOV.UK Tariff API to lookup the data that is used on https://www.gov.uk/trade-tariff.

To get started:

  1. Using a tool such as curl, Postman or your web browser, make a GET request to https://www.trade-tariff.service.gov.uk/api/v2/sections.
  2. You’ll receive a JSON response and the fields for this are explained in the reference documentation.

For example, using the curl command line utility tool:

curl https://www.trade-tariff.service.gov.uk/api/v2/sections

Authentication

Usage of GOV.UK Trade Tariff API does not require authentication.

User agent identification

Please identify your application in the User-Agent request header using the following format:

User-Agent: <product> / <product-version> <comment>

In line with the above example using curl, the User-Agent header can be set with the --user-agent switch:

curl --user-agent 'product / product-version' https://www.trade-tariff.service.gov.uk/api/v2/sections

Or as a header by passing the -H switch:

curl -H 'User-Agent: product / product-version' https://www.trade-tariff.service.gov.uk/api/v2/sections

While this is not currently enforced, we reserve the right to enforce this requirement at a later date.

Caching

The GOV.UK Trade Tariff is updated on a daily basis, however to reduce the number of API calls please consider caching requests for 24 hours.

API updates

Changes to the API are documented on the Latest News page

They are also available as a feed to subscribe to at the API News feed

The APIs contain a number of undocumented features which are used for internal Online Trade Tariff operations. Please contact the support email address below before using undocumented features.

Security and compliance

Reporting vulnerabilities

If you believe there is a security issue with GOV.UK Trade Tariff API, please contact us immediately.

Please don’t disclose the suspected breach publicly until it has been fixed.

HTTPS

GOV.UK Tariff API follows government HTTPS security guidelines. The Hypertext Transfer Protocol Secure (HTTPS), which involves the Transport Layer Security (TLS) protocol, is used by the platform to provide secure connections.

Security patches

We upgrade the framework and library code in GOV.UK Trade Tariff API to the latest versions for security and feature enhancements.

Support

If you experience any issues or have questions regarding GOV.UK Trade Tariff API please contact hmrc-trade-tariff-support-g@digital.hmrc.gov.uk