# Import Export Trade Data Scraper - UN Comtrade (`logiover/comtrade-trade-data-scraper`) Actor

UN Comtrade API alternative. Scrape import/export trade statistics by country & HS code with no API key. Export bilateral trade flows to CSV/JSON.

- **URL**: https://apify.com/logiover/comtrade-trade-data-scraper.md
- **Developed by:** [Logiover](https://apify.com/logiover) (community)
- **Categories:** Automation, Business, AI
- **Features:** Limited permissions
- **Stats:** 30 total users, 3 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.99 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Import Export Trade Data Scraper — UN Comtrade Statistics (No API Key)

![Apify Actor](https://img.shields.io/badge/Apify-Actor-00A67E?logo=apify\&logoColor=white) ![No API key](https://img.shields.io/badge/No%20API%20key-required-2ea44f) ![Pay per result](https://img.shields.io/badge/Pricing-Pay%20per%20result-1C7ED6) ![Trade Data](https://img.shields.io/badge/Category-Trade%20%26%20B2B%20Data-8B5CF6) ![Export](https://img.shields.io/badge/Export-JSON%20%7C%20CSV%20%7C%20Excel-F59E0B)

Scrape global **import and export trade statistics** for any country pair straight from the official **UN Comtrade** database. This international trade data scraper returns clean **bilateral trade flows** broken down by reporter country, trading partner, HS commodity code, trade value (USD), quantity and net weight — **annual or monthly**, with **no API key, no login, no registration**. Enter plain country names like `Germany`, `China` or `USA` and the Actor resolves them to the correct UN **M49** codes, handles throttling and pagination, and streams the data into a clean dataset.

> ### 🏆 Why this UN Comtrade scraper?
>
> **15 fields per record** · **thousands of trade-flow rows per run** · direct API + JSON (no browser) · plain country names auto-resolved to M49 · CIF/FOB values · export to JSON / CSV / Excel. The unofficial **UN Comtrade API alternative** for trade intelligence, market-entry research and supply-chain analysis — the Actor does country/HS-code resolution, rate-limiting and fan-out for you, so you skip the raw API and key registration.

***

### ✨ What this Actor does / Key features

- 🌍 **Any country pair** — one or many reporter countries × one or many partner countries, or `World` (all partners combined) and `all`.
- 🔤 **Plain names or codes** — pass `USA, Germany, China` or M49 numeric codes (`842, 276`); the Actor resolves names to the correct UN **M49** codes automatically.
- 📦 **HS commodity granularity** — specific HS codes (`8703, 8517`) or an aggregation: `TOTAL` (all), `AG2` (all 2-digit HS chapters), `AG4` (4-digit headings), `AG6` (6-digit subheadings).
- 🔁 **Import, export or both** — pick the trade flow direction you need.
- 📅 **Annual or monthly** — a single year `2023`, a list `2021,2022`, a range `2020-2023`, or a monthly range `202301-202312`.
- 💵 **Full value breakdown** — trade value in USD plus **CIF** (imports) and **FOB** (exports) values, net weight in kg, quantity and unit.
- 🗺️ **ISO3 codes included** — every row carries reporter and partner ISO3 codes for easy joins and mapping.
- ⚡ **Direct API + JSON extraction** — reads the official UN Comtrade endpoints; no browser, no HTML parsing, no headless overhead.
- 🛡️ **Keyless preview tier** — uses UN Comtrade's public preview tier; the Actor throttles and fans out across countries, commodities and periods automatically.

### 🚀 Quick start (3 steps)

1. **Pick your countries** — enter one or more reporter countries and partner countries (plain names or M49 codes). Use `World` to combine all partners.
2. **Choose commodities, flow & period** — HS codes or an aggregation (`AG2`), `import` / `export` / `both`, annual or monthly, and the years or months you want.
3. **Run & download** — click **Start**, then export to **JSON, CSV, Excel or XML** from the **Output** tab, or pull it via the Apify API. [Schedule](https://docs.apify.com/platform/schedules) it to refresh your trade datasets automatically.

### 📥 Input

All fields are optional — the defaults (`USA` reporter, `World` partner, `AG2` commodities, last full year) return a working dataset out of the box.

#### Example — who do the USA & Germany import from China?

```json
{
  "reporters": "USA, Germany",
  "partners": "China",
  "flow": "import",
  "commodities": "AG2",
  "periods": "2022-2023",
  "frequency": "A",
  "maxResults": 1000
}
```

#### Example — which countries import cars (HS 8703) from the world?

```json
{
  "reporters": "all",
  "partners": "World",
  "flow": "import",
  "commodities": "8703",
  "periods": "2023",
  "frequency": "A",
  "maxResults": 2000
}
```

#### Example — monthly electronics trade flows for one year

```json
{
  "reporters": "China",
  "partners": "USA, Germany, Japan",
  "flow": "export",
  "commodities": "8517,8542",
  "periods": "202301-202312",
  "frequency": "M",
  "throttleMs": 1100
}
```

| Field | Type | Description |
|-------|------|-------------|
| `reporters` | string | Reporting country/countries — plain names, M49 codes, or `all`. Comma-separated (e.g. `USA, Germany, China` or `842,276`). Default `USA`. |
| `partners` | string | Trading partner(s) — plain names, M49 codes, `World` (all partners combined), or `all`. Comma-separated. Default `World`. |
| `flow` | string | `import`, `export` or `both`. Default `both`. |
| `commodities` | string | Specific HS codes (`8703,8517`) or an aggregation: `TOTAL` (all), `AG2` (all HS2 chapters), `AG4` (4-digit headings), `AG6` (6-digit subheadings). Default `AG2`. |
| `periods` | string | Year `2023`, list `2021,2022`, range `2020-2023`, or monthly `202301-202312`. Blank = last full year. |
| `frequency` | string | `A` (annual) or `M` (monthly). Default `A`. |
| `maxResults` | integer | Maximum trade records to save. Default 1000. |
| `throttleMs` | integer | Delay between API calls in ms. The keyless tier rate-limits to ~1 req/sec — keep **≥ 1100**. Default 1100. |
| `proxyConfiguration` | object | Apify Proxy settings. Datacenter is fine for this API. |

> **Tip — finding M49 codes:** you rarely need them. Just type the country name (`Germany`, `Republic of Korea`, `Viet Nam`) and the Actor maps it to the UN M49 numeric code. Use `World` as the partner to get each reporter's total trade with all partners in one row, or `all` to expand every bilateral pair.

### 📤 Output

One row per **reporter × partner × commodity × period × flow** — **15 fields**, exportable to JSON, CSV, Excel or XML. Here is a trimmed sample record:

```json
{
  "reporter": "USA",
  "reporterISO": "USA",
  "partner": "China",
  "partnerISO": "CHN",
  "flow": "Import",
  "period": "2023",
  "hsCode": "85",
  "commodity": "Electrical machinery and equipment",
  "tradeValueUsd": "127845300000",
  "cifValueUsd": "127845300000",
  "fobValueUsd": null,
  "netWeightKg": "4120500000",
  "qty": "N/A",
  "qtyUnit": "N/A",
  "scrapedAt": "2026-07-06T08:30:11.000Z"
}
```

<details>
<summary><b>📋 Full field reference (click to expand)</b></summary>

| Field | Description |
|-------|-------------|
| `reporter` | Reporting country name |
| `reporterISO` | Reporting country ISO3 code |
| `partner` | Trading partner country name |
| `partnerISO` | Trading partner ISO3 code |
| `flow` | Trade flow direction — `Import` or `Export` |
| `period` | Year (annual) or `YYYYMM` (monthly) |
| `hsCode` | Harmonized System commodity code |
| `commodity` | Commodity description |
| `tradeValueUsd` | Trade value in USD |
| `cifValueUsd` | CIF value (cost, insurance, freight) — for imports |
| `fobValueUsd` | FOB value (free on board) — for exports |
| `netWeightKg` | Net weight in kilograms |
| `qty` | Quantity |
| `qtyUnit` | Quantity unit of measure |
| `scrapedAt` | Scrape timestamp (ISO 8601) |

</details>

#### Additional output fields

These fields are also present in the dataset:

| Field | Type | Description |
|---|---|---|
| `reporterCode` | number / string | Reporter numeric M49 code. |
| `partnerCode` | number / string | Partner numeric M49 code. |
| `classification` | string | Commodity classification code (e.g. HS). |
| `isAggregate` | boolean | Whether the row is an aggregated total. |

### 💡 Use cases

- **Market-entry research** — see which countries buy a product and how much, before you enter a market.
- **Competitor & supplier sourcing** — find where a country imports a commodity from, and in what volume.
- **Commodity trade trends** — track import/export value over years or months by HS code.
- **Supply-chain & tariff impact analysis** — model how bilateral flows shift over time.
- **Economics & BI dashboards** — feed clean bilateral trade statistics into your reports and visualizations.
- **AI agents & data products** — provide structured international trade data to LLM workflows and datasets.

### 👥 Who uses it

Trade analysts & market-entry consultants · supply-chain and procurement teams · economists & data journalists · import/export businesses sourcing suppliers · BI/analytics teams building trade dashboards · researchers and AI/data-product builders needing structured customs statistics.

### 💰 Pricing

This Actor runs on a simple **pay-per-result** model — you pay for the trade records you extract, with no separate Apify platform fees to calculate. Try it on the **free tier** first, then scale up. See the **Pricing** tab on this page for the current rate.

### ❓ Frequently Asked Questions

**Is it legal to scrape UN Comtrade data?**
The Actor collects publicly available official trade statistics from UN Comtrade's preview tier. You are responsible for using the data in compliance with UN Comtrade's terms and applicable laws.

**Do I need a UN Comtrade API key?**
No. This Actor uses the **keyless UN Comtrade preview tier** — no registration, no key, no login. Only an Apify account is required.

**Does UN Comtrade have a public API — is this an API alternative?**
UN Comtrade exposes a raw data API that normally involves key registration, M49 code lookups, throttling and pagination handling. This Actor is an **unofficial UN Comtrade API alternative** that does all of that for you: it resolves country names to M49 codes, respects the rate limit, fans out across your countries/commodities/periods, and returns tidy rows.

**Can I use plain country names?**
Yes. Pass names like `Germany`, `China`, `USA`, `Republic of Korea` and the Actor resolves them to the correct UN **M49** codes automatically. Numeric M49 codes also work.

**What are AG2, AG4 and AG6?**
HS aggregation levels — `AG2` = all 2-digit HS chapters, `AG4` = 4-digit headings, `AG6` = 6-digit subheadings. You can also pass specific HS codes like `8703,8517`, or `TOTAL` for the all-commodities total.

**Is this company- or shipment-level data?**
No — this is **statistical trade-flow data** (country × commodity × value), the official UN Comtrade figures. It is not shipment-level bill-of-lading or individual company records.

#### Can I scrape UN Comtrade without an API or login?

Yes. There is no UN Comtrade account, login or API key needed — only an Apify account. Enter your reporter/partner countries, HS codes, flow and periods, then run. The Actor uses the keyless UN Comtrade preview tier.

#### How do I export UN Comtrade data to CSV or JSON?

Run the Actor and download the dataset as **CSV, JSON, Excel, HTML or XML** from the run, or fetch it through the Apify API and integrations (Make, Zapier, Google Sheets). Every row is one reporter × partner × HS code × period × flow record.

#### How much data can I get?

You can pull thousands of trade-flow rows per run. The keyless preview tier caps ~500 records per single query and rate-limits to ~1 request/second, so the Actor automatically throttles (keep `throttleMs` ≥ 1100) and fans out across countries, commodities and periods. For very broad jobs (e.g. `all` reporters over many years), split into smaller runs.

#### How do I find which countries import a product by HS code?

Set the partner to `World` and enter the HS code as `commodities`; the scraper returns each reporter country's import value and quantity for that product from UN Comtrade.

#### Can I get monthly trade data instead of annual figures?

Yes. Set `frequency` to `M` and pass a monthly range like `202301-202312` to pull month-by-month bilateral trade flows.

### 🔗 More B2B & registry data scrapers by logiover

Building a trade-intelligence or company-data pipeline? Pair UN Comtrade with the rest of the B2B, registry and government-data suite:

| Source | Actor |
|---|---|
| 🇬🇧 UK | [UK Companies House Bulk Scraper](https://apify.com/logiover/uk-companies-house-bulk-scraper) |
| 🇺🇸 USA | [SEC EDGAR Form D Scraper](https://apify.com/logiover/sec-edgar-form-d-scraper) · [USAspending.gov Scraper](https://apify.com/logiover/usaspending-gov-scraper) · [NY Company Registry Scraper](https://apify.com/logiover/usa-new-york-company-registry-scraper) |
| 🇫🇷 France | [France Company Registry Scraper](https://apify.com/logiover/france-company-registry-scraper) |
| 🇫🇮 Finland | [Finland Company Registry Scraper](https://apify.com/logiover/finland-company-registry-scraper) |
| 🇨🇿 Czechia | [Czech Company Registry Scraper](https://apify.com/logiover/czech-company-registry-scraper) |
| 🇳🇴 Norway | [Brreg Norway Company Scraper](https://apify.com/logiover/brreg-norway-company-scraper) |
| 🇸🇪 Sweden | [Allabolag Scraper](https://apify.com/logiover/allabolag-scraper) |
| 🇦🇺 Australia | [Australia Business Register Scraper](https://apify.com/logiover/australia-business-register-scraper) |
| 🌐 Global | [GLEIF LEI Scraper](https://apify.com/logiover/gleif-lei-company-registry-scraper) · [Global Public Tenders Scraper](https://apify.com/logiover/global-public-tenders-scraper) |
| 🏥 Health/registry | [NPI Registry Scraper](https://apify.com/logiover/npi-registry-scraper) · [FDA Data Scraper](https://apify.com/logiover/fda-data-scraper) · [ClinicalTrials.gov Scraper](https://apify.com/logiover/clinicaltrials-gov-scraper) |

👉 Browse all **[logiover scrapers on Apify Store](https://apify.com/logiover)** — 180+ actors across real estate, jobs, crypto, social media & B2B data.

### ⏰ Scheduling & integration

Schedule this Actor on Apify to refresh your trade datasets monthly or quarterly as new UN Comtrade periods are released. Export results to JSON, CSV or Excel, sync to Google Sheets, or push to your database, BI tools and webhooks through the Apify API. Connect it to **Make, n8n or Zapier** to build automated trade-intelligence pipelines.

### 🤖 AI Agents, MCP & RAG Integration

**Import Export Trade Data Scraper** works natively as an on-demand data tool for AI assistants and autonomous workflows.

Connect this Actor directly to **Apify AI**, **Claude Desktop**, **Cursor**, **VS Code**, **Windsurf**, **LangChain**, or **LlamaIndex** via the official **Apify MCP Server** — no custom wrapper code needed:

```json
{
  "mcpServers": {
    "apify": {
      "type": "http",
      "url": "https://mcp.apify.com?tools=logiover/comtrade-trade-data-scraper"
    }
  }
}
```

- **Schema-typed inputs & outputs:** Clean JSON records with explicit `.actor/input_schema.json` and `.actor/output_schema.json` definitions so LLM agents infer parameters and parse fields accurately without HTML noise.
- **Bounded & predictable runs:** Built-in volume caps and pay-per-result budget guards prevent runaway agent tool loops.
- **RAG & automation ready:** Stream run datasets straight into vector stores, n8n, Make, Zapier, or webhook pipelines.

### 💬 Support, Issues & Reviews

- **Bug reports & target-site changes:** Hit an unexpected empty result or selector change? [Open a ticket in the Issues tab](https://apify.com/logiover/comtrade-trade-data-scraper/issues) with your **Run ID** or sample input — we actively monitor issues and ship fixes fast.
- **Feature & field requests:** Need an additional data attribute or filter? [Request it in the Issues tab](https://apify.com/logiover/comtrade-trade-data-scraper/issues).
- **Enjoying this Actor?** If it saved you engineering time, please consider leaving an honest [review on Apify Store](https://apify.com/logiover/comtrade-trade-data-scraper/reviews) or bookmarking [logiover/comtrade-trade-data-scraper](https://apify.com/logiover/comtrade-trade-data-scraper) — organic developer feedback helps others discover reliable tools and keeps maintenance prioritized.

### ⚖️ Legal

This Actor extracts only publicly available official UN Comtrade statistics and is intended for legitimate research, analytics and business intelligence. It is an independent scraper and is **not affiliated with or endorsed by the United Nations**. You are responsible for complying with UN Comtrade's terms of service and any applicable local laws.

***

### 📝 Changelog

#### 2026-11-11

- Added reliable terminal run status telemetry and structured Apify AI / MCP Server (`mcp.apify.com`) tool configuration.
- Added direct Issues & Reviews support links and refreshed live maintenance verification.

#### 2026-11-01

- Monthly health check (2026-11-01): a live run on the current build completed successfully and returned data. Input options, output fields and pricing are unchanged.
- README refreshed: 1 link to renamed Actors updated, 1 link to retired Actors removed; documented 4 additional output fields.

#### 2026-10-15

- A run that reaches its maximum cost per run now stops cleanly with its results saved and a status message, instead of ending as aborted.
- A proxy group your account cannot use no longer stops the run at start-up; it falls back to the default Apify Proxy.
- Memory is managed within the run's own limit, which removes a rare out-of-memory crash on large pages.
- The default used when the field is left out for `maxResults` is now 7,740 (was 1,000).

#### 2026-09-23

- Fleet-wide quality audit. Verified end to end against live data and re-checked the input schema, the output columns and the run configuration.
- Output verified on a live run: 20 columns returned, 99.0% of cells populated.
- Run reliability reviewed: 100.0% of public runs succeeded in the last 30 days.
- Input schema, output schema and pricing configuration reviewed.

#### 2026-09-01

- Fleet-wide health check. Verified against this Actor's real run history: 30-day success rate, output row counts, per-field fill rates, and peak memory against the configured memory limit.
- Reviewed for the failure patterns that have cost this fleet runs — unguarded proxy setup, retry loops that can outlast the run's own time budget, and full-page HTML parsing that can exhaust a small container.
- No change to input, output fields or scraping logic.

#### 2026-08-11

- Maintenance release: refreshed the build and dependencies.
- Re-verified live execution, non-empty structured output and dataset field/type integrity.
- Reviewed reliability (retries, pagination) and output quality as part of a full-fleet QA pass.

#### 2026-08-01

- Completed the August 2026 full health check: verified empty/programmatic default, Console UI default, and two source-informed alternative inputs on Apify.
- Confirmed successful live execution, non-empty structured output, dataset-field/type integrity, and logical sample quality within the 5-minute quality window.

#### 2026-07-06

- ✨ README overhaul: added badge row, ready-to-run example scenarios, full field reference, B2B/registry cross-suite links and an expanded high-intent FAQ.

#### 2026-07-01

- Maintenance pass: re-verified end-to-end on live data and confirmed successful runs within the 5-minute quality window on the default input.
- Sharpened Store metadata (SEO title & description) and expanded the FAQ with high-intent, long-tail questions for easier discovery in Google and Apify Store search.
- Added ready-to-run example tasks that cover common real-world use cases.

#### 2026-06-15

- Reliability pass: re-verified end-to-end on live data with real-world inputs. Routine maintenance build.

#### 2026-06-07

- Docs: added coverage for using this as a UN Comtrade API alternative, scraping without an API key, and exporting trade data to CSV/JSON.

#### 2026-06-05

- 🛡️ Reliability fix: results are no longer dropped by strict output validation — runs now complete cleanly even at high volume (thousands of results).
- ⚡ Stability & performance hardening; fresh rebuild.

#### 2026-06-04

- Verified live & refreshed build — reliability/maintenance pass.

***

\*Maintained: last verified 2026-11-11 — checked end-to-end against live run history (reliability, output fields and types, and time/memory budgets).

# Changelog

This Actor's version history is a separate document: https://apify.com/logiover/comtrade-trade-data-scraper/changelog.md

# Actor input Schema

## `reporters` (type: `string`):

The reporting country whose trade is measured. Pick from the list, or leave the default (USA). Advanced: you can also type comma-separated M49 codes (e.g. '842,276') or 'all'.

## `partners` (type: `string`):

The trading partner. 'World' = all partners combined (the standard broad view). Pick a specific country for a bilateral flow. Advanced: comma-separated M49 codes or 'all'.

## `flow` (type: `string`):

Import, export, or both.

## `commodities` (type: `string`):

HS commodity coverage. Pick an aggregation level, or type specific HS codes (comma-separated, e.g. '8703,8517').

## `periods` (type: `string`):

Reporting year for annual data. Leave blank to default to the most recent complete year. For monthly, set Frequency = Monthly and type e.g. '202301-202312'. Advanced: comma list '2022,2023' or range '2020-2023'.

## `frequency` (type: `string`):

Annual or monthly data.

## `maxResults` (type: `integer`):

Maximum trade records to save. Keeps broad queries (all countries / all partners) fast and cheap; raise to pull more.

## `throttleMs` (type: `integer`):

Delay between API calls. UN Comtrade keyless tier rate-limits ~1 req/sec — keep >= 1100.

## `proxyConfiguration` (type: `object`):

Apify Proxy (automatic IP rotation) is on by default. This actor also falls back to a direct connection on its final retry.

## Actor input object example

```json
{
  "reporters": "842",
  "partners": "0",
  "flow": "both",
  "commodities": "AG2",
  "periods": "",
  "frequency": "A",
  "maxResults": 285,
  "throttleMs": 1100,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `results` (type: `string`):

All records extracted by this run. Open the Dataset tab to browse, filter, and export as CSV, JSON, or Excel.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "maxResults": 285
};

// Run the Actor and wait for it to finish
const run = await client.actor("logiover/comtrade-trade-data-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "maxResults": 285 }

# Run the Actor and wait for it to finish
run = client.actor("logiover/comtrade-trade-data-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "maxResults": 285
}' |
apify call logiover/comtrade-trade-data-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,logiover/comtrade-trade-data-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/faGyKGJKgrgaRQy29/builds/O9wCoX5DhGBQBySca/openapi.json
