comtrade-trade
Query UN Comtrade bilateral trade flows (USD, kg) for critical minerals by HS code, country, and year
Skill by lamm-mit
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/lamm-mit-comtrade-trade
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
- Runs as
- Python package
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/comtrade-trade
What's inside
- Skill name
comtrade-trade- Description
- Query UN Comtrade bilateral trade flows (USD, kg) for critical minerals by HS code, country, and year
- License
- Apache-2.0
- Instructions
- 80 lines in SKILL.md · view on GitHub
Before installing
- Ships executable scripts
Files (2)
- SKILL.md
- comtrade_query.py · scripts/
SKILL.md (first lines)
# UN Comtrade Trade Data
Query UN Comtrade for bilateral trade flows of critical minerals. Returns trade values (USD), net weight (kg), and flow direction (imports/exports) by HS commodity code, reporter country, partner country, and year.
## Usage
### Search by mineral name:
```bash
python3 {baseDir}/scripts/comtrade_query.py --mineral lithium
```
### Search by HS code:
```bash
python3 {baseDir}/scripts/comtrade_query.py --hs-code 282520 --reporter 842
```
### Filter by country and flow:
```bash
python3 {baseDir}/scripts/comtrade_query.py --mineral cobalt --reporter 842 --flow X --year 2022
```
### JSON output:
```bash
python3 {baseDir}/scripts/comtrade_query.py --mineral rare_earth --format json --year 2023
```
## Parameters
| Parameter | Description | Default |
|-----------|-------------|---------|
| `--mineral` | Critical mineral name (lithium, cobalt, rare_earth, graphite, nickel, manganese, gallium, germanium, copper, hree, lree) | - |
| `--hs-code` | HS commodity code (alternative to --mineral) | - |
| `--reporter` | Reporter country code (e.g., 842 for USA, 156 for China) | 0 (all) |
| `--partner` | Partner country code | 0 (world) |
| `--flow` | Trade flow: M (imports), X (exports), M,X (both) | M,X |
| `--year` | Year(s), comma-separated | 2023 |
| `--limit` | Maximum records to return | 500 |
| `--format` | Output format: summary, detailed, json | summary |
## Available Minerals
| Name | HS Codes | Description |
|------|----------|-------------|
| `lithium` | 253090, 282520, 283691, 850650 | Ores, oxide/hydroxide, carbonate, batteries |
| `cobalt` | 2605, 282200, 810520, 810590 | Ores, oxides, unwrought, articles |
| `rare_earth` | 2846, 280530 | REE compounds, REE metals |
| `hree` | 284690 | Heavy REE compounds |
| `lree` | 284610 | Light REE compounds |
| `graphite` | 250410, 250490, 380110 | Natural (amorphous, crystalline), artificial |
| `nickel` | 2604, 7501, 750210, 750220, 281122 | Ores, matte, unwrought, alloys, oxides |
| `manganese` | 2602, 811100 | Ores, unwrought |
| `gallium` | 811292 | Unwrought |
| `germanium` | 811299 | Other base metals |
| `copper` | 7402, 7403 | Refined, unrefined |
## Examples
```bash
# US lithium imports
python3 {baseDir}/scripts/comtrade_query.py --mineral lithium --reporter 842 --flow M --year 2023
# Global cobalt trade flows
python3 {baseDir}/scripts/comtrade_query.py --mineral cobalt --format detailed
# China rare earth exports
python3 {baseDir}/scripts/comtrade_query.py --mineral rare_earth --reporter 156 --flow X --year 2022
# Nickel trade by specific HS code
python3 {baseDir}/scripts/comtrade_query.py --hs-code 2604 --format json
```
## Notes
- Requires `UNCOMTRADE_API_KEY` environment variable
- Country codes follow UN M49 standard (842=USA, 156=China, 276=Germany, etc.)
- Use 0 for "all countries" or "world"
- HS codes follow Harmonized System classification
- API has rate limits; be conservative with large queriesFrom lamm-mit/scienceclaw, Apache-2.0.
More from lamm-mit/scienceclaw
- 0.516score
drugbank-database
lamm-mit
Access and analyze comprehensive drug information from the DrugBank database including drug properties, interactions, targets, pathways, chemical structures…
SkillCFreshness: C★ 250Claude Code +9 - 0.516score
geometry-generator
lamm-mit
Generate parametric bioinspired ribbed membrane STL geometry via LLM-guided design.
SkillCFreshness: C★ 250Claude Code +9 - 0.516score
disease-research
lamm-mit
Generate comprehensive disease research reports using 100+ ToolUniverse tools.
SkillCFreshness: C★ 250Claude Code +9 - 0.516score
drug-research
lamm-mit
Generates comprehensive drug research reports with compound disambiguation, evidence grading, and mandatory completeness sections.
SkillCFreshness: C★ 250Claude Code +9 - 0.516score
fem-analysis
lamm-mit
Modal analysis of a membrane STL using Kirchhoff plate FEM (scipy eigensolver).
SkillCFreshness: C★ 250Claude Code +9 - 0.516score
generate-image
lamm-mit
Generate or edit images using AI models (FLUX, Gemini).
SkillCFreshness: C★ 250Claude Code +9 - 0.516score
ase
lamm-mit
Atomic Simulation Environment (ASE) for computational materials science.
SkillCFreshness: C★ 250Claude Code +9 - 0.516score
askcos
lamm-mit
Retrosynthetic template relevance prediction using a locally deployed ASKCOS TorchServe service.
SkillCFreshness: C★ 250Claude Code +9 - 0.516score
pylabrobot
lamm-mit
Vendor-agnostic lab automation framework.
SkillCFreshness: C★ 250Claude Code +9 - 0.516score
biorxiv-database
lamm-mit
Efficient database search tool for bioRxiv preprint server.
SkillCFreshness: C★ 250Claude Code +9 - 0.516score
esm
lamm-mit
Comprehensive toolkit for protein language models including ESM3 (generative multimodal protein design across sequence, structure, and function) and ESM C…
SkillCFreshness: C★ 250Claude Code +9 - 0.516score
jax-modal-analysis
lamm-mit
3D tetrahedral FEM modal analysis of a membrane STL.
SkillCFreshness: C★ 250Claude Code +9
Signals
- Stars
- 250
- Forks
- 47
- Open issues
- 1
- Last commit (this folder)
- Feb 22, 2026 (8 months ago)
- Last release
- Jun 23, 2026 (4 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- Apache-2.0
- Repository
- github.com/lamm-mit/scienceclaw
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from lamm-mit
- 0.516score
biorxiv-database
lamm-mit
Efficient database search tool for bioRxiv preprint server.
SkillCFreshness: C★ 250Claude Code +9 - 0.516score
disease-research
lamm-mit
Generate comprehensive disease research reports using 100+ ToolUniverse tools.
SkillCFreshness: C★ 250Claude Code +9 - 0.516score
askcos
lamm-mit
Retrosynthetic template relevance prediction using a locally deployed ASKCOS TorchServe service.
SkillCFreshness: C★ 250Claude Code +9 - 0.516score
ase
lamm-mit
Atomic Simulation Environment (ASE) for computational materials science.
SkillCFreshness: C★ 250Claude Code +9 - 0.516score
pylabrobot
lamm-mit
Vendor-agnostic lab automation framework.
SkillCFreshness: C★ 250Claude Code +9 - 0.516score
drug-research
lamm-mit
Generates comprehensive drug research reports with compound disambiguation, evidence grading, and mandatory completeness sections.
SkillCFreshness: C★ 250Claude Code +9
Cite this page
comtrade-trade skill. Agent Mart. https://agentmart.dev/skills/lamm-mit-comtrade-trade (last updated 2026-10-24)