curl --request GET \
--url https://api.aisa.one/apis/v1/foreplay/brand/analytics \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.aisa.one/apis/v1/foreplay/brand/analytics"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.aisa.one/apis/v1/foreplay/brand/analytics', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.aisa.one/apis/v1/foreplay/brand/analytics",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.aisa.one/apis/v1/foreplay/brand/analytics"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.aisa.one/apis/v1/foreplay/brand/analytics")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/foreplay/brand/analytics")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"metadata": {
"success": true,
"status_code": 200,
"count": 2,
"cursor": null
},
"data": [
{
"date": "2025-01-01",
"active_count": 12,
"inactive_count": 3,
"video": 7,
"image": 5
},
{
"date": "2025-01-02",
"active_count": 14,
"inactive_count": 2,
"video": 8,
"image": 6
}
],
"error": null
}Brand Analytics
Get analytics for a brand (running-ads distribution, creative velocity) as a series of analytics rows. A successful call returns one row per day (date, active_count, inactive_count, and per-format counts).
Important: the id parameter must be a page_id / ad_library_id (obtained from the getBrandsByDomain response), NOT a Foreplay brand_id. Passing a brand_id returns HTTP 406. Flow: getBrandsByDomain(domain) -> ad_library_id -> brand/analytics(id=ad_library_id).
Date window: the window between start_date and end_date must be ≤ 30 days. A larger range returns HTTP 406 Date range too large.
Cost estimation: each returned row is 1 billed item ($0.02625). Because the response is one row per day, a 30-day window can bill up to ~30 items.
Billed $0.02625 per item returned in data[] (1 credit per item); empty results and 4xx/5xx errors are not charged.
curl --request GET \
--url https://api.aisa.one/apis/v1/foreplay/brand/analytics \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.aisa.one/apis/v1/foreplay/brand/analytics"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.aisa.one/apis/v1/foreplay/brand/analytics', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.aisa.one/apis/v1/foreplay/brand/analytics",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.aisa.one/apis/v1/foreplay/brand/analytics"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.aisa.one/apis/v1/foreplay/brand/analytics")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/foreplay/brand/analytics")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"metadata": {
"success": true,
"status_code": 200,
"count": 2,
"cursor": null
},
"data": [
{
"date": "2025-01-01",
"active_count": 12,
"inactive_count": 3,
"video": 7,
"image": 5
},
{
"date": "2025-01-02",
"active_count": 14,
"inactive_count": 2,
"video": 8,
"image": 6
}
],
"error": null
}授权
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
查询参数
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.
Page ID or Brand ID. Brand IDs are 20-25 character alphanumeric strings with mixed case. Page IDs are numeric Facebook page identifiers.
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.
newest, oldest, longest_running, most_relevant 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.
响应
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.