EconPapers    
Economics at your fingertips  
 

Stata–Python API for bulk data download: Example with UN Comtrade

Ka Lok Wong
Additional contact information
Ka Lok Wong: Geneva Graduate Institute

Swiss Stata Conference 2022 from Stata Users Group

Abstract: This presentation aims to guide the audience through the bulk download of Comtrade data via a Stata–Python integration setup that has been made available since Stata 16. Though this presentation is explicitly about the UN Comtrade dataset, the methodology employed is generalizable to other data platforms that allow API downloads. The UN Comtrade Database is one of the best sources when it comes to bilateral trade data by product code. As of early 2022, it covers more country-year observations than the World Trade 1 Organization and the International Trade Centre. However, tailoring the raw data to each researcher’s needs is often time-consuming. Using the Comtrade API with my Stata–Python setup would allow researchers to tailor their downloaded data to their desired specification. In addition, employing this setup significantly reduces human error when compared with the manual downloading and cleaning of Comtrade data.

Date: 2022-11-30
New Economics Papers: this item is included in nep-int
References: Add references at CitEc
Citations:

Downloads: (external link)
http://repec.org/csug2022/Wong-Bern2022-comtrade.pdf

Related works:
This item may be available elsewhere in EconPapers: Search for items with the same title.

Export reference: BibTeX RIS (EndNote, ProCite, RefMan) HTML/Text

Persistent link: https://EconPapers.repec.org/RePEc:boc:csug22:03

Access Statistics for this paper

More papers in Swiss Stata Conference 2022 from Stata Users Group Contact information at EDIRC.
Bibliographic data for series maintained by Christopher F Baum ().

 
Page updated 2025-03-19
Handle: RePEc:boc:csug22:03