Skip to main content

blopus — Python SDK

Official Python client for the Blopus web search + fetch API. Blopus is a cheap, fast web-search API backed by an owned index — built for bots and agents.

The SDK talks to exactly two data-plane endpoints: POST /v1/search and POST /v1/fetch on https://api.blopus.ai.

Install

pip install blopus

Optional framework adapters:

pip install "blopus[langchain]"     # blopus.langchain.BlopusSearch
pip install "blopus[llamaindex]"    # blopus.llamaindex.BlopusToolSpec
pip install "blopus[crewai]"        # blopus.crewai.BlopusSearchTool

Authentication

Pass an API key (blp_live_...) directly, or set BLOPUS_API_KEY:

export BLOPUS_API_KEY="blp_live_xxx"

Quickstart

from blopus import Blopus

client = Blopus()  # reads BLOPUS_API_KEY

res = client.search("who won the game last night", count=5, freshness="pd")
for hit in res:
    print(hit.score, hit.title, hit.url)
print("remaining quota:", res.remaining_quota)

# Fetch indexed page content
doc = client.fetch("https://example.com/article")
print(doc.title, len(doc.content))

Async

import asyncio
from blopus import AsyncBlopus

async def main():
    async with AsyncBlopus() as client:
        res = await client.search("openai news", freshness="pw")
        docs = await client.fetch([r.url for r in res])  # batch fetch
        print(docs.count, "fetched,", len(docs.failed_results), "missing")

asyncio.run(main())

search(...)

client.search(
    query,
    count=10,                 # 1..50
    freshness="all",          # pd | pw | pm | p3m | p1y | all
    include_domains=None,     # ["techcrunch.com", ...]
    exclude_domains=None,
    start_date=None,          # "YYYY-MM-DD" or epoch seconds
    end_date=None,
    language=None,            # "en", "pt", ...
    offset=0,                 # pagination, up to 200
    include_excerpt=False,    # opt in to longer excerpts
    excerpt_chars=None,       # up to 1200
)

Returns a SearchResponse (iterable over SearchResult):

res.query            # echoed query
res.results          # list[SearchResult]
res.count            # number of results returned
res.offset
res.more_results     # bool — more pages available
res.remaining_quota  # int — your remaining monthly units

# SearchResult fields:
# title, url, snippet, domain, site_name, favicon,
# published_at, age_seconds, language, score

Search always costs 1 credit, regardless of parameters or excerpt size.

fetch(url_or_urls)

# single URL -> FetchResult
doc = client.fetch("https://example.com/a")
doc.url, doc.canonical_url, doc.title, doc.content, doc.domain, doc.published_at, doc.language, doc.found

# list of URLs -> BatchFetchResponse
batch = client.fetch(["https://a.com", "https://b.com"])
batch.results          # list[FetchResult] that were found
batch.failed_results   # list[FetchFailure] (url, found=False)
batch.count            # number found (== credits billed)
batch.remaining_quota

Batches over the server cap of 50 URLs are automatically split into ≤50-URL calls, run sequentially with a small delay, and merged for you. Fetch bills per document found.

Errors

All errors subclass blopus.BlopusError:

Exception When
AuthError 401 / 403 — bad, missing or revoked key
QuotaError 402 — monthly quota exhausted
RateLimitError 429 — slow down (.retry_after)
NotFoundError 404 — no indexed content for a URL
BadRequestError 400 / 413 — malformed / too large
ServerError 5xx — gateway/backend problem
APIConnectionError network failure (no response)

Requests to 429/5xx/connection errors are retried with exponential backoff (honoring Retry-After); tune with Blopus(max_retries=...).

MCP

Blopus also exposes a hosted MCP server (search + fetch tools) at https://mcp.blopus.ai, using the same Bearer auth.

from blopus import mcp_config, print_mcp_config
print_mcp_config()        # prints the mcpServers JSON to paste into your MCP client
cfg = mcp_config()        # or get it as a dict

CLI

blopus search "who won the game" --count 5 --freshness pd
blopus search "openai" --include-domains techcrunch.com,theverge.com --json
blopus fetch https://example.com/a https://example.com/b
blopus mcp-config

License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

blopus-0.1.1.tar.gz (20.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

blopus-0.1.1-py3-none-any.whl (21.9 kB view details)

Uploaded Python 3

File details

Details for the file blopus-0.1.1.tar.gz.

File metadata

  • Download URL: blopus-0.1.1.tar.gz
  • Upload date:
  • Size: 20.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.3

File hashes

Hashes for blopus-0.1.1.tar.gz
Algorithm Hash digest
SHA256 1e3c8e4e49a8848613d415cf0c080371f4ef696a294062464a43920d2cec6ab7
MD5 357f9c0863ee6e98e134bab969b65676
BLAKE2b-256 a1f48743e577871adf373205a5dfd3f1a517a5b35076d97de7266f732c267641

See more details on using hashes here.

File details

Details for the file blopus-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: blopus-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 21.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.3

File hashes

Hashes for blopus-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8117b129e03f62ef900c92e0899f0d8b748e7d6bd16ae80c91951562f434a6f7
MD5 889230d60ea31c281236e30d396be17e
BLAKE2b-256 06b1ffb9bc5d77ea2bc3b5d0fceda1af4893048b850d964ec21d85e3778ae627

See more details on using hashes here.

Release history Release notifications | RSS feed

0.6.0

2 files

0.5.1

2 files

0.5.0

2 files

0.4.0

2 files

0.3.5

2 files

0.3.4

2 files

0.3.3

2 files

0.3.2

2 files

0.3.1

2 files

0.3.0

2 files

0.2.0

2 files

This release

0.1.1 This release

2 files

0.1.0

2 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