More information can be found on GitHub here.
Building in Python? See LangChain (Python), which also includes a document loader for RAG pipelines.
Features
- Web scraping – scrape any URL and retrieve Markdown content
- Google Search – search Google and retrieve structured results
- Amazon Search – search Amazon and retrieve structured product data
- Web search – search the web and retrieve ranked results
- Site mapping – list the URLs on a website without fetching their content
- Crawling – crawl a website and retrieve the content of every page found
- Full TypeScript support – complete type definitions for all parameters
- LangChain integration – seamless integration with LangChain’s tool system
Quick start
Prerequisites
- Node.js >= v20
- A Decodo Web Data API subscription
Running the bundled samples
- Clone the repo and install dependencies
- Copy
.env.exampleto.envand fill inSCRAPER_API_KEY. On an older plan, fill inSCRAPER_API_USERNAMEandSCRAPER_API_PASSWORDinstead. The examples also readOPENAI_API_KEY.
- Run any of the samples
Available tools
The tools fall into two groups, which differ in how they authenticate and what input they take:
- Scrape tools –
DecodoUniversalTool,DecodoGoogleSearchToolandDecodoAmazonSearchTool. They share one input schema and accept either credential type. - Data API tools –
DecodoSearchTool,DecodoMapTool,DecodoCrawlToolandDecodoCrawlCancelTool. Each has its own input schema, and all four require an API key.
Configuration
The scrape tools accept aDecodoConfig object holding either an API key (recommended) or, for older plans, a username and password:
It is one or the other. Passing both throws
Decodo config accepts either apiKey or username and password, not both. Passing neither – or a username without a password – throws Decodo config requires either an apiKey or both a username and a password.{ apiKey }. Constructing one with a username and password throws <ToolName> requires an apiKey. Username and password credentials cannot call it.
Under the hood the tools wrap the Decodo TypeScript SDK.
Parameters
Parameter names are camelCase –jsRender, not JsRender.
Scrape tools
decodo_universal_tool, decodo_google_search and decodo_amazon_search share one input schema.
Values fixed by each tool
Each tool sets some parameters itself, after your input, so a value you pass for one of these is overwritten:
In other words,
decodo_universal_tool always returns Markdown, and the two search tools always return parsed results without JavaScript rendering.
For the full list of API parameters, see Parameters.
decodo_search
Results carry a title, link and description. To read a result, scrape its link with
decodo_universal_tool.
decodo_map and decodo_crawl
Both tools start from a URL and discover pages from there, so they share these parameters:
decodo_map adds:
decodo_crawl adds:
decodo_crawl_cancel
Crawl behaviour
DecodoCrawlTool waits until the crawl finishes. It returns the crawl’s status, reason and discovered, completed and failed page counts, along with each page’s url and content, or content_error when a page failed.
By default the tool checks the crawl every 5 seconds and waits up to 10 minutes for it to finish. Fetching the pages of a finished crawl comes on top of that. Pass pollInterval and timeout in milliseconds to change either:
max_duration, so a crawl the tool stops waiting for is stopped on Decodo’s side at the same limit, and the tool’s error says so. Decodo rejects a max_duration above 4 hours, so a longer timeout leaves the server default in place.
If a timeout above 4 hours runs out, the crawl keeps running on Decodo’s side. The error carries the crawl id, so register DecodoCrawlCancelTool alongside DecodoCrawlTool to let the agent stop it.
Error handling
API errors are rethrown asError('Decodo API error: ...') with the SDK’s error as cause, so its statusCode is still available.
A crawl timeout is a TimeoutError, which the package re-exports from the SDK so you can check it with instanceof:
Decodo search failed: ... with the failed response, including its status_code, as cause.
Related
- TypeScript SDK – The SDK these tools are built on.
- LangChain (Python) – The Python LangChain package.
- MCP Server – Connect AI agents and MCP-compatible tools to Decodo.
- CLI – Run Decodo scraping workflows from the command line.
- GitHub repository – View the 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.