Skip to main content
Peel has a TypeScript SDK and a Python SDK. Both are generated from the same OpenAPI contract that the API Reference is built from, so every REST operation that takes an API key or no auth has a typed method in each, and a small hand-written layer adds the calls you use most. Neither has a runtime dependency: the TypeScript client uses fetch and the Python client uses the standard library.
The SDKs are not published to npm or PyPI yet, so for now installing them needs a checkout of the Peel repository. Without one, call the REST API directly with any HTTP client. Do not install a package named peel from a registry; it is an unrelated project.

Install from source

From the root of a checkout of the Peel repository:
The TypeScript package is @peel/sdk and needs Node 20.3 or later, Bun or a current browser. The Python package imports as peel and needs Python 3.10 or later.

Call a marketplace endpoint without a key

Marketplace endpoints answer without a key, on Peel’s trial allowance. This calls the Hacker News front page endpoint, which takes no inputs:

Call your API with a key and a shape

Pass the key from Authentication. The client sends it as X-API-Key; pass auth: "bearer" (TypeScript) or auth="bearer" (Python) to send Authorization: Bearer instead. A shape goes in the Peel-Shape header for you:
call also takes version to run one version of the API (sent as Peel-Version), session for endpoints that need a site login, and idempotencyKey (idempotency_key in Python).

Build an API and wait for it

build starts a build and, with wait, follows it on the long-poll route until it completes, fails or asks a question:

What the clients do for you

The hosted API answers browser requests only from origins on its CORS allowlist: Peel’s own public URL and the origins Peel configures. You cannot add your own origin, so a page on any other origin has to call Peel from its server. On an allowed origin, Retry-After and x-request-id are not exposed to scripts, so retryAfterMs and requestId are empty and retries fall back to a short backoff. A browser also cannot read the Location of a 302 (fetch returns an opaque redirect), so a redirected call raises redirect_hidden and the OAuth redirect endpoints belong on a server.
Every other operation is a generated method named after its operationId: listApis, getQuota and createWebhook in TypeScript, list_apis, get_quota and create_webhook in Python.