Skip to main content
GET
Brand Analytics
Get analytics for a brand — running-ads distribution and creative velocity. A successful call returns one row per day in data[] (date, active_count, inactive_count, and per-format counts). Optionally scope with start_date / end_date and order. ⚠️ The id parameter must be a page_id / ad_library_id, NOT a Foreplay brand_id. Passing a brand_id returns HTTP 406. Get the ad_library_id from get_foreplay-getbrandsbydomain first. Flow: getBrandsByDomain(domain) → ad_library_id → brand/analytics(id=ad_library_id). ⚠️ Date window: the range between start_date and end_date must be ≤ 30 days. A larger range returns HTTP 406 Date range too large:
So this endpoint has two 406 cases: (1) a brand_id was passed instead of a page_id / ad_library_id, and (2) the date window exceeds 30 days. Billing: per item returned in data[]; empty results and errors are not charged. Current prices are on aisa.one/api. Because the response is one row per day, each returned row is 1 billed item — a 30-day window can bill up to ~30 items, which matters for cost estimation. A 406 (either case) is not charged. Example: resolve a domain first (e.g. getBrandsByDomain?domain=nike.com → ad_library_id: "15087023444"), then query analytics with that id: GET /foreplay/brand/analytics?id=15087023444&start_date=2025-01-01&end_date=2025-01-30. Related: get_foreplay-getbrandsbydomain, get_foreplay-getadsbybrandid, get_foreplay-discovery-ads.

Request contract

  • Method and path: GET /apis/v1/foreplay/brand/analytics
  • Availability: enabled
  • Request URL template: https://api.aisa.one/apis/v1/foreplay/brand/analytics
  • end_date: query; optional
  • id: query; required
  • order: query; optional
  • start_date: query; optional
  • Runtime facts: 799c2645862e25f3076e45d5e7d545772f57444689dd138cd88f92c37554b81c
Complete OpenAPI definition Effective request and pricing declaration (including authentication and referenced schemas):

Cost and request rules

Usage-based billing; Default request estimate: $0.875 USD (not a fixed price). Declared unit rate: $0 USD per provider_credit. Account-specific pricing and final settlement may differ. Published reference values are not an account-specific quote or a settled charge. For endpoints supporting X-AISA-Cost-Mode: quote, obtain a free quote for your exact request before execution; reconcile the settled cost with response metadata and Usage Logs. USD amounts use 1,000,000 integer micro-USD per dollar.
  • Default request reference estimate (USD): 0.875
  • Declared unit rate (USD): 0.0
  • Billing unit: provider_credit
  • Cost contract: response_count
  • Published reference multiplier: 1.0
  • Declared maximum count/units: 50
  • Settlement evidence source: response_body

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

end_date
string

End date (inclusive). Format: 'YYYY-MM-DD', 'YYYY-MM-DDTHH:MM:SS', or 'YYYY-MM-DD HH:MM:SS'. If you provide only the date (e.g. '2024-11-12'), it will be interpreted as '2024-11-12 00:00:00'. To include all results for a given day, set end_date to 'YYYY-MM-DD 23:59:59' or to the next day at '00:00:00'. Examples: start_date=2024-11-12 00:00:00, end_date=2024-11-12 23:59:59. The window between start_date and end_date must be ≤ 30 days. A larger range returns HTTP 406 Date range too large.

id
string
required

Page ID or Brand ID. Brand IDs are 20-25 character alphanumeric strings with mixed case. Page IDs are numeric Facebook page identifiers.

order
enum<string>
default:newest

Order of results: 'newest' (default), 'oldest', 'longest_running', or 'most_relevant'. Sorts ads by creation date, longest running duration, or relevance to the search query.

Available options:
newest,
oldest,
longest_running,
most_relevant
start_date
string

Start date (inclusive). Format: 'YYYY-MM-DD', 'YYYY-MM-DDTHH:MM:SS', or 'YYYY-MM-DD HH:MM:SS'. If you provide only the date (e.g. '2024-11-12'), it will be interpreted as '2024-11-12 00:00:00'. To get all ads from a specific day, set end_date to 'YYYY-MM-DD 23:59:59' or to the next day at '00:00:00'. Examples: start_date=2024-11-12 00:00:00, end_date=2024-11-12 23:59:59. The window between start_date and end_date must be ≤ 30 days. A larger range returns HTTP 406 Date range too large.

Response

JSON envelope with metadata and a data[] array of analytics rows (one row per day, each with date, active_count, inactive_count, and per-format counts). Each row in data[] counts as one billed item.

The response is of type object.