# Estimate audience reach

Estimates an audience reach without changing anything. Works with Meta Ads, LinkedIn Ads, Pinterest Ads and X Ads.

```http
POST https://api.pozy.ai/v1/ads/targeting/reach-estimate
```

- Area: Ads / Ad Targeting
- Auth: Authorization: Bearer pz_live_...

## Request body

Content type: `application/json`

- `accountId`, string, required
- `adAccountId`, string, required
- `spec`, object
  - `userOs`, array of string: At least 1 item
  - `userDevice`, array of string: At least 1 item
  - `countries`, array of string
  - `regions`, array of string or object
    - one of: string
    - one of: Option 2
      - `key`, string, required
      - `name`, string
  - `cities`, array of string or object
    - one of: string
    - one of: Option 2
      - `key`, string, required
      - `name`, string
      - `radius`, number
      - `distanceUnit`, string: One of `mile`, `kilometer`
  - `zips`, array of object
    - `key`, string, required
    - `name`, string
  - `metros`, array of object
    - `key`, string, required
    - `name`, string
  - `countryGroups`, array of string: Each item: one of `africa`, `asia`, `europe`, `north_america`, `south_america`, `oceania`, `central_america`, `caribbean`, `eea`, `euro_area`, `nafta`, `mercosur`, `afta`, `apec`, `gcc`, `cisfta`, `emerging_markets`, `itunes_app_store`, `android_free_store`, `android_paid_store`
  - `customLocations`, array of object
    - `latitude`, number, required: -90 to 90
    - `longitude`, number, required: -180 to 180
    - `radius`, number, required
    - `distanceUnit`, string, required: One of `mile`, `kilometer`
    - `name`, string
    - `address`, string
  - `excludedLocations`, object
    - `countries`, array of string
    - `countryGroups`, array of string: Each item: one of `africa`, `asia`, `europe`, `north_america`, `south_america`, `oceania`, `central_america`, `caribbean`, `eea`, `euro_area`, `nafta`, `mercosur`, `afta`, `apec`, `gcc`, `cisfta`, `emerging_markets`, `itunes_app_store`, `android_free_store`, `android_paid_store`
    - `regions`, array of object
      - `key`, string, required
      - `name`, string
    - `cities`, array of object
      - `key`, string, required
      - `radius`, number
      - `distanceUnit`, string: One of `mile`, `kilometer`
    - `zips`, array of object
      - `key`, string, required
      - `name`, string
    - `places`, array of object
      - `key`, string, required
    - `neighborhoods`, array of object
      - `key`, string, required
    - `customLocations`, array of object
      - `latitude`, number, required: -90 to 90
      - `longitude`, number, required: -180 to 180
      - `radius`, number, required
      - `distanceUnit`, string, required: One of `mile`, `kilometer`
      - `name`, string
      - `address`, string
  - `ageMin`, integer: 13 to 100
  - `ageMax`, integer: 13 to 100
  - `gender`, string: One of `all`, `male`, `female`
  - `incomeTier`, string: One of `top_5`, `top_10`, `top_10_25`, `top_25_50`
  - `languages`, array of string
  - `interests`, array of object
    - `id`, string, required
    - `name`, string
  - `behaviors`, array of object
    - `id`, string, required
    - `name`, string
  - `workPositions`, array of object
    - `id`, string, required
    - `name`, string
  - `workEmployers`, array of object
    - `id`, string, required
    - `name`, string
  - `workIndustries`, array of object
    - `id`, string, required
    - `name`, string
  - `industries`, array of string
  - `companySizes`, array of string
  - `seniorities`, array of string
  - `jobFunctions`, array of string
  - `skills`, array of string
  - `audienceInclude`, array of string
  - `audienceExclude`, array of string
  - `communities`, array of string
  - `excludedCommunities`, array of string
  - `conversationKeywords`, array of string
  - `excludedConversationKeywords`, array of string
- `rawTargeting`, object
- `optimizationGoal`, string

## Example request

```bash
curl -X POST "https://api.pozy.ai/v1/ads/targeting/reach-estimate" \
  -H "Authorization: Bearer $POZY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "accountId": "696e0b682d0a31188e7a2ba9",
  "adAccountId": "666219aad7bab67ace411e4f"
}'
```

```ts
const res = await fetch("https://api.pozy.ai/v1/ads/targeting/reach-estimate", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.POZY_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    accountId: "696e0b682d0a31188e7a2ba9",
    adAccountId: "666219aad7bab67ace411e4f"
  }),
});
const data = await res.json();
if (!res.ok) throw new Error(data?.error ?? `Request failed with status ${res.status}`);
console.log(data);
```

```python
import os
import requests

resp = requests.post(
    "https://api.pozy.ai/v1/ads/targeting/reach-estimate",
    headers={"Authorization": f"Bearer {os.environ['POZY_API_KEY']}"},
    json={
        "accountId": "696e0b682d0a31188e7a2ba9",
        "adAccountId": "666219aad7bab67ace411e4f",
    },
    timeout=30,
)
resp.raise_for_status()
print(resp.json())
```

## Response 200

- `available`, boolean, required
- `lower`, integer: Can be null
- `upper`, integer: Can be null
- `daily`, integer: Can be null
- `active`, integer: Can be null
- `currency`, string: Can be null
- `estimateReady`, boolean: Can be null

```json
{
  "available": true,
  "lower": 1,
  "upper": 1,
  "daily": 1,
  "active": 1,
  "currency": "USD",
  "estimateReady": true
}
```
