> ## Documentation Index
> Fetch the complete documentation index at: https://getanyapi.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> From zero to your first AnyAPI call in five minutes.

## 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:

```text theme={"dark"}
Set up https://getanyapi.com/SKILL.md
```

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](https://getanyapi.com/dashboard).
* A terminal with `curl` (or any HTTP client).

## Get started

**1. Create an API key**

In the [dashboard](https://getanyapi.com/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**.

> [!TIP]
>
> To stay in your terminal, mint a free trial key with one request. No dashboard,
> sign-in, or account:
>
> ```bash theme={"dark"}
> curl -s -X POST https://api.getanyapi.com/agent/signup \
>   -H "Content-Type: application/json" \
>   -d '{ "label": "quickstart" }'
> ```
>
> 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](https://getanyapi.com/dashboard) to connect a wallet and keep going. See
> [Let your agent onboard itself](https://getanyapi.com/docs/agent-self-signup.md).

**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.

```bash curl theme={"dark"}
curl -s https://api.getanyapi.com/v1/run/tiktok.profile \
  -H "X-API-Key: YOUR_ANYAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{"handle":"cristiano"}'
```

```python python theme={"dark"}
import requests

res = requests.post(
    "https://api.getanyapi.com/v1/run/tiktok.profile",
    headers={"X-API-Key": "YOUR_ANYAPI_KEY"},
    json={"handle": "cristiano"},
)
print(res.json())
```

```javascript node theme={"dark"}
const res = await fetch("https://api.getanyapi.com/v1/run/tiktok.profile", {
  method: "POST",
  headers: {
    "X-API-Key": "YOUR_ANYAPI_KEY",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ handle: "cristiano" }),
});
console.log(await res.json());
```

> [!NOTE]
>
> `/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](https://getanyapi.com/docs/mcp-server.md).

**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).

```json theme={"dark"}
{
  "output": { "found": true, "data": { "handle": "cristiano", "followers": 0 } },
  "provider": "AnyAPI",
  "costUsd": 0.002,
  "items": 1
}
```

> [!NOTE]
>
> 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](https://getanyapi.com/docs/index.md#pricing).
> `costUsd` is always what this call cost you, `0` when nothing was charged. See
> [Not found vs error](https://getanyapi.com/docs/sdks.md#not-found-vs-error) for every outcome.

## LinkedIn ad date filters

For `linkedin.ads_search`, LinkedIn accepts `startDate` and `endDate` from one year ago
through yesterday in UTC. If your date range overlaps that window, AnyAPI moves an earlier
start date forward and moves today or a later end date back to yesterday. If you send `startDate`
without `endDate`, the search ends yesterday. The response's
optional `hint` starts with `date_adjusted:` and names the adjusted dates used for your search.
The dates stay the same if the response arrives after midnight or you replay the request.

A reversed range or a range with no accepted day is rejected before the search. You are not
charged for that rejection.

## Find an API

To browse by eye, start at [the full catalog](https://getanyapi.com/catalog) or a
platform page such as
[Instagram](https://getanyapi.com/api/instagram),
[TikTok](https://getanyapi.com/api/tiktok),
[LinkedIn](https://getanyapi.com/api/linkedin), or
[Google Maps](https://getanyapi.com/api/maps).

From code, browse by category or use the dedicated ranked search endpoint:

```bash theme={"dark"}
# Browse available social APIs
curl -s "https://api.getanyapi.com/catalog?category=social"

# Search by intent
curl -s "https://api.getanyapi.com/catalog/search?q=tiktok&limit=10"

# Or scope with no query at all: everything one platform can do
curl -s "https://api.getanyapi.com/catalog/search?platform=reddit"

# Inspect one API's input and output schemas
curl -s https://api.getanyapi.com/v1/apis/tiktok.profile -H "X-API-Key: YOUR_ANYAPI_KEY"
```

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](https://getanyapi.com/docs/index.md#pricing) 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](https://getanyapi.com/providers) 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](https://getanyapi.com/docs/api-reference/tiktok/tiktok-profile.md).

## Choose request deadlines from observed latency

Set your HTTP client timeout per SKU, from its observed latency:

```bash theme={"dark"}
curl -s https://api.getanyapi.com/v1/apis/google.search \
  -H "X-API-Key: YOUR_ANYAPI_KEY" \
  | jq '.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:

```bash theme={"dark"}
curl -s https://api.getanyapi.com/v1/run/reddit.search \
  -H "X-API-Key: YOUR_ANYAPI_KEY" \
  -H "Idempotency-Key: YOUR_UNIQUE_RETRY_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query":"mechanical keyboard"}'
```

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.

## Read a past response

AnyAPI keeps the response to every paid request so you can read it again without paying twice:
for 3 days by default, or 7 days or not at all, which you choose on the dashboard's Usage page.
Read it with the request ID from the `X-Anyapi-Request-Id` response header or the dashboard:

```bash theme={"dark"}
curl -s https://api.getanyapi.com/v1/requests/REQUEST_ID -H "X-API-Key: YOUR_ANYAPI_KEY"
```

The response carries `result` while the response is kept, and `resultExpired: true` after.
Lowering the setting hides older responses at once. Stored responses are encrypted, and anything
over 5 MiB is not kept. Every account can read them 10 times a minute, or 30 times a minute for
each \$1 it has spent if that is more; past the limit you get `429` with `Retry-After`.

## List your requests

The same list as the dashboard's Usage page is available with your API key:

```bash theme={"dark"}
curl -s "https://api.getanyapi.com/v1/requests?limit=50" -H "X-API-Key: YOUR_ANYAPI_KEY"
```

It returns your requests newest first, by default from the last 24 hours. A key with **Full
access** or **View account** can read it; a **Run APIs** key cannot. Optional query parameters:

| Parameter | Meaning |
| - | - |
| `from`, `to` | Window as Unix milliseconds. `to` defaults to now and `from` to 24 hours before `to`. A window longer than 30 days is shortened to the 30 days ending at `to`. |
| `limit` | Rows per page, 50 by default and at most 100. |
| `before` | The `nextCursor` from the previous page. |
| `level` | `success`, `error`, or `rejected`. |
| `platform` | The part of the SKU before the dot, for example `tiktok`. |
| `q` | Text matched against the SKU and the request ID, up to 100 characters. |

Each entry in `requests` has `id`, `sku`, `level`, `httpStatus`, `costUsd`, `items`,
`latencyMs`, `auth` (`key`, `oauth`, or `dashboard`), `input`, and `createdAt`, plus `error`
when the request failed. Read the full response of one request with `GET /v1/requests/{id}`
as shown above.

`nextCursor` is set when older requests match your parameters, and it is `null` once none
remain. Pass it as `before`, with the same other parameters, to get the next page. A page can
hold more rows than `limit`, so that requests sharing one timestamp are never split across two
pages.

`to` defaults to now and `from` to 24 hours before `to`, so both move with the clock. To walk a
fixed window, pass explicit `from` and `to` on every call.

## Check your balance

```bash theme={"dark"}
curl -s https://api.getanyapi.com/v1/balance -H "X-API-Key: YOUR_ANYAPI_KEY"
```

Top up from the [dashboard](https://getanyapi.com/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.

> [!TIP]
>
> Building an AI agent? Connect the whole catalog over MCP instead. See
> [Connect over MCP](https://getanyapi.com/docs/mcp-server.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.