Skip to main content

For AI agents: docs.octen.ai/integrations/python-sdk.md

Get API Key

Create a key from the API Platform.

PyPI

The octen package.

Install

Requires Python 3.8+.

Quick Start

Search results are plain dicts with the same field names as the API reference. Use r.get("highlight") for fields that may be missing. Decompose a query into sub-queries, search them concurrently, and get results grouped per sub-query. Best for comparisons, surveys, and multi-angle questions.
Search the live web and get ranked results with model-ready highlights and optional full content. Best for search bars, answer engines, and news lookup.

Web Search Premier

Search the live web with deeper retrieval and reranking, so the page that holds the answer ranks higher. Takes the same parameters as Web Search and returns the same response. Best for agent questions, specific facts, and named pages.
Search live news and get ranked articles, with related coverage grouped into storylines. Best for breaking news, media monitoring, and story tracking.
Get the companies and people behind a query as entity cards, alongside ranked sources. Best for company due diligence, people lookup, and competitor comparison.
Find places around a point or in a named area as cards with address, coordinates, phone, opening hours, and rating. Best for nearby recommendations, local lookup, and opening hours.
Predict the URL a query points to. Best for docs, help pages, and official sites.
Search images by a text query or a reference image. Best for image lookup and visual references.
In invite-only beta. Email support@octen.ai to request access. Search the web for videos by text query. Best for video lookup, clip discovery, and media previews.
Search real web pages, app screens, and slides, and get each as an image with its design values, plus web results on the same query. Best for landing pages, app screens, and slide decks.

Extract

Fetch 1-20 URLs in one call and get clean markdown or text. Best for reading pages, cleaning articles, and knowledge ingestion.
response.items returns each result as an object; response.results returns the same results as plain dicts. Send messages to leading LLMs through one API, with optional web search via an OctenSearchTool in tools. Best for Q&A, chat assistants, and grounded answers.

Embedding

Create text embeddings with models of different sizes. Best for semantic search, RAG, and recommendations.

VL Embedding

Create multimodal embeddings from text, images, and videos. Best for cross-modal search and visual retrieval.

Async

Use AsyncOcten for async operations. Every resource mirrors the sync client.

Configuration

AsyncOcten takes the same parameters. Use the client as a context manager (with Octen() as client:), or call client.close() when you are done.

Error Handling

Requests that fail with HTTP 408, 429, 500, 502, 503, or 504, a timeout, or a connection error are retried automatically with exponential backoff (max_retries times). Include request_id when you contact support.

Last modified on November 24, 2026