Install
Authenticate
api_key defaults to the STOPHY_API_KEY environment variable, so a bare Stophy() picks it up.
StophyError with code unauthorized and status 401 when called without a key.
Make a call
youtube.comments.replies is stophy.youtube.comments.replies(...). A JSON field named from is passed as from_.
Get markdown
Passformat="markdown" to get a string:
Async
AsyncStophy has the same methods. Await them.
Paging
Handle errors and retries
StophyError has status, code, retryable, retry_after_seconds and request_id. The message is str(error). See Errors for every code.
The SDK retries network errors and 429/5xx responses on its own, honoring Retry-After, before it raises. Set max_retries=0 to turn that off. StophyError only reaches your code after retries are exhausted.
Options
Use the client as a context manager, or call
close() when you are done.
Usage and logs
These need an API key.balanceMicros is your balance in millionths of a dollar: 1000000 is $1.