Overview
The CoinPaprika CLI is designed for automation and scripting. This guide covers using JSON output, the--raw flag, piping, and scripting patterns in Bash and Python.
JSON Output
Basic JSON Output
Use--output json to get structured JSON responses:
Raw JSON Output
Use--raw to get only the data without the metadata wrapper:
--raw:
- Piping to
jqor other JSON processors - Storing data in databases
- Feeding data to other programs
- When you don’t need attribution metadata
--raw flag is defined in src/main.rs:38-39 and controls whether print_json_wrapped adds the metadata wrapper (src/output/mod.rs:111-119).
Piping with jq
Extract Specific Fields
Filter Arrays
Format as CSV
Bash Scripting
Price Alert Script
Multi-Coin Price Tracker
Market Summary Report
Python Scripting
Basic Price Fetcher
Portfolio Tracker
Price Change Monitor
Error Handling in Scripts
Bash Error Handling
Python Error Handling
Performance Tips
- Use
--rawfor scripting — it reduces JSON parsing overhead and makes piping easier - Cache responses — avoid hitting the API repeatedly for the same data
- Use
--limit— fetch only the data you need - Batch requests — if possible, use endpoints that return multiple items (like
tickers) instead of looping over individual requests - Respect rate limits — free tier allows 20,000 calls/month; add delays between requests in loops
Exit Codes
The CLI returns standard exit codes:0— Success1— Error (API error, invalid arguments, etc.)