Skip to content

Latest commit

 

History

History
133 lines (108 loc) · 4.37 KB

File metadata and controls

133 lines (108 loc) · 4.37 KB
title Quickstart
description From zero to your first AnyAPI call in five minutes.

This guide takes you from signup to a live response. You'll create a key, top up your wallet, and run your first API.

Prerequisites

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

Get started

In the [dashboard](https://getanyapi.com/dashboard), open **API Keys** and create a new key. Copy it somewhere safe — it's shown only once.
New accounts get a one-time **$1** credit, so you can make your first calls before
topping up.

<Tip>
  Prefer not to leave your terminal? Mint a key with one request — no dashboard, no
  sign-in:

  ```bash
  curl -s -X POST https://api.getanyapi.com/agent/signup \
    -H "Content-Type: application/json" \
    -d '{ "sponsorEmail": "you@example.com", "label": "quickstart" }'
  ```

  The response includes your `aa_live_…` key (shown once) and a `claimToken`. It works
  immediately on a small starter credit; to lift its cap, make it permanent, and add
  the $1 credit, sign in at the dashboard with that email and claim it under **API keys
  → Claim agent key**. See [Let your agent onboard itself](/agent-self-signup).
</Tip>
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.
<CodeGroup>
```bash curl
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
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
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());
```
</CodeGroup>

<Note>
  Building an agent? `/v1/run/{sku}` accepts optional **query parameters** that
  shrink the response so a large result doesn't flood your context window:
  `fields` (keep only these keys), `max_items` (cap the rows), and `summary`
  (outline only). They trim what's returned, never what you're billed. See the
  [MCP server](/mcp-server) page for details.
</Note>
You get a normalized envelope. `output` is the result, `costUsd` is what this call cost you in real dollars, and `items` is the number of results you were charged for (on per-result APIs).
```json
{
  "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 }`.
  You're only charged when a call succeeds — failed calls cost nothing.
</Note>

Find an API

You don't need to know SKUs ahead of time — list and search the catalog:

# List or search every available API
curl -s "https://api.getanyapi.com/v1/apis?query=tiktok" -H "X-API-Key: YOUR_ANYAPI_KEY"

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

The full catalog with typed schemas also lives in the API Reference.

Check your balance

curl -s https://api.getanyapi.com/v1/balance -H "X-API-Key: YOUR_ANYAPI_KEY"

Top up any time from the dashboard — your wallet is a USD balance you draw down per request. Pay with a card, Link, crypto (USDC), or Apple / Google Pay; every method funds the same USD wallet.

Building an AI agent? Skip the per-endpoint wiring and connect the whole catalog over MCP instead — see [Connect over MCP](/mcp-server).