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 Web Scraping API. Scrape and search 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, and screenshot, plus schema-driven subcommands for Google Search, Bing, Amazon, Walmart, Target, Reddit, 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 Reddit, 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 2K free requests, no credit card required.
- Get your Web Scraping API Basic Auth token from the Decodo dashboard.
- Install Node.js 18+ 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 18 or later.
macOS / Linux (recommended)
Windows (PowerShell)
npm (any platform)
Run without installing
Authentication
Get your Basic Auth token from the Decodo dashboard.--token flag → DECODO_AUTH_TOKEN env var → saved config (decodo setup).
Test your setup
Once installed and authenticated, try:Commands
Tier-1 commands
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. Process each line individually with tools such asjq.
Examples
Pipe-friendly workflows
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. - 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 | Basic Auth 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 auth token found. Rundecodo setupor exportDECODO_AUTH_TOKEN. -
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 Web Scraping API into TypeScript and JavaScript projects.
- Agent Skills – Teach supported coding agents when and how to use Decodo.
- 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.