Skip to main content
Yanked

This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.
Consider using release 0.3.2 instead.
Reason given by maintainers: Superseded by 0.3.2. Please upgrade: pip install -U apish-sdk

api.sh for Python

Official Python client for api.sh: public web data from around 1,000 websites as clean JSON: search engines, social media, e-commerce, real estate, jobs, travel, news and sports (Google, Amazon, TikTok, Zillow, LinkedIn and more). Every endpoint is a typed method.

pip install apish-sdk
from apish import Apish

apish = Apish()  # reads APISH_API_KEY; or Apish("ash_live_…")  (https://app.api.sh/keys)

profile = apish.tiktok.profile(username="nasa")
print(profile["followers"], profile.meta.credits_used, profile.meta.request_id)

results = apish.amazon.search(q="headphones", options={"raw": False})

Python 3.9+, sync (Apish) and asyncio (AsyncApish).

Calls

  • apish.<platform>.<endpoint>(**params, options=...): one method per endpoint, with keyword-only typed parameters and the price in its docstring.
  • apish.call(route, params, options): any route, e.g. apish.call("/reddit/v1/subreddit", {"subreddit": "python"}).
  • Options: raw (False leaves out raw source blocks), fields, fresh, output ("csv" / "ndjson" returns text), timeout, max_retries.
  • Results are dicts with .meta (request_id, credits_used, credits_remaining, status, seconds).
  • Retries 502/503/504 and network errors with backoff (failed calls are never charged).

Live catalog: counts, prices and new platforms

The typed methods cover every endpoint that existed when this version was published. The client also reads the live catalog (free, no credits, cached for an hour), so newer platforms and endpoints work without an upgrade:

cat = apish.catalog()                      # cat["platform_count"], cat["endpoint_count"]: today's numbers
prices = apish.prices()                    # route -> credits per call, live
apish.new_site.search(q="shoes")           # a platform added after this release
apish.hacker_news.some_new_endpoint(id="1")  # an endpoint added after this release
for page in apish.paginate("/reddit/v1/subreddit", {"subreddit": "python"}, max_pages=5):
    print(len(page["posts"]))

from apish import ApishError
try:
    apish.zillow.property(url=url)
except ApishError as e:
    print(e.status, e.message, e.insufficient_credits, e.spend_limit, e.request_id)

Async

import asyncio
from apish import AsyncApish

async def main():
    async with AsyncApish() as apish:
        print((await apish.reddit.subreddit(subreddit="python"))["posts"][0]["title"])

asyncio.run(main())

Account (free)

apish.account.get()            # balance, plan, spend, limits
apish.account.usage(days=30)
apish.account.logs(status="error")
apish.account.result(request_id)   # a past response again, free, 30 days

AI agents

from apish.tools import openai_tools, anthropic_tools, run_tool
tools = openai_tools()             # apish_search + apish_call (or openai_tools(["/tiktok/v1/profile"]))
text = run_tool(apish, name, arguments)   # when the model calls a tool

# LangChain:  pip install "apish-sdk[langchain]"
from apish.langchain import apish_tools
tools = apish_tools(apish)

For Claude Desktop, Cursor and other MCP clients, use the MCP server.

Docs: https://api.sh/docs/sdks · License: MIT

Metadata

Release files for apish-sdk 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for apish-sdk 0.3.1
File Size Uploaded Provenance Actions
apish_sdk-0.3.1.tar.gz 2.0 MB Without provenance Details for apish_sdk-0.3.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for apish-sdk 0.3.1
File Interpreter ABI Platform Actions
apish_sdk-0.3.1-py3-none-any.whl Python 3 none any Details for apish_sdk-0.3.1-py3-none-any.whl

Total release size: 4.1 MB

Release files / apish_sdk-0.3.1.tar.gz

Download URL apish_sdk-0.3.1.tar.gz
Size 2.0 MB
Tags Source
SHA-256 checksum
How to use checksums
4d9cf9a3b12d28442f4c707dbb437cabbf4aeb1076b71d4a817d98b8cf636e0a
BLAKE2b-256 checksum
How to use checksums
afa10665ccfaa4256287e86b472f85da8ed9cb0b0ddcbac9196e2994d4d8f420
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / apish_sdk-0.3.1-py3-none-any.whl

Download URL apish_sdk-0.3.1-py3-none-any.whl
Size 2.0 MB
Tags Python 3
SHA-256 checksum
How to use checksums
dc269eb49757ff3a7cdb3078657ae58814d841eb917598b7c0abba86b46ed21a
BLAKE2b-256 checksum
How to use checksums
fedd9fdf19a14178063d0b7bc3947784a44829774d036e4402bd1118e14b4aa1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for apish-sdk 0.3.1

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.3.1 This release

2 release files No provenance

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