Flexible live insights query
curl --request GET \
--url https://api.aisa.one/apis/v1/ads/insights \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.aisa.one/apis/v1/ads/insights"
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/ads/insights', 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/ads/insights",
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/ads/insights"
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/ads/insights")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/ads/insights")
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{
"adAccountId": "<string>",
"customerId": "<string>",
"data": [
{}
],
"fieldMask": "<string>",
"objectId": "<string>",
"paging": {
"after": "<string>",
"nextPageToken": "<string>",
"page": 123,
"pageSize": 123,
"totalPages": 123,
"totalRows": 123
}
}{
"error": {
"code": "<string>",
"details": {},
"message": "<string>",
"param": "<string>",
"retryHint": "<string>",
"retryable": true,
"type": "<string>"
}
}Insights
Flexible live insights query
Ad Insights. Read only. Runs a custom performance query against Meta, Google Ads or TikTok and returns the platform’s rows as is, for reports the fixed endpoints don’t cover. The account’s platform picks the contract. ### Meta (facebook/instagram) Forwards caller-chosen fields, breakdowns and filtering to any Meta insights node and returns Meta’s rows verbatim. objectId (required) selects the node.
GET
https://api.aisa.one
/
apis
/
v1
/
ads
/
insights
Flexible live insights query
curl --request GET \
--url https://api.aisa.one/apis/v1/ads/insights \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.aisa.one/apis/v1/ads/insights"
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/ads/insights', 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/ads/insights",
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/ads/insights"
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/ads/insights")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/ads/insights")
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{
"adAccountId": "<string>",
"customerId": "<string>",
"data": [
{}
],
"fieldMask": "<string>",
"objectId": "<string>",
"paging": {
"after": "<string>",
"nextPageToken": "<string>",
"page": 123,
"pageSize": 123,
"totalPages": 123,
"totalRows": 123
}
}{
"error": {
"code": "<string>",
"details": {},
"message": "<string>",
"param": "<string>",
"retryHint": "<string>",
"retryable": true,
"type": "<string>"
}
}Request contract
- Method and path: GET /apis/v1/ads/insights
- Availability: enabled
- Request URL template:
https://api.aisa.one/apis/v1/ads/insights - connectionId: query; required
- objectId: query; optional
- query: query; optional
- adAccountId: query; optional
- reportType: query; optional
- dataLevel: query; optional
- dimensions: query; optional
- metrics: query; optional
- page: query; optional
- pageSize: query; optional
- customerId: query; optional
- pageToken: query; optional
- level: query; optional
- fields: query; optional
- breakdowns: query; optional
- actionBreakdowns: query; optional
- actionAttributionWindows: query; optional
- actionReportTime: query; optional
- useUnifiedAttributionSetting: query; optional
- filtering: query; optional
- datePreset: query; optional
- fromDate: query; optional
- toDate: query; optional
- timeIncrement: query; optional
- limit: query; optional
- after: query; optional
{
"operationId": "get_aisa_ads_apis_v1_ads_insights",
"method": "GET",
"path": "/apis/v1/ads/insights",
"servers": [
{
"url": "https://api.aisa.one"
}
],
"parameters": [
{
"description": "The ads connection (adc_...) the request runs on: one of yours, from GET /apis/v1/ads/connections. On a request with a JSON body it may be sent as a top-level body member instead.",
"in": "query",
"name": "connectionId",
"required": true,
"schema": {
"pattern": "^adc_[0-9A-Za-z]+$",
"type": "string"
}
},
{
"description": "Meta only (required there): insights node (act_, campaign id, ad set id or ad id). Must be yours: it is checked through the connection before the request is sent, and an id that is not yours answers not_found.",
"in": "query",
"name": "objectId",
"required": false,
"schema": {
"type": "string"
}
},
{
"description": "Google only (required there): the GAQL SELECT statement to run.",
"in": "query",
"name": "query",
"required": false,
"schema": {
"maxLength": 10000,
"type": "string"
}
},
{
"description": "Google: platform ad account ID (Google customer ID, digits only) when the connection has several Google Ads accounts. TikTok (required there): the advertiser id.",
"in": "query",
"name": "adAccountId",
"required": false,
"schema": {
"type": "string"
}
},
{
"description": "TikTok only: report_type.",
"in": "query",
"name": "reportType",
"required": false,
"schema": {
"default": "BASIC",
"enum": [
"BASIC",
"AUDIENCE"
],
"type": "string"
}
},
{
"description": "TikTok only (required there): data_level.",
"in": "query",
"name": "dataLevel",
"required": false,
"schema": {
"enum": [
"AUCTION_ADVERTISER",
"AUCTION_CAMPAIGN",
"AUCTION_ADGROUP",
"AUCTION_AD"
],
"type": "string"
}
},
{
"description": "TikTok only (required there): 1-4 comma-separated TikTok dimensions (e.g. country_code, campaign_id, stat_time_day).",
"in": "query",
"name": "dimensions",
"required": false,
"schema": {
"type": "string"
}
},
{
"description": "TikTok only (required there): comma-separated TikTok metrics (e.g. reach,impressions,frequency,spend).",
"in": "query",
"name": "metrics",
"required": false,
"schema": {
"type": "string"
}
},
{
"description": "TikTok only: page number.",
"in": "query",
"name": "page",
"required": false,
"schema": {
"default": 1,
"minimum": 1,
"type": "integer"
}
},
{
"description": "TikTok only: rows per page.",
"in": "query",
"name": "pageSize",
"required": false,
"schema": {
"default": 100,
"maximum": 1000,
"minimum": 1,
"type": "integer"
}
},
{
"description": "Alias of adAccountId, kept for existing callers",
"in": "query",
"name": "customerId",
"required": false,
"schema": {
"type": "string"
}
},
{
"description": "Google only: cursor from paging.nextPageToken of the previous page.",
"in": "query",
"name": "pageToken",
"required": false,
"schema": {
"type": "string"
}
},
{
"description": "Row granularity",
"in": "query",
"name": "level",
"required": false,
"schema": {
"enum": [
"ad",
"adset",
"campaign",
"account"
],
"type": "string"
}
},
{
"description": "Comma-separated Graph insights fields (e.g. spend,impressions,frequency,website_purchase_roas). Omitted = Meta's default set.",
"in": "query",
"name": "fields",
"required": false,
"schema": {
"type": "string"
}
},
{
"description": "Meta only: comma-separated Graph breakdowns (e.g. age,gender or publisher_platform). Returns 400 on TikTok (add the breakdown to dimensions with reportType=AUDIENCE, e.g.",
"in": "query",
"name": "breakdowns",
"required": false,
"schema": {
"type": "string"
}
},
{
"description": "Comma-separated Graph action breakdowns; segments the actions[] arrays in each row.",
"in": "query",
"name": "actionBreakdowns",
"required": false,
"schema": {
"type": "string"
}
},
{
"description": "Comma-separated Meta attribution windows. Action values are returned keyed per window.",
"in": "query",
"name": "actionAttributionWindows",
"required": false,
"schema": {
"type": "string"
}
},
{
"description": "When actions are counted: impression, conversion or mixed.",
"in": "query",
"name": "actionReportTime",
"required": false,
"schema": {
"type": "string"
}
},
{
"description": "Use the ad sets' own attribution settings for action counting.",
"in": "query",
"name": "useUnifiedAttributionSetting",
"required": false,
"schema": {
"type": "boolean"
}
},
{
"description": "JSON array of filter objects: [{\"field\", \"operator\", \"value\"}]. Applied server-side by Meta or TikTok (TikTok fields e.g. campaign_ids, adgroup_ids, ad_ids).",
"in": "query",
"name": "filtering",
"required": false,
"schema": {
"type": "string"
}
},
{
"description": "Meta date_preset (e.g. last_7d, last_30d, this_month). Mutually exclusive with fromDate/toDate.",
"in": "query",
"name": "datePreset",
"required": false,
"schema": {
"type": "string"
}
},
{
"description": "Start of range (YYYY-MM-DD); requires toDate. Required on TikTok.",
"in": "query",
"name": "fromDate",
"required": false,
"schema": {
"format": "date",
"type": "string"
}
},
{
"description": "End of range (YYYY-MM-DD); requires fromDate.",
"in": "query",
"name": "toDate",
"required": false,
"schema": {
"format": "date",
"type": "string"
}
},
{
"description": "Days per row (1-90), monthly, or all_days.",
"in": "query",
"name": "timeIncrement",
"required": false,
"schema": {
"type": "string"
}
},
{
"description": "Rows per page",
"in": "query",
"name": "limit",
"required": false,
"schema": {
"default": 25,
"maximum": 500,
"minimum": 1,
"type": "integer"
}
},
{
"description": "Cursor from paging.after of the previous page.",
"in": "query",
"name": "after",
"required": false,
"schema": {
"type": "string"
}
}
],
"security": [
{
"bearerAuth": []
}
],
"x-aisa-status": "enabled",
"components": {
"securitySchemes": {
"bearerAuth": {
"scheme": "bearer",
"type": "http"
}
}
}
}
Cost and request rules
No additional charge for this operation. Ad spend is billed separately by the ad platform to your connected ad account.Authorizations
Query Parameters
Response
Insight rows (raw platform shape)