Skip to main content

Stophy for Python

Search, read, and act on the web. This is the typed Stophy client for Python, with a sync and an async class.

Install

pip install stophy

Example

from stophy import Stophy

stophy = Stophy()
page = stophy.scrape(url="https://example.com", formats=["markdown"])
print(page["data"].get("markdown"))

That call needs no key. Every method and result is typed, and each method sends one call to the Stophy API and returns its JSON as a dict. scrape returns success and data, and map returns success and links. Arguments are keyword-only and snake_case. For async code, use AsyncStophy: it has the same methods, and you await each call.

Pick a method

Method Use it to
search Search the web, news, images, research papers or YouTube videos
scrape Read one page as Markdown, HTML, links, a screenshot or JSON
parsed Read a site's own data, such as Reddit posts or Google Maps places, as JSON
map List the pages on a site, to find the right one before you read it
parse Turn a PDF, Word, Excel or PowerPoint file, or a picture of text, into Markdown
crawl, batch.scrape Read a whole section of a site, or a list of URLs, in the background
extract Pull the fields you name from pages, each checked against the page
browser.task Click through a public site in a cloud browser to search, filter or fill a form
limits, usage, logs Read your balance, your all-time usage and your recent calls

limits returns the balance in dollars as balanceUsd, with your rate limit. scrape, search, map and parse work without a key, within a small free allowance, and so do parsers, endpoints and signup. Every other method raises a StophyError with the code apiKeyRequired.

Read a site with a parser

stophy.parsed("google-maps", url) calls scrape with the format {"type": "json", "parser": ...} and puts the result in data.json. The parser name is typed as ParserName, and stophy.parsers() returns each parser with the page it reads and what it returns. Extra keyword arguments are the parser's options, such as page=2 for the next page. Paging needs an API key.

Run a job in the background

crawl, batch.scrape, extract and browser.task answer at once with an id, which browser.task returns as data["id"] and the others return at the top level. Read the result with crawl.status(id=...), batch.scrape.status(id=...), extract.result(id=...) or browser.task.status(id=...). crawl and batch.scrape also have cancel(id=...), which stops the job and keeps the pages already read.

A crawl status is scraping until it is completed. While pages are left to read, the answer has next, a link with a cursor. Send that cursor with the same id to get only the pages finished since. extract.result raises a StophyError with the code notFound until the result is ready. A job and its result are kept for 24 hours.

API key

Get a key at stophy.dev/signup. The client reads STOPHY_API_KEY, or you pass it in with Stophy(api_key="st_...").

Option Default What it does
api_key STOPHY_API_KEY Your API key
base_url STOPHY_BASE_URL, or the Stophy API The server to call
max_retries 2 Retries per request. 0 turns retries off.
timeout 70.0 Time limit in seconds for each attempt

Errors and retries

A failed call raises a StophyError, which you import from stophy. It has code, retryable, retry_after_seconds, status, request_id and details. The message is str(error), and it says what went wrong and what to do next.

The client retries network errors and the HTTP statuses 429, 500, 502, 503 and 504, and it waits as long as the API asks. If the API asks for a wait longer than 60 seconds, it raises right away with retry_after_seconds set.

Docs

License

MIT

Metadata

Release files for stophy 1.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for stophy 1.4.1
File Size Uploaded Provenance Actions
stophy-1.4.1.tar.gz 31.3 kB With provenance Details for stophy-1.4.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for stophy 1.4.1
File Interpreter ABI Platform Actions
stophy-1.4.1-py3-none-any.whl Python 3 none any Details for stophy-1.4.1-py3-none-any.whl

Total release size: 51.4 kB

Release files / stophy-1.4.1.tar.gz

Download URL stophy-1.4.1.tar.gz
Size 31.3 kB
Tags Source
SHA-256 checksum
How to use checksums
68f288decdf23ac1a83e673e50851233610339ab995a8bfd7a9dd95b1cd430ba
BLAKE2b-256 checksum
How to use checksums
33c23a0060dd17adb5ceb5403495c5ce9dc550d3bb6641259caae63a1c0cc17d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

Release files / stophy-1.4.1-py3-none-any.whl

Download URL stophy-1.4.1-py3-none-any.whl
Size 20.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dbc1ade46d0d97c75e591aa31582b3875e201eb3aeb68659b648328482a137a0
BLAKE2b-256 checksum
How to use checksums
af79a57b95fe6ec6a3cc54de63629f827110b574686692d14c6973e6ac4ac677
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

Security for stophy 1.4.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for stophy-1.4.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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