SDKs

Python

A small synchronous client built on httpx. Requires Python 3.10+.

Install

pip
pip install ohsee

Initialize

Create a client with your API key. Methods take keyword arguments and return the parsed JSON response.

main.py
from ohsee import Ohsee

client = Ohsee(api_key=os.environ["OHSEE_API_KEY"])
# base_url defaults to https://api.ohsee.tech

res = client.search(query="MCP auth", search_depth="basic", max_results=5)

# Or use it as a context manager:
with Ohsee(api_key=os.environ["OHSEE_API_KEY"]) as client:
    res = client.search(query="MCP auth")

Methods

methods
client.search(**body)         # POST /search
client.extract(**body)        # POST /extract
client.structure(**body)      # POST /structure
client.research(**body)       # POST /research  (async job)
client.map(**body)            # POST /map       (sync if limit <= 50)
client.crawl(**body)          # POST /crawl     (async job)
client.domain(**body)         # POST /domain    (async job)
client.estimate(**body)       # POST /estimate
client.get_job(job_id)        # GET  /jobs/{id}
client.list_jobs(kind, limit) # GET  /jobs
client.run_monitor(id)        # POST /monitors/{id}/run  (async job)
Auth scope
run_monitor works with an API key. Creating and listing monitors and reading account usage require a dashboard session, not an API key, so manage those from the dashboard.

Async jobs

research, crawl, domain, large map, and run_monitor return a job. Poll it to completion:

poll.py
accepted = client.research(
    query="compare vector databases for RAG",
    research_depth="standard",
)

import time
job = client.get_job(accepted["job_id"])
while job["status"] not in ("succeeded", "partial", "failed"):
    time.sleep(1)
    job = client.get_job(accepted["job_id"])
print(job["result"])

Errors

Non-2xx responses raise an OhseeError with status and detail.

errors.py
from ohsee import Ohsee, OhseeError

client = Ohsee(api_key=os.environ["OHSEE_API_KEY"])

try:
    client.search(query="...")
except OhseeError as err:
    print(err.status, err.detail)