SDKs
Official, generated client libraries for the Whatnot Seller API, with typed models and idiomatic calling conventions for each language.
Typed models, sync and async support.
pip install whatnot-seller-api
from whatnot_seller_api import WhatnotSellerAPI
client = WhatnotSellerAPI()
default = client.default.root_get()
print(default)
Official SDKs for other languages aren't published yet. Use the API Reference to call the API directly, or check back here as new clients are added.
See the API Reference for every available resource and method.
Async
Every client has an Async counterpart (AsyncWhatnotSellerAPI) exposing the same resource tree with await.
import asyncio
from whatnot_seller_api import AsyncWhatnotSellerAPI
async def main() -> None:
client = AsyncWhatnotSellerAPI()
default = await client.default.root_get()
asyncio.run(main())
Errors
Non-success responses raise generated API errors. Error objects expose status, headers, response body, and request metadata.
from whatnot_seller_api import APIStatusError
try:
default = client.default.root_get()
except APIStatusError as err:
print(err.status_code, err.message)
raise
Client options
Configure the generated client by setting any of these options when you create it.
from whatnot_seller_api import WhatnotSellerAPI
client = WhatnotSellerAPI(
timeout=60.0,
max_retries=2,
)
| Option | Type | Default | Description |
|---|---|---|---|
base_url |
str | httpx.URL | None |
- | Override the default API base URL. |
timeout |
float | Timeout | None |
60.0 |
Maximum time in seconds to wait for a response before aborting a request. |
max_retries |
int |
2 |
Number of retries for temporary failures. |
default_headers |
Mapping[str, str] | None |
- | Headers sent with every request. |
default_query |
Mapping[str, object] | None |
- | Query parameters sent with every request. |
Retries and timeouts
Generated clients retry temporary failures such as network errors, 408, 409, 429, and 5xx responses automatically, honoring Retry-After headers when present. Tune the retry and timeout client options shown above, or override them per request.
Logging
Set the WHATNOT_LOG environment variable to info or debug to enable HTTP logging. Logs are emitted through the standard logging module under the whatnot_seller_api logger.
Requirements
Python 3.9 or newer.