> ## Documentation Index
> Fetch the complete documentation index at: https://docs.creatoraudit.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Realtime & webhooks

> CreatorAudit has no webhooks today — poll the API for near-current data

CreatorAudit does **not** offer webhooks today, and the API is not real-time.
CreatorAudit collects data on a recurring schedule, so the way to stay current is to
**poll** the endpoints you care about and read the freshness timestamps each
response carries.

<Note>
  There is no push channel and no event stream. Don't wait for a callback that won't
  arrive — design your integration around polling. See [Data freshness](/data-freshness)
  for how the refresh schedule works.
</Note>

## Why polling

Because data is collected on a schedule rather than live, the right pattern is to
re-fetch resources on a sensible interval and use the timestamps the API returns to
reason about how current each value is:

* A newly tracked account or video has `last_scrape_time: null` until its first
  refresh completes.
* Each refreshed resource reports `last_scrape_time` so you know how stale a value
  is.
* An individually tracked video carries `scrape_interval_hours`, which tells you how
  often CreatorAudit re-fetches that specific video.

## Recommended polling model

<Steps>
  <Step title="Poll on a sensible interval">
    Re-fetch the resources you track on an interval (minutes to hours, not a tight
    loop). Match your cadence to how fresh you actually need the data to be.
  </Step>

  <Step title="Read the freshness timestamp">
    On each response, check `last_scrape_time`. If it's `null`, the first refresh hasn't
    landed yet; if it's set, that's how current the value is. For individual videos, use
    `scrape_interval_hours` to decide when a re-fetch is worthwhile.
  </Step>

  <Step title="Refresh many resources at once">
    Use the batch metrics endpoints — `POST /v2/accounts/metrics`, `POST
            /v2/videos/metrics`, and `POST /v2/account-videos/metrics` — to pull windowed
    metrics for many resources in a single request instead of polling each one
    individually.
  </Step>
</Steps>

A minimal polling sketch:

```python theme={null}
import time
import httpx

BASE = "https://api.creatoraudit.com/v2"
HEADERS = {"Authorization": "Bearer YOUR_API_KEY"}

with httpx.Client(base_url=BASE, headers=HEADERS) as client:
    while True:
        account = client.get("/accounts/{id}".format(id=account_id)).json()["data"]
        if account["last_scrape_time"] is not None:
            # Refresh many resources efficiently in one call.
            metrics = client.post(
                "/accounts/metrics",
                json={"account_ids": account_ids, "period": "30d"},
            ).json()["data"]
            handle(metrics)
        time.sleep(poll_interval_seconds)
```

<Tip>
  Pair polling with conditional requests: send `If-None-Match` with the `ETag` from a
  prior response and CreatorAudit returns `304 Not Modified` when nothing changed, so
  unchanged resources cost you almost nothing.
</Tip>

## Setting expectations

Polling gives you *near-current* data, not live data. A value won't appear the
instant you create a resource, and it may lag the platform by a refresh cycle.
Anchor your logic on `last_scrape_time` rather than assuming "now", and give a newly
tracked account or video time to complete its first refresh before reporting on it.

Continue with [Data freshness](/data-freshness) and
[Best practices](/best-practices).
