Metadata-Version: 2.5
Name: specstream-client
Version: 1.5.3
Summary: Python client for the live web data engine: Search API ($5 per 1,000 searches of up to 10 results, or $1 on the fast tier), Extract API ($0.80 per 1,000 pages) and Deep Search, each result with its source. Also a link graph API (backlinks, anchors, domain authority across 223.9M domains) and the EU DORA Register of Information sub-processor API.
Project-URL: Homepage, https://specstream.ai
Project-URL: Documentation, https://specstream.ai/docs/sdk
Project-URL: API, https://api.specstream.ai
Project-URL: Changelog, https://specstream.ai/changelog
Project-URL: Repository, https://github.com/specstream/specstream-tools
Project-URL: Issues, https://github.com/specstream/specstream-tools/issues
Author-email: SpecStream <support@specstream.ai>
License-Expression: MIT
License-File: LICENSE
Keywords: ai-agents,api-client,backlinks,backlinks-api,company-list,cse-alternative,custom-search-api,domain-authority,dora,dora-register-of-information,enrichment,exa-alternative,extract-api,google-custom-search,grants,lead-generation,lead-list,lead-lists,link-graph,live-web,mcp,monitoring,search-api,seo-api,serp-api,specstream,subprocessors,tavily-alternative,third-party-risk,web-data,web-scraping,web-search-api
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Typing :: Typed
Requires-Python: >=3.12
Description-Content-Type: text/markdown

# specstream-client

SpecStream Python and CLI

Find records in everyday language, work with saved results, and connect SpecStream
to your own code. The client uses the same account, permissions, projects, and
balance as the workspace.

Install it from PyPI with pip install -U specstream-client. Instructions are at
https://specstream.ai/docs/sdk.
Set SPECSTREAM_API_KEY in your environment to a key from Agents & API.

Developers use it as an Exa or Tavily alternative for agent search, as the drop in for Google Custom Search, as a backlinks and domain authority API, and as a DORA sub-processor API.

Search the live web and read pages:

    from specstream_client import Client
    import os

    client = Client(os.environ["SPECSTREAM_API_KEY"])
    results = client.web_search(q="latest stable release of PostgreSQL", speed="fast")
    pages = client.extract_pages({"urls": ["https://www.postgresql.org/about/news/"], "format": "markdown"})

Search API: $5 per 1,000 searches, or $1 per 1,000 with speed="fast". Extract API: $0.80 per
1,000 pages. Google Custom Search callers change the base address to https://api.specstream.ai
and keep their /customsearch/v1 call, at $1 per 1,000; test a query first at
https://specstream.ai/tools/google-cse-migrator.

Interpret a request and get a quote:

    from specstream_client import Client
    import os

    client = Client(os.environ["SPECSTREAM_API_KEY"])
    parsed = client.compile("Open-source document-signing tools I can self-host. Include the license and latest release.")
    offer = client.quote_capacity_work({
        "ast_hash": parsed["ast_hash"], "operation": "find",
        "requested_units": parsed["ast"]["limit"]["max"],
    })
    print(offer)

Review the quote's scope, useful minimum, completion terms, expiry, and maximum.
After approval, submit the approved maximum in cents and a saved unique request key:

    result = client.authorize_capacity_work({
        "quote_id": offer["quote_id"], "quote_hash": offer["quote_hash"],
        "confirm_max_cents": approved_maximum_cents,
        "idempotency_key": persisted_request_key,
    })

If the response is uncertain, get_capacity_request(persisted_request_key) recovers
that same work. Keep the original key when retrying. get_capacity_quote retrieves
the original quote. get_find reports progress; list_find_rows retrieves records.
Use get_delivery and export_find to retrieve saved results without buying them again.

## Work beyond the first request

Use spec_options to inspect the supported fields for a record type. Save requests
with create_spec, browse revisions with list_spec_revisions, and inspect their
connections with get_find_lineage. Projects organize work and member permissions.
Request links and result shares have separate access controls.

quote_capacity_work also accepts extend, add_facts, and refresh with the original
parent_find_id and exact revised request where required. create_capacity_schedule
accepts scope, cadence, validity, and spending limits. list_capacity_occurrences
shows what ran and which occurrences were blocked or missed.

Supported types include companies, local businesses, creators, products, apps, jobs,
papers, tenders, grants, software repositories, packages, datasets, clinical trials,
regulatory documents, vulnerabilities, books, and podcasts. Supported fields vary
by type. Missing and conflicting information stays explicit, with observation times
and source evidence available in saved results.

## Link graph API: backlinks and domain authority

The same key reads the link graph of SpecStream's own web index, 223.9M scored domains, with no live crawl. Each route also takes `POST` with the same fields as JSON, and a call the index does not answer is free.

| Route | Returns | Cost |
| --- | --- | --- |
| `GET /v1/authority?domains=stripe.com,notion.com` | Authority score (0 to 100), estimated global rank, referring domain and outbound host counts, up to 100 domains a call | $0.50 per 1,000 calls of 1 to 10 domains, $2 per 1,000 of 11 to 100 |
| `GET /v1/backlinks?target=stripe.com` | Inbound or outbound referring domains or linking pages (`mode=domains\|pages`, `direction=inbound\|outbound`), up to 100 rows, `offset` to 10,000 | $4 per 1,000 calls |
| `GET /v1/anchors?target=stripe.com` | Anchor texts and most linked pages, ordered by referring domains | $3 per 1,000 calls |
| `GET /v1/site-intel?domain=stripe.com` | Authority, rank, site profile, published contacts, schema items, outbound hosts and top anchors in one call | $10 per 1,000 calls |

```bash
curl -H "Authorization: Bearer $SPECSTREAM_API_KEY" \
  "https://api.specstream.ai/v1/backlinks?target=stripe.com&mode=domains"
```

Try it free in the browser: [Backlink Checker](https://specstream.ai/tools/backlink-checker). The top 10,000 domains of the graph are an open CC BY 4.0 dataset on [GitHub](https://github.com/Specstreamai/open-web-authority-10k), [Hugging Face](https://huggingface.co/datasets/SpecStreamAI/open-web-authority-10k) and [Kaggle](https://www.kaggle.com/datasets/specstream/open-web-authority-10k).

## EU DORA Register of Information: sub-processor API

`GET /v1/data/dora/subprocessors` returns a vendor's sub-processors as DORA (Regulation (EU) 2024/2956) `B_05.01` and `B_05.02` rows, with the GLEIF Level 1 LEI and the Level 2 ultimate parent LEI, at $0.05 a lookup. `format=roi_csv` gives the rows ready for the register; send an `Idempotency-Key` header and a retry with the same key is charged once.

```bash
curl -H "Authorization: Bearer $SPECSTREAM_API_KEY" -H "Idempotency-Key: stripe-2026-12" \
  "https://api.specstream.ai/v1/data/dora/subprocessors?domain=stripe.com&format=roi_csv"
```

Free check in the browser: [DORA sub-processor check](https://specstream.ai/tools/dora-subprocessor-check).

## Command line

    specstream compile "your request"
    specstream get-capacity-catalog
    specstream get-capacity-balance
    specstream quote-capacity-work --body quote-request.json
    specstream authorize-capacity-work --body approved-execution.json
    specstream get-capacity-request --help
    specstream create-capacity-schedule --body approved-schedule.json

--body accepts a JSON file or '-' for stdin. Each command's --help describes its
path and query parameters. The CLI exposes the same public operations as the client.
Funding and membership administration require an owner browser session.

## Pricing

A free account comes with $2 of credit, enough for 2,000 fast searches, with no card.
Search API: $5 per 1,000 searches of up to 10 results, or $1 per 1,000 on the fast tier.
Extract API: $0.80 per 1,000 pages; a page with no text is not charged.
Deep Search: a delivered row costs 5 cents, 15 cents or $1 depending on the facts it carries.
Monthly credit plans turn the full fee into credit: Starter $49, Growth $199, Scale $499.
A top-up of $1,000 or more adds 20% more credit. People and agents share one balance.
Prices: https://specstream.ai/pricing

## Benchmarks

SpecStream is hosted in the EU and is first on 15 public search, research and
extraction benchmarks: AA-Omniscience 82.67% on all 600 questions, SurfBench v2 84.6,
WideSearch on all 200 official tasks over 4 trials, FRAMES 90.78% and TRACE Extract
v6 88.51%. Scores and method: https://specstream.ai/benchmarks
Every raw answer: https://huggingface.co/datasets/SpecStreamAI/benchmark-results

## Moving off Google Custom Search

Google ends its Custom Search JSON API for existing customers on January 1, 2027.
SpecStream answers the same call in Google's shape, so the move is one line: change
the base address from https://www.googleapis.com to https://api.specstream.ai.

    curl "https://api.specstream.ai/customsearch/v1?key=$SPECSTREAM_API_KEY&q=open+source+vector+databases&num=10"

items[].title, link, snippet and displayLink come back as before. cx is accepted and
not needed. Each call runs on the fast tier at $1 per 1,000.
Guide: https://specstream.ai/migrate/google-custom-search

Use quote_capacity_work and authorize_capacity_work for new integrations.
Older client method names remain for compatibility.

Documentation: https://specstream.ai/docs/api
