Timetable for data availability of country #
Q: How soon will country data for imports and exports be available?
A: There is no expected date or time when a specific country’s data will become available. We request the annual and monthly merchandise and services data in February and June. However, we receive data from various countries at different times. When our office receives the data, we harmonize, validate, and upload it into the UN Comtrade database.
You can use data availability API to monitor newly released data or visit our data availability page.
Q: What is the frequency of data refresh?
A: Similarly, there is no set schedule for data refresh. We process data continuously as long as data providers send data. For annual data, most data providers send provisional data earlier during the year and follow up with revised and/or final data towards the latter part of the year. For monthly merchandise data, we follow up with countries that have indicated they will regularly provide monthly data. Receipt of monthly data varies by data provider and can be received monthly or quarterly, or together with their annual dataset. Some countries provide their latest monthly data within a month of the close of the reference period, while others provide their data later. Many countries still need to establish regular provision of monthly data, and we are working with data providers to improve the regularity of data provision.
Q: Why is monthly data not available for a specific year when annual data for the same reporter/period exists?
A: Countries submit their datasets in diverse formats and follow varying schedules. Some countries furnish annual data without monthly breakdowns, so we can only release the annual data. However, certain countries may include the monthly breakdown within their annual data or transmit monthly data separately. In these instances, we publish both sets of data.
Q: API Data Versions and Updates – To my understanding, countries report both provisional trade data as well as revised and/or final trade data later on. I wonder, is the data that’s provided through the API always the final version of the trade data, or could it be subject to change later on? That is, would I have to update already fetched data now and then to ensure I have the latest version/revision of the data?
I have looked through the code on GitHub for the comtradeapicall Python package, but despite the functions having names such as bulkDownloadFinalFile, they seem to simply redirect to bulkDownloadFile and so on, only with the parameter tradeDataType set to ‘FINAL’. However, this parameter doesn’t seem to have an impact on the actual API call, so that makes me wonder if all data provided through the API is always final?
A: To clarify, the data provided through the UN Comtrade API is always the latest available reported data. UN Comtrade only keeps one version of a dataset, which means the data may be updated with revisions over time, but there is no permanent archive of multiple versions. When you retrieve data through the API (using the functions: bulkDownloadFinalFile — for the most recent data in reported classification, or bulkDownloadFile — for the most recent data in converted classification), you’re getting the most recent dataset as reported by the country.
To ensure you always have the latest version of the trade data, it would be a good practice to periodically update your fetched data. You can refer to the publication notes on the UN Comtrade website for the latest publication dates, which can guide you on when new or revised data is available.
How do you view data availability? #
There are several ways to view data availability in UN Comtrade:
- You can browse data availability at https://comtradeplus.un.org/DataAvailability.
- You can view https://comtradeplus.un.org/Visualization/DAplus.
- You can view the time series https://comtradeplus.un.org/DATimeSeries.
- You can also obtain this information through the UN Comtrade API. You will need an API subscription key to place API calls.
Data Availability via API #
Users can query the data availability through APIs through these endpoints:
- https://comtradeapi.un.org/data/v1/getLiveUpdate: return the list of the recent releases, the same with the UI live update page.
- https://comtradeapi.un.org/data/v1/getDa and https://comtradeapi.un.org/data/v1/getDaTariffline: return the data availability for trade and tariffline data respectively.
- https://comtradeapi.un.org/bulk/v1/get and https://comtradeapi.un.org/bulk/v1/getTariffline: return the data availability for the bulk trade and tariffline files respectively. Note that these APIs are only accessible to premium users.
For users’ convenience, the Python package of comtradeapicall (provided as is by the community) can be utilized to extract data availability with the following model classes:
Data Availability: Model class to extract data availability.
getFinalDataAvailability(subscription_key, SelectionCriteria):
return data frame containing final data availability.getTarifflineDataAvailability(subscription_key, SelectionCriteria)
: return data frame containing tariff line data availability.getFinalDataBulkAvailability(subscription_key, SelectionCriteria, [publishedDateFrom], [publishedDateTo])
: return data frame containing final bulk files data availability.getTarifflineDataBulkAvailability(subscription_key, SelectionCriteria, [publishedDateFrom], [publishedDateTo])
: return the data frame containing the data availability of tariffline bulk files.getLiveUpdate(subscription_key)
: return data frame recent data releases.
Examples of Python data availability classes are available at comtradeapicall.