Package: comtradr 1.0.5

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.5.tar.gz
comtradr_1.0.5.zip(r-4.7)comtradr_1.0.5.zip(r-4.6)comtradr_1.0.5.zip(r-4.5)
comtradr_1.0.5.tgz(r-4.6-any)comtradr_1.0.5.tgz(r-4.5-any)
comtradr_1.0.5.tar.gz(r-4.7-any)comtradr_1.0.5.tar.gz(r-4.6-any)
comtradr_1.0.5.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://ropensci.r-universe.dev', '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.90 score 83 stars 127 scripts 822 downloads 1 mentions 15 exports 41 dependencies

Last updated from:2da1789662 (on main). Checks:10 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-x86_64OK158
pkgdown docsOK166
source / vignettesOK207
linux-release-x86_64OK153
macos-release-arm64OK120
macos-oldrel-arm64OK125
windows-develOK83
windows-releaseOK84
windows-oldrelOK100
wasm-releaseOK154

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:askpassbitbit64cachemclicliprcpp11crayoncurlfastmapfsgenericsgluehmshttr2lifecyclelubridatemagrittrmemoiseopensslpillarpkgconfigpoormanprettyunitsprogresspurrrR6rappdirsreadrrlangstringistringrsystibbletidyselecttimechangetzdbutf8vctrsvroomwithr

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

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: 2023-12-23
Started: 2023-12-22