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

# Live data examples

> Read a public profile and follow source-sized Live feed pages with cURL, Python, or TypeScript.

These examples use the [Live API](https://docs.creatoraudit.com/live-data.md), not managed tracking. Set `CREATORAUDIT_API_KEY` in your environment to a key for an eligible workspace. Enterprise workspaces do not need Stripe onboarding; self-service workspaces need active linked billing or an unexpired trial.

## Read a profile with cURL

```bash theme={null}
curl --fail-with-body --get \
  "https://api.creatoraudit.com/v2/live/instagram/profile" \
  -H "Authorization: Bearer $CREATORAUDIT_API_KEY" \
  --data-urlencode "handle=nasa"
```

For a single post, call `/live/instagram/post` or `/live/tiktok/post` with `url` instead of `handle`. Use a canonical public post URL, not a shortened link. The API reference lists all six operations.

## Follow feed pages

Use a bounded loop and preserve the opaque cursor. These examples stop after three pages, even if more are available. They intentionally omit `limit` and `include_total`: Live page sizes come from the source.

```python Python theme={null}
import asyncio
import os
from typing import Any

import httpx


async def fetch_live_posts(handle: str, max_pages: int = 3) -> list[dict[str, Any]]:
    posts: list[dict[str, Any]] = []
    cursor: str | None = None
    headers = {"Authorization": f"Bearer {os.environ['CREATORAUDIT_API_KEY']}"}
    async with httpx.AsyncClient(
        base_url="https://api.creatoraudit.com/v2/",
        headers=headers,
        timeout=60.0,
    ) as client:
        for _ in range(max_pages):
            params = {"handle": handle}
            if cursor is not None:
                params["cursor"] = cursor
            response = await client.get("live/tiktok/posts", params=params)
            response.raise_for_status()
            body = response.json()
            posts.extend(body["data"])
            page = body["pagination"]
            if not page["has_next"]:
                break
            cursor = page["next_cursor"]
    return posts


if __name__ == "__main__":
    print(asyncio.run(fetch_live_posts("nasa")))
```

```typescript TypeScript theme={null}
type LivePost = {
  type: "live_post";
  platform: "instagram" | "tiktok";
  external_id: string;
  url: string;
  like_count: number | null;
};

type LiveFeed = {
  data: LivePost[];
  pagination: { next_cursor: string | null; has_next: boolean };
  meta: { fetched_at: string; cached: false; warnings: string[] };
};

async function fetchLivePosts(
  apiKey: string,
  handle: string,
  maxPages = 3,
): Promise<LivePost[]> {
  const posts: LivePost[] = [];
  let cursor: string | null = null;
  for (let pageNumber = 0; pageNumber < maxPages; pageNumber++) {
    const url = new URL("https://api.creatoraudit.com/v2/live/tiktok/posts");
    url.searchParams.set("handle", handle);
    if (cursor !== null) url.searchParams.set("cursor", cursor);
    const response = await fetch(url, {
      headers: { Authorization: `Bearer ${apiKey}` },
      cache: "no-store",
      signal: AbortSignal.timeout(60_000),
    });
    if (!response.ok) {
      throw new Error(`HTTP ${response.status}: ${await response.text()}`);
    }
    const body: LiveFeed = await response.json();
    posts.push(...body.data);
    if (!body.pagination.has_next) break;
    cursor = body.pagination.next_cursor;
  }
  return posts;
}
```

The Python example uses `httpx`; the TypeScript example uses standard `fetch` and shows only the post fields it consumes. Run API-key examples on a trusted server, not in browser code that exposes your key.

These snippets surface failures rather than retrying indefinitely. For production, add bounded backoff for `429`, `502`, `503`, and `504`, honor `Retry-After`, and log `X-Request-ID`. Keep concurrency at or below two for the organization, and coordinate the 60-request rolling-minute Live budget across its keys. See [Rate limits](https://docs.creatoraudit.com/api-reference/rate-limits.md).

Do not convert `null` counters to zero, use `external_id` as a tracking UUID, or assume that paging yields a complete history. Live responses are `no-store`, and original media URLs may expire. Use [managed tracking](https://docs.creatoraudit.com/quickstart.md) separately if you need recurring refreshes or analytics history.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.