llama-index-tools-decodo
A LlamaIndex tool spec that wraps the Decodo web scraping API, exposing four tools for LlamaIndex agents: scrape_url, search_web, search_amazon, and search_reddit.
Decodo handles JavaScript rendering, anti-bot measures, CAPTCHA, and proxy rotation so your agent can reliably extract content from any page.
Installation
pip install llama-index-tools-decodo
Authentication
Copy 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 (see below).
Set it as an environment variable:
export DECODO_API_TOKEN="your-api-key"
Or pass it directly to the constructor.
Auth modes
auth_mode |
Encoding | Endpoint |
|---|---|---|
"basic" (default) |
base64("token:") |
POST https://scraper-api.decodo.com/v2/scrape |
"token" |
plain token | POST https://data.decodo.com/v1/scrape |
"basic" sends Authorization: Basic <token>; "token" sends Authorization: Bearer <token>.
Use "token" with your API key and "basic" only with a basic authentication token from an older
plan. A credential used in the wrong mode is rejected with a 401.
All tools request markdown output.
Quick start
from llama_index.tools.decodo import DecodoToolSpec
# Uses DECODO_API_TOKEN from environment
spec = DecodoToolSpec(auth_mode="token")
tools = spec.to_tool_list()
Use with a ReAct agent:
import asyncio
from llama_index.core.agent.workflow import ReActAgent
from llama_index.llms.openai import OpenAI
from llama_index.tools.decodo import DecodoToolSpec
spec = DecodoToolSpec(auth_mode="token")
tools = spec.to_tool_list()
agent = ReActAgent(tools=tools, llm=OpenAI(model="gpt-4o"))
async def main() -> None:
response = await agent.run("Summarise the homepage of https://news.ycombinator.com")
print(response)
asyncio.run(main())
Tool reference
scrape_url(url)
Scrape any web page and return its content as markdown.
spec = DecodoToolSpec(api_token="your-api-key", auth_mode="token")
content = spec.scrape_url("https://news.ycombinator.com")
print(content)
search_web(query, num_results=10)
Search Google and return a list of results, each with url, content, and status_code.
results = spec.search_web("latest AI research papers", num_results=5)
for r in results:
print(r["url"], r["content"][:200])
search_amazon(query, num_results=10)
Search Amazon product listings.
results = spec.search_amazon("noise cancelling headphones", num_results=5)
for r in results:
print(r["url"], r["content"][:200])
search_reddit(query, num_results=10)
Search Reddit via Google with a site:reddit.com filter.
results = spec.search_reddit("best Python async libraries", num_results=5)
for r in results:
print(r["url"], r["content"][:200])
Errors
All tools raise RuntimeError on an HTTP error from the API. search_web, search_amazon and
search_reddit also raise it when Decodo returns no results or only failed ones (for example
status 613, "We were not able to scrape the target"), so an agent can retry instead of reading
an empty list as "no results".
Auth mode examples
# API key
spec = DecodoToolSpec(api_token="your-api-key", auth_mode="token")
# Basic auth token (older plans, default)
spec = DecodoToolSpec(api_token="your-basic-auth-token", auth_mode="basic")
# Custom timeout (seconds)
spec = DecodoToolSpec(api_token="your-api-key", auth_mode="token", timeout=300.0)
License
MIT
Metadata
Release files for llama-index-tools-decodo 0.1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| llama_index_tools_decodo-0.1.5.tar.gz | 8.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| llama_index_tools_decodo-0.1.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 14.9 kB
Release files / llama_index_tools_decodo-0.1.5.tar.gz
| Download URL | llama_index_tools_decodo-0.1.5.tar.gz |
|---|---|
| Size | 8.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4f96053ab135b448377efe0141d0dc38e956977a1bd835a20c99aeee5c13a1cb
|
|
BLAKE2b-256 checksum How to use checksums |
b4568076cbf0e50dabad5fa00b84634a988d02e131068b8a4c30131f1cf715b5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.
Transparency logRelease files / llama_index_tools_decodo-0.1.5-py3-none-any.whl
| Download URL | llama_index_tools_decodo-0.1.5-py3-none-any.whl |
|---|---|
| Size | 6.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ed57bc84f9ed471e0d0277125a78a5ddbe1b8abaf3f43c2b268cdb43291fadbe
|
|
BLAKE2b-256 checksum How to use checksums |
97f91616aa652095d6ab9804737e091ae097d6748d66c03185922ef1b9174fab
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.
Transparency log