Use the CoinMarketCap CLI when you want stable, shell-native access to CoinMarketCap data for scripts, automation, and terminal workflows.
When to use CMC CLI
- Choose CMC CLI when you want terminal-native workflows, machine-readable output, CSV export, and repeatable commands that fit well into shell scripts or agent runs.
Prerequisites
- A CoinMarketCap API key from pro.coinmarketcap.com
- A supported install path such as Homebrew or the shell installer
- Optional:
jqif you want to inspect JSON examples in the terminal
Install and authenticate
-
Install CMC CLI
Use the install path that best fits your environment:
CodeOr use the shell installer:
Code -
Authenticate
The simplest path is interactive auth:
CodeFor automation or ephemeral environments, you can also use environment variables:
Code -
Verify the setup
Check the active config and then fetch a live quote:
Code
Quick start
Use these commands to see the CLI value quickly:
Code
What you can do
| Need | Use | Notes |
|---|---|---|
| Exact asset lookup | resolve | Prefer --id or --slug when determinism matters. |
| Quotes and enrichments | price | Add --with-info or --with-chain-stats when you need more context. |
| Search and discovery | search | Works for name, symbol, and chain-scoped address discovery. |
| Market scans | markets, metrics, pairs | Good for list views, rankings, and broader market context. |
| Time series | history | Supports daily plus selected paid-plan intervals. |
| Trends and content | trending, top-gainers-losers, news | Useful for narratives, movers, and recent coverage. |
| Live monitoring | monitor | Polling only, not websocket streaming. |
| Interactive inspection | tui | Built for human terminal workflows rather than scripting. |
Output and automation
- Most data commands default to compact JSON.
- Use
-o tablewhen you want human-readable terminal output. - Use
--dry-runon data commands to preview the upstream request without sending it. - Selected commands support CSV export when you want a file artifact instead of JSON.
- For deterministic automation, resolve once and reuse canonical IDs downstream.
Code
Interactive terminal workflows
The CLI also supports terminal-native monitoring and TUI flows:
Code
Use these for live human inspection. For scripts, automation, or agent runs, prefer the non-interactive data commands.
Notes
- Prefer explicit IDs or slugs over shorthand symbols in high-trust workflows.
- Historical hourly and 5-minute intervals may require a paid CoinMarketCap plan.
monitoris polling-based, not streaming.