Skip to main content

langchain-decodo

LangChain partner package for the Decodo web scraping API.

Provides two LangChain tools and a document loader that let LLM agents and RAG pipelines fetch live web content without managing proxies, JavaScript rendering, or anti-bot protection.

Installation

pip install langchain-decodo

Authentication

All classes read your Decodo API token from the DECODO_API_TOKEN environment variable, or you can pass it explicitly.

export DECODO_API_TOKEN="your-decodo-api-token"

Get a token from the Decodo Dashboard.

Components

DecodoWebScrapeTool

Scrape any URL and return its full content as markdown or plain text. Handles JavaScript rendering, CAPTCHAs, and geo-blocking automatically.

from langchain_decodo import DecodoWebScrapeTool

tool = DecodoWebScrapeTool()  # reads DECODO_API_TOKEN from env
content = tool.run("https://example.com")
print(content)

Pass explicitly:

from pydantic import SecretStr
from langchain_decodo import DecodoWebScrapeTool

tool = DecodoWebScrapeTool(decodo_api_token=SecretStr("YOUR_TOKEN"))

DecodoSearchTool

Search Google, Amazon, or Reddit and return structured JSON results.

from langchain_decodo import DecodoSearchTool

tool = DecodoSearchTool()

# Google search (default)
results = tool.run({"query": "LangChain latest release", "engine": "google"})

# Amazon product search
results = tool.run({"query": "Python programming book", "engine": "amazon"})

# Reddit discussion search
results = tool.run({"query": "best web scraping libraries", "engine": "reddit"})

Returns a JSON string — a list of objects with content, url, and status_code fields.

Supported engines:

engine Decodo target Description
google google_search Google SERP
amazon amazon_search Amazon product search
reddit google_search + site:reddit.com Reddit via Google

DecodoLoader

Load one or more URLs as LangChain Document objects for use in RAG pipelines.

from langchain_decodo import DecodoLoader

loader = DecodoLoader(
    urls=[
        "https://python.org/about/",
        "https://docs.python.org/3/whatsnew/3.12.html",
    ],
)
docs = loader.load()

for doc in docs:
    print(doc.metadata["url"], "—", len(doc.page_content), "chars")

Each Document has:

  • page_content — scraped text/markdown.
  • metadata["url"] — the source URL.
  • metadata["source"] — same as url (LangChain convention).
  • metadata["status_code"] — HTTP status from the target site.

LangChain agent example

from langchain import hub
from langchain.agents import AgentExecutor, create_react_agent
from langchain_openai import ChatOpenAI
from langchain_decodo import DecodoWebScrapeTool, DecodoSearchTool

tools = [DecodoWebScrapeTool(), DecodoSearchTool()]
llm = ChatOpenAI(model="gpt-4o-mini", temperature=0)
prompt = hub.pull("hwchase17/react")

agent = create_react_agent(llm=llm, tools=tools, prompt=prompt)
executor = AgentExecutor(agent=agent, tools=tools, verbose=True)

result = executor.invoke({
    "input": "What is the latest stable version of Python? Check python.org."
})
print(result["output"])

RAG pipeline example

from langchain.text_splitter import RecursiveCharacterTextSplitter
from langchain_community.vectorstores import FAISS
from langchain_openai import ChatOpenAI, OpenAIEmbeddings
from langchain.chains import RetrievalQA
from langchain_decodo import DecodoLoader

loader = DecodoLoader(urls=["https://python.org/about/"])
docs = loader.load()

splitter = RecursiveCharacterTextSplitter(chunk_size=1000, chunk_overlap=200)
chunks = splitter.split_documents(docs)

store = FAISS.from_documents(chunks, OpenAIEmbeddings())
chain = RetrievalQA.from_chain_type(
    llm=ChatOpenAI(model="gpt-4o-mini"),
    retriever=store.as_retriever(search_kwargs={"k": 4}),
)

result = chain.invoke({"query": "What is Python used for?"})
print(result["result"])

Metadata

Release files for langchain-decodo 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for langchain-decodo 0.1.0
File Size Uploaded
langchain_decodo-0.1.0.tar.gz 174.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for langchain-decodo 0.1.0
File Interpreter ABI Platform
langchain_decodo-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 186.6 kB

Release files / langchain_decodo-0.1.0.tar.gz

Download URL langchain_decodo-0.1.0.tar.gz
Size 174.8 kB
Tags Source
SHA-256 checksum
How to use checksums
16ed5d2bd58889ebd46ae780c4b129097df2997396a8b29ee9ad8220dc8b5c68
BLAKE2b-256 checksum
How to use checksums
505cc6d66dc0c6ac8aedebf20229d2ca1c2d793c6f4cb45ce54bb49890078a6a
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 1, 2026.

Transparency log

Release files / langchain_decodo-0.1.0-py3-none-any.whl

Download URL langchain_decodo-0.1.0-py3-none-any.whl
Size 11.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2effb4fa2c926eced43a89636333df2b564208040bbaa838280d3c1319a8d669
BLAKE2b-256 checksum
How to use checksums
0fc41082dd70f42a87aba35e337a8a52a8901599db43923dc181acad4a7ecb5d
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 1, 2026.

Transparency log

Release history Release notifications | RSS feed

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page