Endpoint
Overview
Fetch fresh, real-time statistics directly from TikTok/Instagram API for all accounts in your organization (or a specific org_group). This endpoint creates new stat records in the database with the latest data for each account and all their posts. This is useful when you need up-to-date statistics for multiple accounts without waiting for the scheduled refresh cycle. This endpoint also supports NDJSON streaming progress. Send theX-Stream-Progress: true header to receive line-delimited progress events instead of the standard JSON summary response.
How It Works
- Fetches all accounts in your organization (optionally filtered by org_group)
- For each account with username and type configured:
- Fetches account profile stats (followers, following) from the platform API
- Fetches stats for all posts associated with the account
- Creates an
account_statsrecord with aggregated post metrics - Creates individual
post_statsrecords for each post
- Returns summary counts of the refresh operation
Request Body
Optional. If provided, only refreshes accounts in this specific org_group
Optional. If
true, bypasses the once-per-hour rate limitOptional Request Header
Optional. When set to
true, the endpoint streams newline-delimited JSON
events with type: "start", type: "progress", and type: "done".Response
Response object containing refresh results summary
