stophy package gives you sync and async calls to Stophy from Python 3.9 or newer.
Make a call
No account, no key.Response
Response
success, data, creditsUsed and requestId. A list is in data["results"].
Methods follow the endpoint id, with keyword arguments in snake_case. google.search is stophy.google.search(...), and reddit.search is stophy.reddit.search(...). The API reference lists every endpoint.
Use a key
Without a key you can call the endpoints markedkeyless: true in the catalog, and you get the first page only. Every other call raises a StophyError with code unauthorized.
Set STOPHY_API_KEY and Stophy() picks it up. Or pass it in:
Find endpoints
Run async
AsyncStophy has the same methods. Await them.
Page through results
A list call returns one page. When there is more,data["cursor"] is set. Pass it back to get the next page. This needs a key.
page number instead, like google.search. See Page through results.
Handle errors
retry_after_seconds set. A failed call costs nothing. See Errors for every code.
Options
Check your usage
These need a key.balanceMicros is your balance in millionths of a dollar. One credit is 1,500, so divide by 1,500 to get credits. See Usage and Logs.