Skip to main content
The langchain-context package exposes Context.dev operations as LangChain BaseTool classes. Use individual tools directly or give an agent a focused toolkit for live web research, scraping, crawling, extraction, document parsing, brand intelligence, monitors, and batch jobs.

View Context.dev for LangChain

Inspect the package source, examples, tests, and releases.

Prerequisites

Install and configure

1

Install the package

2

Set your API key

Copy a secret key from the Context.dev dashboard, then set it in your server environment:
Tools read CONTEXT_API_KEY automatically. You can also pass api_key to a tool or toolkit when your application already manages secrets securely.
Keep CONTEXT_API_KEY in your server environment. Do not commit it or expose it in browser code.

Use a tool directly

Every Context.dev operation supports LangChain’s synchronous invoke interface:
To read a YouTube video, pass its URL to ContextScrape. The returned Markdown includes the timestamped transcript when one is available.

Give tools to an agent

ContextToolkit is safe by default: it includes read operations and removes browser actions from scraping tools. Pass its result to any LangChain agent that accepts a list of tools.
Choose only the groups the agent needs: Use a focused toolkit when you do not need every group:

Enable side effects explicitly

Monitor and batch mutations are excluded unless you opt in. Browser actions are also removed from scraping tools by default.
Enable these options only for an agent that should create, update, run, cancel, or delete Context.dev resources or interact with third-party webpages.

Use async tools

Every tool also supports LangChain’s asynchronous ainvoke interface:

Troubleshooting

Reference

PyPI package

Install the current release and review its Python requirements.

Package source

Read the complete tool catalog, examples, and test suite.

LangChain tools

Learn how tools are defined, invoked, and attached to agents.

Context.dev API reference

Review the underlying API operations and request schemas.