Skip to main content

Stophy for Python

Get public web data in your Python code: search results, videos, social posts, places, products, jobs, homes, and more. Every method and result is typed.

Install

pip install stophy

Try it without a key

from stophy import Stophy

result = Stophy().web.search(query="bun runtime")
print(result["data"]["results"])

Web search, YouTube search, and YouTube transcripts work without a key, with a small free allowance. Every other method raises a StophyError with the code unauthorized.

Use an API key

Get a key from the dashboard. Keys start with st_. Set it as STOPHY_API_KEY, or pass it in:

stophy = Stophy(api_key="st_...")

videos = stophy.youtube.search(query="bun runtime", limit=5)
print(videos["data"]["results"])

Methods follow the source and the command: stophy.maps.search(...), stophy.reddit.subreddit(...), stophy.youtube.comments.replies(...). Each result has data, creditsUsed, and requestId.

Arguments are keyword-only and snake_case. A field named from is passed as from_.

For async code, use AsyncStophy. It has the same methods, and you await each call.

Get markdown for a model

markdown = stophy.youtube.search(query="bun runtime", limit=5, format="markdown")

With format="markdown", the method returns a string.

Get the next page

When there are more results, data["cursor"] is set. Pass it back to get the next page:

first = stophy.reddit.search(query="bun")
next_page = stophy.reddit.search(query="bun", cursor=first["data"]["cursor"])

Handle errors

from stophy import StophyError

try:
    stophy.reddit.search(query="bun")
except StophyError as error:
    print(error.code, error.retryable, error.retry_after_seconds)

StophyError has code, retryable, retry_after_seconds, status, and request_id. The message is str(error).

The SDK 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, the SDK raises right away with retry_after_seconds set.

Options

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 30.0 Time limit in seconds for each attempt

Check your account

usage = stophy.usage()
logs = stophy.logs(days=7, page=0)

usage returns your balance and your all-time usage. logs returns your recent requests. Both need an API key.

License

MIT

Metadata

Release files for stophy 1.0.0

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.0.0
File Size Uploaded
stophy-1.0.0.tar.gz 66.3 kB Details

Built distribution (wheel)

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

Total release size: 123.2 kB

Release files / stophy-1.0.0.tar.gz

Download URL stophy-1.0.0.tar.gz
Size 66.3 kB
Tags Source
SHA-256 checksum
How to use checksums
8fd1ba12dbc644b91c50dc102d6f26b282eb6fd2e87707b193ad0fd5f233aac1
BLAKE2b-256 checksum
How to use checksums
b775294ca9cef30d06f5f1320c8d8655b2b348b48a0f31bc89798b273e0de843
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 28, 2026.

Transparency log

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

Download URL stophy-1.0.0-py3-none-any.whl
Size 56.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
efe99502a018645513867c88f1615cc8600d1b89041a90d2f54272eefb0385c6
BLAKE2b-256 checksum
How to use checksums
a04eb900eb0d84a124dce6ad5fa7a2ab96a321ad548605aa2134f3c375bf35a9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 28, 2026.

Transparency log

Release history Release notifications | RSS feed

2.0.0

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

This release

1.0.0 This release

2 release files

0.2.0

2 release files

0.1.0

2 release 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