Skip to main content

The fastest path: hand it to your coding agent

If you use a coding agent (Claude Code, Cursor, Codex, or any MCP-capable assistant), paste this line into it:
The agent reads the AnyAPI skill, sets up a key, and runs its first API. To do it yourself, follow the steps below.

Prerequisites

  • An AnyAPI account. Sign up at getanyapi.com.
  • A terminal with curl (or any HTTP client).

Get started

1

Create an API key

In the dashboard, open API Keys and create a new key. Copy it now: it is shown only once.New accounts start with about 100 free requests.
To stay in your terminal, mint a free trial key with one request. No dashboard, sign-in, or account:
The body is optional; label tags the key. The response includes your aa_live_... key (shown once). It works immediately on a free trial budget of about $0.05 and expires in 7 days. When the budget runs out, calls return 402 trial_cap_reached; run anyapi connect or open the dashboard to connect a wallet and keep going. See Let your agent onboard itself.
2

Make your first call

Every API is a single POST to /v1/run/{sku}. Pass your key with the X-API-Key header (or Authorization: Bearer) and the SKU’s normalized input as the JSON body.The example uses tiktok.profile. For any other SKU, fetch GET /v1/apis/{sku} first and build the body from its inputSchema. Do not copy fields from another API or retry invalid input with guessed aliases.
/v1/run/{sku} accepts optional query parameters that shrink the response, for example to keep it out of an agent’s context window: fields (keep only these keys), max_items (cap the rows), and summary (outline only). They trim what is returned, not what you are billed. See MCP server.
3

Read the response

output is the result, costUsd is what this call cost you in USD, and items is the number of results you were charged for (on per-result APIs).
A legitimate “not found” is a success: output is { "found": false, "data": null, "reason": "not_found" }. You get it when the account, post, video, or page you named does not exist, has been removed, or a search matched nothing; a suspended account says "reason": "suspended" on an API whose source can tell. Each API’s output schema lists the reasons it can return. A miss is billed only when a source charged AnyAPI for the lookup; see Pricing. costUsd is always what this call cost you, 0 when nothing was charged. See Not found vs error for every outcome.

Find an API

To browse by eye, start at the full catalog or a platform page such as Instagram, TikTok, LinkedIn, or Google Maps. From code, browse by category or use the dedicated ranked search endpoint:
On /catalog/search, q is optional. Name any combination of q, category, and platform; only a request naming none of them is rejected. Both endpoints are free and need no key. Send only properties the selected inputSchema declares. A field one API accepts, such as limit, cursor, page, or sort, may be invalid for another. Browse and search results report provider: "AnyAPI", nested USD pricing, and failover, which says whether AnyAPI currently has an alternate route. The pricing fields are explained on the introduction page. Do not infer failover from the number of lanes or recompute pricing.from from lane prices. Most endpoints are served by established providers such as Apify and ScrapeCreators, under volume contracts whose lower prices reach you, plus smaller specialist sources that failover makes safe to use. The providers page lists every source and the traffic it served. If you build a discovery wrapper, treat response objects as extensible: read the fields you need, ignore additions, and pass input and output JSON Schemas through as opaque objects. The full catalog with typed schemas also lives in the API Reference.

Choose request deadlines from observed latency

Set your HTTP client timeout per SKU, from its observed latency:
latency reports trailing-30-day p50Ms, p95Ms, p99Ms, and sample values from successful end-to-end requests after AnyAPI failover. Its basis is service_time_excludes_caller_requested_delay. If excludesCallerDelay is true, your wall-clock time also includes the waiting requested in your input. latency is null when there are no successful observations or metrics could not be read. A p99 value is an observation, not a maximum or a recommended timeout. Browse and search responses omit latency.

Retry safely after a disconnect

Wallet-funded REST calls support an optional Idempotency-Key header. Generate one key for a logical call and keep it until you receive a terminal response:
When AnyAPI honors the key, the synchronous run can continue in-process after your client disconnects, bounded by the normal execution deadline. The disconnected socket does not receive the eventual result. Retry the same SKU, query parameters, body, and key:
  • 409 idempotency_in_progress means the original run is still working. Wait a few seconds and retry the same request.
  • 200 with Idempotency-Replayed: true returns the original output, costUsd, and items without another provider run or charge.
  • Reusing the key with different request semantics returns 409 idempotency_conflict.
REST results remain replayable for 24 hours. If the continued run produces a replayable result, it charges normally exactly once even if the original client disconnected. Calls without an Idempotency-Key stay tied to the caller and are canceled on disconnect.

Check your balance

Top up from the dashboard. You pay on Stripe’s hosted checkout page with no AnyAPI top-up fee, and the USD balance changes only after the verified payment settles.
Building an AI agent? Connect the whole catalog over MCP instead. See Connect over MCP.