Official typed Python SDK for AnyAPI: any API, one wallet, USD, no subscriptions.
Actively maintained. Last release 2 days ago, commits in 21 of the last 26 weeks. A safe choice.
pip install getanyapigetanyapi
Official typed Python SDK for AnyAPI: any API, one wallet, USD, no subscriptions. Reach hundreds of scraping and data APIs through one interface and one key; pay per request in real US dollars. httpx + pydantic v2, Python 3.10+, sync and async clients.
pip install getanyapi
Quickstart
from getanyapi import AnyAPI
client = AnyAPI() # reads ANYAPI_API_KEY from the environment
res = client.reddit.search(query="mechanical keyboard")
if res.output.found:
for post in res.output.data.posts:
print(post.title, post.score)
print("charged", res.cost_usd, "USD")
Async:
from getanyapi import AsyncAnyAPI
async with AsyncAnyAPI() as client:
res = await client.google.search(query="best coffee maker")
Inputs vs outputs (naming asymmetry)
Input keyword arguments mirror the wire API verbatim (camelCase where the API uses it), because
they are sent as-is. Output models are Pythonic: attributes are snake_case with a wire alias
(item.reviews_count reads the wire reviewsCount), and model_dump(by_alias=True) reproduces
the wire shape. Open provider records round-trip unknown fields via .model_extra.
Not found vs error
A successful call always returns. For most SKUs the payload is wrapped in a found flag:
res.output.found is False when the upstream had no matching entity (not an error). Use
unwrap to get the data or raise ResultNotFoundError when empty:
from getanyapi import unwrap, ResultNotFoundError
res = client.amazon.reviews(product="B07FZ8S74R")
try:
data = unwrap(res) # the typed data payload, or raises
except ResultNotFoundError:
... # empty result (found: False), not an HTTP failure
ResultNotFoundError subclasses NotFoundError, so except NotFoundError catches both an
HTTP 404 and an empty result; catch ResultNotFoundError to handle only empty results. If a
future committed schema uses a bare output, generated typing returns its data object directly
rather than relying on a hard-coded SKU list.
Discovery
apis = client.catalog(category="search")
matches = client.search(query="web search", platform="google", limit=10)
api = client.describe(matches.results[0].slug)
print(api.pricing.from_offer, api.pricing.failover_max_usd, api.input_schema)