# Facebook Ad details API (facebook.ad_detail)

- Canonical page: https://everyinfra.com/en/facebook-api/ad_detail
- Endpoint: POST /api/v1/social with {"platform": "facebook", "action": "ad_detail", "params": {...}}
- Price: $0.000958 per call ($0.96 per 1,000 requests); failed and empty results are not charged
- Returns: single object
- Mode: sync; add "mode": "async" for slow tasks

## Health

- Live health (24h percent, hourly and daily trends): https://api.everyinfra.com/api/v1/social/availability?platform=facebook&action=ad_detail

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| url | not declared | yes | not declared | One ad: an Ad Library link (https://www.facebook.com/ads/library/?id=<Library ID>) or the numeric Library ID itself (the `id` of an `ads` row). |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| id | The record's unique ID on the platform. Unique only within one platform; IDs can repeat across platforms. |
| url | Link to the record on the platform. |
| is_active | platform-native meaning |
| started_at | platform-native meaning |
| ended_at | platform-native meaning |
| text | Body text with HTML removed, returned in full and never cut short (on a few platforms the list results themselves carry only an excerpt; the platform's field notes say so). |
| title | Title. null when the platform has no titles (for example text-only posts). |
| caption | platform-native meaning |
| link_url | platform-native meaning |
| link_description | platform-native meaning |
| cta_text | platform-native meaning |
| display_format | platform-native meaning |
| platforms | platform-native meaning |
| media | platform-native meaning |
| creatives | platform-native meaning |
| variant_count | platform-native meaning |
| advertiser_id | platform-native meaning |
| advertiser_name | platform-native meaning |
| advertiser_url | platform-native meaning |
| advertiser_likes | platform-native meaning |
| advertiser_avatar_url | platform-native meaning |
| advertiser_categories | platform-native meaning |
| platform | Source platform identifier, the same as platform in the request (for example xiaohongshu, tiktok). |

## Example

```bash
curl -X POST 'https://api.everyinfra.com/api/v1/social' \
  -H "Authorization: Bearer $EVERYINFRA_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "platform": "facebook",
  "action": "ad_detail",
  "params": {
    "url": "https://www.facebook.com/ads/library/?id=900404412649714"
  }
}'
```

```python
import os
import requests

response = requests.post(
    "https://api.everyinfra.com/api/v1/social",
    headers={"Authorization": f"Bearer {os.environ['EVERYINFRA_API_KEY']}"},
    json={
        "platform": "facebook",
        "action": "ad_detail",
        "params": {
            "url": "https://www.facebook.com/ads/library/?id=900404412649714",
        },
    },
    timeout=120,
)
print(response.status_code)
print(response.json())
```

## Response example

No real sample for these example parameters yet: structure only, every value is a placeholder (…).

```text
{
  "id": "req_…",
  "platform": "facebook",
  "action": "ad_detail",
  "results": {
    "id": …,
    "url": …,
    "is_active": …,
    "started_at": …,
    "ended_at": …,
    "text": …,
    "title": …,
    "caption": …,
    "link_url": …,
    "link_description": …,
    "cta_text": …,
    "display_format": …,
    "platforms": …,
    "media": …,
    "creatives": …,
    "variant_count": …,
    "advertiser_id": …,
    "advertiser_name": …,
    "advertiser_url": …,
    "advertiser_likes": …,
    "advertiser_avatar_url": …,
    "advertiser_categories": …,
    "platform": …
  },
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## Also

- Capability catalog (no key): https://api.everyinfra.com/api/v1/social/catalog?platform=facebook
- OpenAPI: https://everyinfra.com/openapi.json · Agents guide: https://everyinfra.com/agents.md
