Building materials and components statistics: trade data methodology
Published 24 January 2025
Coverage: United Kingdom (UK)
1. Background
This document describes the methods used to obtain and process data published in Tables 13 and 14 of the Building materials and components statistics publication.
2. HMRC Overseas Trade Data API
Starting in 2024, trade data values for Tables 13 and 14 are downloaded directly from HM Revenue & Customs (HMRC) using the Overseas Trade Data API. This API, or Application Programming Interface, is a piece of software which allows 2 applications to communicate with each other. The same data is published by HMRC, and can be easily accessed using their Custom Trade Data Tables tool.
Prior to 2024, the same trade data was provided by external contractors. However, once the methods for obtaining trade data were changed, the back series of trade data going back to 2018 was obtained using the new API-based method. This means that all data currently published was obtained using this method.
HMRC compiles this data using a combination of customs declarations (for all Great Britain trade data and exports from Northern Ireland) and information from the Intrastat survey (for imports into Northern Ireland). The declaration of administrative sources for building materials and components describes how this data is obtained and collated, and where it is published.
3. API data collection and processing
In order to obtain overseas trade data via this API, a set of scripts written in the Python and R programming languages is used to download, reshape and aggregate data for a set of product codes corresponding to construction products.
For some product codes, only a percentage of their imports and exports is estimated to be used in construction. In order to provide a more accurate estimate of trade data relating to construction goods, weighting is applied to these codes using the estimated percentage of their value which is used for construction. This means that for these products, only a certain percentage of the total value is included in the publication.
The list of product codes, names and weights can be found in Trade data methodology: Annex A.
A separate set of 8-digit Combined Nomenclature (CN8) product codes is used for data points in 2016 and earlier, 2017 to 2022 and from 2022 onwards. This is due to changes which have been made to the CN8 nomenclature in 2017 and 2022. More information on the CN8 nomenclature can be found on the Taxation and Customs Union website.
The following steps are taken to download and process trade data:
- A Python script is used to interact with the HMRC OTS API and download trade data. The results are grouped by product code, month and country, and represent both imports and exports.
- Based on which year and quarter being downloaded, the script uses the appropriate list of product codes and weights.
- Trade data is downloaded for each product code in the appropriate list, generating a large data table showing import and export data for all product codes for a certain year and quarter.
- Product names are added to the downloaded data and weights are applied to the values. For a list of product names, codes and weights, see Trade data methodology: Annex A.
- Data is reshaped, then aggregated and filtered to category level (Table 13a), product level (Table 13b), category/EU membership level (Table 14a) and product/EU membership level (Table 14b) for publication.
4. Revisions strategy for trade data
Trade data reported in Tables 13 and 14 is reviewed for changes annually. During the annual review process, all trade data is checked for revisions by comparison to current HMRC API data and the published dataset is updated.
Any significant changes in trade value will be reported in the revisions section of the “Contents” page of the published data table, and in the commentary which accompanies the publication.
5. Further information
The team responsible for this publication can be contacted at: business.statistics@businessandtrade.gov.uk
Trade data is published separately by HMRC at a more general level: HMRC Overseas Trade Data Statistics can be found here.
6. Glossary
API : Application Programming Interface
Great Britain: Scotland, England and Wales
OTS: Overseas Trade Data
7. Department for Business and Trade
The Department for Business and Trade is an economic growth department. We ensure fair, competitive market rates at home, secure access to new markets abroad and support businesses to invest, export and grow. Our priorities are the Industrial Strategy, Make Work Pay, the Trade Strategy and the Plan for Small Business.
8. Legal disclaimer
Whereas every effort has been made to ensure that the information in this document is accurate, the Department for Business and Trade does not accept liability for any errors, omissions or misleading statements, and no warranty is given or responsibility accepted as to the standing of any individual, firm, company or other organisation mentioned.
© Crown copyright 2025
You may re-use this publication (not including logos) free of charge in any format or medium, under the terms of the Open Government Licence.
To view this licence, visit nationalarchives.gov.uk/doc/open-government-licence/version/3
Where we have identified any this party copyright information in the material that you wish to use, you will need to obtain permission from the copyright holder(s) concerned.
If you need a version of this document in a more accessible format, please email business.statistics@businessandtrade.gov.uk. Please tell us what format you need. It will help us if you say what assistive technology you use.