Skip to main content
The context.dev package requires Python 3.9 or later. SDKs covers the API key and the defaults all SDKs share.

Install

Create a virtual environment, then install the SDK:

Scrape a page

Save this as scrape.py and run python scrape.py. It prints the page as Markdown, starting with # Example Domain.
scrape.py

Look up a brand

Replace the request and the print line with this lookup. It prints the company name.

Notes

  • Methods and parameters use snake_case. Nested parameters are dictionaries with snake_case keys, such as shared_params={"main_content_only": True}.
  • Set timeout in seconds and max_retries on the client: ContextDev(timeout=120.0, max_retries=0).
  • AsyncContextDev has the same methods for asyncio code.