Skip to content

Getting Started

The Getting Started section is the entry point for first-time users and CLI users. Three pages take you from a fresh Python install to a working authenticated query against the UN Comtrade API.

Path

Page Time What you will do
Installation 2 min pip install un-comtrade-sdk, verify the version, set up an optional dependency group.
Quick Start 5 min Fetch India's 2022 exports and print a one-line summary. No API key required.
Authentication 5 min Wire up UN_COMTRADE_KEY, choose preview-vs-subscription, configure the metadata cache.

After these three pages, jump to the Python SDK → Trade guide or browse the Cookbook for runnable recipes.

What you should already know

  • Basic Python — interpreter installed, pip understood.
  • Comfortable opening a terminal (POSIX shell or PowerShell).
  • No prior knowledge of the UN Comtrade API, the SDK, or the trade data format is required.

Pages

Installation

The minimum viable install. Includes the optional dependency groups (parquet, duckdb, all, dev), the source-tree install for contributors, and the offline-mode notes for air-gapped environments.

Quick Start

A five-minute walkthrough that constructs the client, fetches the country catalogue, fetches India's 2022 exports, and prints a one-line summary. No API key required.

Authentication

Wires up UN_COMTRADE_KEY, distinguishes preview-vs-subscription modes, configures the metadata cache directory, and explains the rate-limit handling.

  • RECIPE-001List reporter countries. Beginner.
  • RECIPE-011Fetch India's annual exports. Beginner.

Next steps