View the CLI GitHub repository for the latest installation instructions, examples, and source code.
@decodo/cli) is an open-source command-line interface for the Decodo APIs. Scrape, search, map, and crawl from your terminal without writing HTTP client code, building custom parsers, or managing proxies.
- Structured output in JSON, NDJSON, Markdown, and PNG screenshots
- Server-side JavaScript rendering, anti-bot bypass, and CAPTCHA handling
- 115M+ residential IPs across 195+ locations
- Pipe-friendly for
jq, CI/CD, and coding agents
What is the Decodo CLI?
The Decodo CLI wraps every Web Scraping API target as a subcommand and adds shell-native output modes for scripting, automation, and AI agent workflows. It’s built with Node.js and TypeScript and is MIT-licensed. It provides a single command-line interface for accessing web data without maintaining scraping infrastructure yourself.Why use the CLI?
Use the CLI when you need web scraping outside an IDE or MCP client:- Scripts and CI/CD – run scrapes in shell scripts, cron jobs, GitHub Actions, and pipelines.
- Shell pipelines – pipe JSON or NDJSON output to
jq,grep, databases, or custom tools. - Coding agents – invoke scraping as a subprocess from Cursor, Claude Code, Codex, Gemini CLI, or Windsurf.
- Quick terminal access – scrape websites, search the web, or capture screenshots with a single command.
Key features
- Web scraping from the terminal. Scrape websites, including JavaScript-heavy pages, without managing proxy rotation, JavaScript rendering, anti-bot handling, or CAPTCHA solving yourself.
- Structured output for automation. Markdown (human-readable), JSON and NDJSON (pipe-friendly), and PNG screenshots built for scripts, data pipelines, and AI agent subprocesses.
- Built-in support for popular targets. Tier-1 commands for scrape, search, map, crawl, and screenshot, plus schema-driven subcommands for Google Search and Bing, Amazon, Walmart, and Target, TikTok, YouTube, and more. Run
decodo targetsto list everything available. - Global proxy infrastructure. 115M+ residential IPs across 195+ locations with IP rotation and geo-targeting, backed by the Web Scraping API’s 99.99% success rate.
- Pipe-friendly by design. Compact JSON when piped, human-readable output in a TTY, and explicit exit codes for authentication, validation, rate limit, and API errors.
- Quick setup. Install with one command, or use
npxwithout installing the CLI globally.
Use cases
- Shell scripts and CI/CD – scrape or search in pipelines without embedding SDK logic.
- Data pipelines – stream NDJSON results into
jq, databases, or downstream tools. - Coding agent subprocesses – let AI agents call
decodo searchordecodo scrapedirectly. - eCommerce intelligence – query Amazon, Walmart, and Target from the terminal.
- Social media data collection – gather posts and metadata from TikTok and YouTube.
- SERP monitoring – search Google and Bing with geo-targeting and parsed output.
Quick start
- Create a free account at dashboard.decodo.com – up to 10K free requests, no credit card required.
- Get your Web Data API key from your Web Data API subscription on the Decodo dashboard. Older plans only have a basic authentication token, which also works.
- Install Node.js 22+ from nodejs.org (required for npm or
npx). - Install the CLI using one of the methods below.
- Authenticate and run your first scrape:
Installation
Requires Node.js 22 or later. The install script stops with
Node.js v<version> found, but v22+ is required. on anything older.macOS / Linux (recommended)
Windows (PowerShell)
npm (any platform)
Run without installing
Authentication
Use the Web Data API key from your subscription on the Decodo dashboard. Older plans only have a basic authentication token, which works the same way - the CLI detects which one you provide, so every command below takes either.--token flag → DECODO_AUTH_TOKEN env var → saved config (decodo setup).
Test your setup
Once installed and authenticated, try:Commands
Tier-1 commands
Global flags:
-V, --version, -v, --verbose, and --token <token>.
Search, map, and crawl
These three call the Web Data API and need an API key (see Authentication).decodo crawl <url> returns right away with the crawl id. Manage a running crawl with:
crawl results --wait lets an agent start a crawl, keep working, and collect the pages later. With --wait, the CLI polls every --poll-interval seconds (default 5) and gives up after --timeout seconds (default 3600, exit code 6) - the crawl keeps running until you cancel it. The crawl id goes to stderr as soon as the crawl starts. A truncated or cancelled crawl prints a warning; a faulted crawl still prints its pages, then exits 7.
Upgrading from 1.x:
decodo search used to run the google_search scrape target and accepted --engine and --limit. It now calls the Web Data API and takes --geo, --locale, and --page only - passing --engine or --limit is a usage error (exit code 2). For the previous behaviour, use decodo google-search or decodo bing-search.Schema-driven target commands
Every API target is also available as its own subcommand using the kebab-case name shown bydecodo targets:
decodo <target> --help for target-specific flags (--parse, --geo, and others from the schema).
Output modes
By default, scrape commands print the first result’scontent (parsed JSON when the target supports --parse, Markdown for decodo scrape).
- TTY vs. pipe: When stdout is a terminal, the CLI uses human-readable output where possible. When output is piped or redirected, it writes raw bytes or compact JSON. Screenshots must be written to a file with
-oor redirected because binary PNG output isn’t written directly to a TTY. - NDJSON output: With
--format ndjson, stdout contains one JSON object per API result. Without--full, each line contains the result’scontent; with--full, each line contains the complete result entry (content,status_code,url). There is no envelope-level.results[]on a single line - pipe each line throughjqindividually.
Examples
Pipe-friendly workflows
decodo scrape returns Markdown, and the Markdown converter escapes underscores - so zip_code arrives as zip\_code. That is an invalid JSON escape, and piping it to jq fails with parse error: Invalid escape. When the target is a JSON endpoint, use decodo universal <url> --no-markdown instead.Scraping geo-restricted content
decodo <target> --help for all geo, locale, and target-specific options from the API schema.
Agent tooling
The Decodo CLI can also be used in AI agent and agentic workflows. Coding agents such as Cursor, Claude Code, Codex, Gemini CLI, and Windsurf can invoke the CLI as a shell subprocess instead of embedding scraping logic. Recommended patterns:- Require
DECODO_AUTH_TOKENor rundecodo setupbefore scraping. Use an API key if the agent needssearch,map, orcrawl. - Prefer
--format ndjson --fullwhen parsing multiple results programmatically. - Use
decodo targetsto discover available target commands. - Use
decodo <target> --helpfor schema-accurate flags. - Check exit codes to distinguish authentication, usage, and API errors.
MCP vs. CLI: when to use which
Use the CLI when your agent needs to scrape from a shell, terminal, CI/CD pipeline, or subprocess. For IDE-based agent scraping using the Model Context Protocol, see the MCP Server.Environment variables
| Variable | Description |
|---|---|
DECODO_AUTH_TOKEN | API key or basic authentication token. Takes precedence over saved config but is overridden by --token. |
DECODO_CONFIG_HOME | Override config directory. Defaults to $XDG_CONFIG_HOME/decodo, or ~/.config/decodo if $XDG_CONFIG_HOME isn’t set. |
Exit codes
Troubleshooting
-
No API key or auth token found.Rundecodo setupor exportDECODO_AUTH_TOKEN. -
This command needs a Web Data API key; a basic auth token cannot call it.You ransearch,map, orcrawlwith a basic authentication token. Get an API key from the Web Data API playground and rerundecodo setup. -
command not found: decodo. The install script configures yourPATHautomatically. Ifdecodostill isn’t available, restart your terminal or rerun the install script. You can also usenpx @decodo/cli. -
Validation or API errors. Read the
Error:message on stderr. Use--fullto inspect the raw API response. -
Screenshot TTY error. Use
-o shot.pngor redirect:decodo screenshot <url> > shot.png.
Related
- MCP Server – Use Decodo with MCP-compatible AI tools and IDEs.
- TypeScript SDK – Integrate the Decodo APIs into TypeScript and JavaScript projects.
- Python SDK – Integrate the Decodo APIs into Python projects.
- Agent Skills – Teach supported coding agents when and how to use Decodo.
- pobear – Open-source Go binary that scrapes directly and escalates to the Web Data API only when a request is blocked.
- GitHub repository – View the CLI source code, examples, and latest releases.
Support
Need help or just want to say hello? Our support is available 24/7.
You can also reach us anytime via email at support@decodo.com.
You can also reach us anytime via email at support@decodo.com.
Feedback
Can’t find what you’re looking for? Request an article!
Have feedback? Share your thoughts on how we can improve.
Have feedback? Share your thoughts on how we can improve.