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

# Get a search

GET https://campino.tech/api/v1/partner/audience/searches/{request_id}

Read one search. Poll it every 10 seconds (the `Retry-After` header says so) until `status` is not `IN_PROGRESS`.

- `DONE`: `result` holds every match with its phone number masked (`091*****728`), and what unmasking costs. Buy the full numbers with [Buy results](/api-reference/audience-search/buy-results).
- `FAILED`: `error` says why, and `error.refunded` is `true` once your fee is back in your wallet.

A failed search is a successful read: the HTTP status is `200`. Reads are limited to 30 a minute per credential, apart from the search limits.

Reference: https://docs.campino.tech/api-reference/audience-search/get-search

## Authentication

- `Authorization` header (bearer token, required) — Your partner credential, issued by Campino. Send it as `Authorization: Bearer pc_live_...`.

## Request

### Path parameters

- `request_id` (string, required) — The `request_id` the submission returned.

## Response

### 200

The search as it is now.

- `status` (enum, required)
  - Allowed values: `success`
- `data` (GetSearchData, required) — One search as polled. `result` appears only when `DONE`, `error` only when `FAILED`.
- `error` (any, optional)

## Errors

### 401 Unauthorized Error

The credential is missing, malformed, unknown, revoked, expired, not allowed from your address, or sent twice. Error `4012`.

- `status` (enum, required)
  - Allowed values: `failure`
- `error` (ErrorDetail, required) — The error inside a failure response.
- `data` (any, optional)

### 404 Not Found Error

No such search for your account, or its results expired. Error `4043`. Another account's search answers the same way.

- `status` (enum, required)
  - Allowed values: `failure`
- `error` (ErrorDetail, required) — The error inside a failure response.
- `data` (any, optional)

### 422 Unprocessable Entity Error

The request is malformed. Error `4200`, with the rejected fields in `error.fields`.

- `status` (enum, required)
  - Allowed values: `failure`
- `error` (ErrorDetail, required) — The error inside a failure response.
- `data` (any, optional)

### 429 Too Many Requests Error

More than 30 reads in a minute. Error `4290`.

- `status` (enum, required)
  - Allowed values: `failure`
- `error` (ErrorDetail, required) — The error inside a failure response.
- `data` (any, optional)

### 500 Internal Server Error

The request could not be recorded or closed on our side. Error `5000` or `5001`. Repeat the request with the same `Idempotency-Key` (for a submission) or the same `request_id`.

- `status` (enum, required)
  - Allowed values: `failure`
- `error` (ErrorDetail, required) — The error inside a failure response.
- `data` (any, optional)

### 502 Bad Gateway Error

The stored result cannot be read right now. Error `5021`. Read again.

- `status` (enum, required)
  - Allowed values: `failure`
- `error` (ErrorDetail, required) — The error inside a failure response.
- `data` (any, optional)

### 503 Service Unavailable Error

The rate limiter is unavailable. Error `5030`. Retry after a few seconds.

- `status` (enum, required)
  - Allowed values: `failure`
- `error` (ErrorDetail, required) — The error inside a failure response.
- `data` (any, optional)

## Types

### GetSearchData

One search as polled. `result` appears only when `DONE`, `error` only when `FAILED`.

- `request_id` (string, required)
- `status` (enum, required) — `IN_PROGRESS` while the search runs, then `DONE` or `FAILED`. The last two never change.
  - Allowed values: `IN_PROGRESS`, `DONE`, `FAILED`
- `created_at` (datetime, required)
- `result` (SearchResult, optional, nullable) — A finished search, every match masked.
- `error` (SearchFailure, optional, nullable) — Why a search failed.

### ErrorDetail

The error inside a failure response.

- `code` (integer, required) — Application error code. See the Errors page.
- `message` (string, required) — A fixed text for the code. Match on `code`, not on `message`.
- `fields` (list of FieldError, optional, nullable) — Present for `4200` only.

### SearchResult

A finished search, every match masked.

- `query_id` (string, required)
- `matched_count` (integer, required) — How many people matched.
- `returned_count` (integer, required) — How many are listed in `users`. Equals `matched_count`.
- `users` (list of MaskedUser, required)
- `search_cost_toman` (integer, required) — What the search cost, already charged.
- `results_unit_price_toman` (integer, required) — Price of one phone number, frozen at submission.
- `results_cost_toman` (integer, required) — `matched_count` times `results_unit_price_toman`: what Buy results will charge.
- `results_charged` (boolean, required) — `true` once Buy results succeeded for this search.
- `searched_at` (datetime, required) — When the search finished.
- `processing_time_ms` (integer, required) — How long the search ran, in milliseconds.

### SearchFailure

Why a search failed.

- `code` (integer, required) — `5021`: the audience service failed or timed out. `5000`: internal failure, or the search was abandoned.
- `message` (string, required) — Fixed text for the code.
- `refunded` (boolean, required) — `true` once your fee is back in your wallet. `false` means the refund is not confirmed yet; poll again.

### FieldError

One rejected field.

- `location` (list of string, required) — Path to the field.
- `type` (string, required)
- `message` (string, required)

### MaskedUser

One match, with its phone number masked.

- `identifier` (string, required) — Stable id of the person, the same one `Buy results` returns.
- `phone_number` (string, required, nullable) — Masked to the first and last three digits, like `091*****728`. `null` or fully starred when it cannot be masked safely.
- `match_score` (double, required) — How well this person fits the objective.
- `category` (string, required, nullable) — The segment the person belongs to.
- `match_explanation` (string, required) — Why this person matched.

## Examples

### Still running

**Response**

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

**SDK Code**

```python Still running
import requests

url = "https://campino.tech/api/v1/partner/audience/searches/3f1c2a7e-8b41-4c1d-9a55-6d2f0e7b9c10"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript Still running
const url = 'https://campino.tech/api/v1/partner/audience/searches/3f1c2a7e-8b41-4c1d-9a55-6d2f0e7b9c10';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Still running
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://campino.tech/api/v1/partner/audience/searches/3f1c2a7e-8b41-4c1d-9a55-6d2f0e7b9c10"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Still running
require 'uri'
require 'net/http'

url = URI("https://campino.tech/api/v1/partner/audience/searches/3f1c2a7e-8b41-4c1d-9a55-6d2f0e7b9c10")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java Still running
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://campino.tech/api/v1/partner/audience/searches/3f1c2a7e-8b41-4c1d-9a55-6d2f0e7b9c10")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php Still running
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://campino.tech/api/v1/partner/audience/searches/3f1c2a7e-8b41-4c1d-9a55-6d2f0e7b9c10', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp Still running
using RestSharp;

var client = new RestClient("https://campino.tech/api/v1/partner/audience/searches/3f1c2a7e-8b41-4c1d-9a55-6d2f0e7b9c10");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift Still running
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://campino.tech/api/v1/partner/audience/searches/3f1c2a7e-8b41-4c1d-9a55-6d2f0e7b9c10")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Done

**Response**

```json
{
  "status": "success",
  "data": {
    "request_id": "3f1c2a7e-8b41-4c1d-9a55-6d2f0e7b9c10",
    "status": "DONE",
    "created_at": "2026-12-02T09:30:00Z",
    "result": {
      "query_id": "q_7d2e1f4a",
      "matched_count": 2,
      "returned_count": 2,
      "users": [
        {
          "identifier": "u_91a0c4",
          "phone_number": "091*****728",
          "match_score": 0.93,
          "category": "investment",
          "match_explanation": "Trades gold regularly."
        },
        {
          "identifier": "u_77be12",
          "phone_number": "093*****415",
          "match_score": 0.88,
          "category": "investment",
          "match_explanation": "Follows gold price channels."
        }
      ],
      "search_cost_toman": 50000,
      "results_unit_price_toman": 400,
      "results_cost_toman": 800,
      "results_charged": false,
      "searched_at": "2026-12-02T09:32:41Z",
      "processing_time_ms": 161000
    },
    "error": null
  }
}
```

**SDK Code**

```python Done
import requests

url = "https://campino.tech/api/v1/partner/audience/searches/3f1c2a7e-8b41-4c1d-9a55-6d2f0e7b9c10"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript Done
const url = 'https://campino.tech/api/v1/partner/audience/searches/3f1c2a7e-8b41-4c1d-9a55-6d2f0e7b9c10';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Done
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://campino.tech/api/v1/partner/audience/searches/3f1c2a7e-8b41-4c1d-9a55-6d2f0e7b9c10"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Done
require 'uri'
require 'net/http'

url = URI("https://campino.tech/api/v1/partner/audience/searches/3f1c2a7e-8b41-4c1d-9a55-6d2f0e7b9c10")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java Done
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://campino.tech/api/v1/partner/audience/searches/3f1c2a7e-8b41-4c1d-9a55-6d2f0e7b9c10")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php Done
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://campino.tech/api/v1/partner/audience/searches/3f1c2a7e-8b41-4c1d-9a55-6d2f0e7b9c10', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp Done
using RestSharp;

var client = new RestClient("https://campino.tech/api/v1/partner/audience/searches/3f1c2a7e-8b41-4c1d-9a55-6d2f0e7b9c10");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift Done
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://campino.tech/api/v1/partner/audience/searches/3f1c2a7e-8b41-4c1d-9a55-6d2f0e7b9c10")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Failed and refunded

**Response**

```json
{
  "status": "success",
  "data": {
    "request_id": "3f1c2a7e-8b41-4c1d-9a55-6d2f0e7b9c10",
    "status": "FAILED",
    "created_at": "2026-12-02T09:30:00Z",
    "result": null,
    "error": {
      "code": 5021,
      "message": "The audience service failed or timed out",
      "refunded": true
    }
  }
}
```

**SDK Code**

```python Failed and refunded
import requests

url = "https://campino.tech/api/v1/partner/audience/searches/3f1c2a7e-8b41-4c1d-9a55-6d2f0e7b9c10"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript Failed and refunded
const url = 'https://campino.tech/api/v1/partner/audience/searches/3f1c2a7e-8b41-4c1d-9a55-6d2f0e7b9c10';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Failed and refunded
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://campino.tech/api/v1/partner/audience/searches/3f1c2a7e-8b41-4c1d-9a55-6d2f0e7b9c10"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Failed and refunded
require 'uri'
require 'net/http'

url = URI("https://campino.tech/api/v1/partner/audience/searches/3f1c2a7e-8b41-4c1d-9a55-6d2f0e7b9c10")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java Failed and refunded
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://campino.tech/api/v1/partner/audience/searches/3f1c2a7e-8b41-4c1d-9a55-6d2f0e7b9c10")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php Failed and refunded
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://campino.tech/api/v1/partner/audience/searches/3f1c2a7e-8b41-4c1d-9a55-6d2f0e7b9c10', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp Failed and refunded
using RestSharp;

var client = new RestClient("https://campino.tech/api/v1/partner/audience/searches/3f1c2a7e-8b41-4c1d-9a55-6d2f0e7b9c10");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift Failed and refunded
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://campino.tech/api/v1/partner/audience/searches/3f1c2a7e-8b41-4c1d-9a55-6d2f0e7b9c10")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```