> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.campino.tech/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.campino.tech/_mcp/server.

# Quickstart

> Submit a search, poll it until it finishes, and buy the results.

You need a partner credential (`pc_live_...`) and a wallet with enough balance for the search fee.
See [Authentication](/documentation/get-started/authentication).

#### Submit the search

Send the objective and a fresh `Idempotency-Key`. The answer is `202` and carries the `request_id`
you use from now on.

**`cURL`**

```bash cURL
curl -X POST https://campino.tech/api/v1/partner/audience/searches \
  -H "Authorization: Bearer $CAMPINO_PARTNER_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"objective": "معاملات طلا"}'
```

**`Python`**

```python Python
import uuid
import requests

BASE = "https://campino.tech/api/v1/partner/audience"
HEADERS = {"Authorization": f"Bearer {API_KEY}"}

submitted = requests.post(
    f"{BASE}/searches",
    headers={**HEADERS, "Idempotency-Key": str(uuid.uuid4())},
    json={"objective": "معاملات طلا"},
    timeout=30,
).json()
request_id = submitted["data"]["request_id"]
```

**`Node.js`**

```javascript Node.js
const BASE = "https://campino.tech/api/v1/partner/audience";
const headers = { Authorization: `Bearer ${API_KEY}` };

const submitted = await (
  await fetch(`${BASE}/searches`, {
    method: "POST",
    headers: {
      ...headers,
      "Idempotency-Key": crypto.randomUUID(),
      "Content-Type": "application/json",
    },
    body: JSON.stringify({ objective: "معاملات طلا" }),
  })
).json();
const requestId = submitted.data.request_id;
```

```json
{
  "status": "success",
  "data": {
    "request_id": "3f1c2a7e-8b41-4c1d-9a55-6d2f0e7b9c10",
    "status": "IN_PROGRESS",
    "search_cost_toman": 50000,
    "results_unit_price_toman": 400,
    "balance_toman": 950000,
    "created_at": "2026-12-02T09:30:00Z"
  },
  "error": null
}
```

#### Poll until it finishes

Read the search every 10 seconds. Stop when `status` is not `IN_PROGRESS`.

**`cURL`**

```bash cURL
curl https://campino.tech/api/v1/partner/audience/searches/$REQUEST_ID \
  -H "Authorization: Bearer $CAMPINO_PARTNER_KEY"
```

**`Python`**

```python Python
import time

while True:
    view = requests.get(f"{BASE}/searches/{request_id}", headers=HEADERS, timeout=30).json()["data"]
    if view["status"] != "IN_PROGRESS":
        break
    time.sleep(10)
```

**`Node.js`**

```javascript Node.js
let view;
do {
  await new Promise((r) => setTimeout(r, 10_000));
  view = (await (await fetch(`${BASE}/searches/${requestId}`, { headers })).json()).data;
} while (view.status === "IN_PROGRESS");
```

A `DONE` search lists every match with its phone number masked, for example `091*****728`. A
`FAILED` search carries an `error`, and your fee is refunded. See
[How a search works](/documentation/guides/how-a-search-works).

#### Buy the results

When the search is `DONE` and you want the numbers, send the `request_id`.

**`cURL`**

```bash cURL
curl -X POST https://campino.tech/api/v1/partner/audience/results \
  -H "Authorization: Bearer $CAMPINO_PARTNER_KEY" \
  -H "Content-Type: application/json" \
  -d "{\"request_id\": \"$REQUEST_ID\"}"
```

**`Python`**

```python Python
results = requests.post(
    f"{BASE}/results", headers=HEADERS, json={"request_id": request_id}, timeout=30
).json()["data"]
for user in results["users"]:
    print(user["identifier"], user["phone_number"])
```

**`Node.js`**

```javascript Node.js
const results = (
  await (
    await fetch(`${BASE}/results`, {
      method: "POST",
      headers: { ...headers, "Content-Type": "application/json" },
      body: JSON.stringify({ request_id: requestId }),
    })
  ).json()
).data;
```

Calling it again for the same search returns the same rows and charges nothing.

> **Tip**
>
> Handle failures before you go live: see [Errors](/documentation/reference/errors) and
> [Retries and idempotency](/documentation/guides/retries-and-idempotency).