Package: comtradr 1.0.6

Paul Bochtler

comtradr: Interface with the United Nations Comtrade API

Interface with and extract data from the United Nations 'Comtrade' API <https://comtradeplus.un.org/>. 'Comtrade' provides country level shipping data for a variety of commodities, these functions allow for easy API query and data returned as a tidy data frame.

Authors:Paul Bochtler [aut, cre, cph], Harriet Goers [aut], Chris Muir [aut], Alicia Schep [rev], Rafael Hellwig [rev], Ernest Guevarra [rev], Nicholas Potter [rev], Juergen Amann [ctb]

comtradr_1.0.6.tar.gz
comtradr_1.0.6.zip(r-4.7-any)comtradr_1.0.6.zip(r-4.6-any)comtradr_1.0.6.zip(r-4.5-any)
comtradr_1.0.6.tgz(r-4.6-any)comtradr_1.0.6.tgz(r-4.5-any)
comtradr_1.0.6.tar.gz(r-4.7-any)comtradr_1.0.6.tar.gz(r-4.6-any)
comtradr_1.0.6.tgz(r-4.6-emscripten)
manual.pdf |manual.html
DESCRIPTION |NEWS
card.svg |card.png
comtradr/json (API)

# Install 'comtradr' in R:
install.packages('comtradr', repos = c('https://packages.ropensci.org', 'https://cloud.r-project.org'))

Reviews:rOpenSci Software Review #613

Bug tracker:https://github.com/ropensci/comtradr/issues

Pkgdown/docs site:https://docs.ropensci.org

Datasets:

On CRAN:

Conda:

apicomtradepeer-reviewedsupply-chain

8.91 score 83 stars 130 scripts 692 downloads 1 mentions 15 exports 41 dependencies

Last updated from:143d783190 (on main). Checks:10 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-develOK153
pkgdown docsOK229
source / vignettesOK202
linux-releaseOK151
macos-releaseOK96
macos-oldrelOK76
windows-develOK82
windows-releaseOK87
windows-oldrelOK97
wasm-releaseOK127

Exports:ct_commodity_db_typect_commodity_lookupct_country_lookupct_get_bulkct_get_datact_get_ref_tablect_get_remaining_hourly_queriesct_get_reset_timect_migrate_cachect_register_tokenct_searchct_update_databasesct_use_pretty_colsget_primary_comtrade_keyset_primary_comtrade_key

Dependencies:askpassbitbit64cachemclicliprcpp11crayoncurldplyrfastmapfsgenericsgluehmshttr2lifecyclelubridatemagrittrmemoiseopensslpillarpkgconfigprettyunitsprogresspurrrR6rappdirsreadrrlangstringistringrsystibbletidyselecttimechangetzdbutf8vctrsvroomwithr

Transition from old comtradr
Transitioning from the old API to the new API 🔄 | The basics 📊 | The time parameter | Country Names 🌍 | Previously | Now | Searching for commodity codes 🚢📦 | Previously == Now | API search metadata 📑 | Package Data 📦 | "Polished" Column Headers 🎨

Last update: 2026-07-30
Started: 2023-12-22

comtradr
Data availability | Package information | Install and load comtradr | Authentication 🔐 | Storing the API key | Making API calls | API search metadata | More on the lookup functions | API rate limits | Package Data | Visualize | Handling large amounts of Parameters | commodity_code | flow_direction | reporter and partner | mode_of_transport, partner_2, and customs_code | Example Usage

Last update: 2025-07-31
Started: 2023-06-27

Caching requests from the UN Comtrade API
The basics of caching 💽 | Careful with outdated data! ⚠️

Last update: 2024-05-23
Started: 2024-02-04

Querying bulk files from the API
Why use bulk files? 📦📦📦 | Accounting for HS Code changes 🏗️👷 | Getting started with bulk files 🏃 | Formatting bulk files 📝

Last update: 2024-05-13
Started: 2024-05-13

Querying large amounts of data
The limits | The example - Imports of the EU | 1. What are the commodity codes? | 2. Which are the countries? | Getting the data | EU imports from all countries | Data cleaning | Caveat on trade "dependencies"

Last update: 2024-05-13
Started: 2023-12-22