Get daily account metrics
curl --request GET \
--url https://api.aisa.one/apis/v1/ads/timeline \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.aisa.one/apis/v1/ads/timeline"
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/timeline', 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/timeline",
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/timeline"
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/timeline")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/ads/timeline")
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{
"backfillPending": true,
"previousRange": {
"fromDate": "2023-12-25",
"toDate": "2023-12-25"
},
"previousRows": [
{}
],
"rows": [
{
"actionValues": {},
"actions": {},
"allConversions": 123,
"clicks": 123,
"conversions": 123,
"costPerConversion": 123,
"cpc": 123,
"cpm": 123,
"ctr": 123,
"currency": "<string>",
"date": "2023-12-25",
"engagement": 123,
"impressions": 123,
"purchaseValue": 123,
"reach": 123,
"roas": 123,
"spend": 123
}
]
}{
"backfillPending": true,
"previousRange": {
"fromDate": "2023-12-25",
"toDate": "2023-12-25"
},
"previousRows": [
{}
],
"rows": [
{
"actionValues": {},
"actions": {},
"allConversions": 123,
"clicks": 123,
"conversions": 123,
"costPerConversion": 123,
"cpc": 123,
"cpm": 123,
"ctr": 123,
"currency": "<string>",
"date": "2023-12-25",
"engagement": 123,
"impressions": 123,
"purchaseValue": 123,
"reach": 123,
"roas": 123,
"spend": 123
}
]
}{
"error": {
"code": "<string>",
"details": {},
"message": "<string>",
"param": "<string>",
"retryHint": "<string>",
"retryable": true,
"type": "<string>"
}
}Insights
Get daily account metrics
Ad Campaigns. Read only. Returns an ads account’s spend, results and other metrics day by day, ready for a daily performance chart. ### Parameters connectionId is required. The lookup is sibling-expanded, so passing the metaads ID also includes ads under the linked facebook / instagram posting account (and vice-versa), the same convention as /apis/v1/ads/tree and /apis/v1/ads.
GET
https://api.aisa.one
/
apis
/
v1
/
ads
/
timeline
Get daily account metrics
curl --request GET \
--url https://api.aisa.one/apis/v1/ads/timeline \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.aisa.one/apis/v1/ads/timeline"
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/timeline', 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/timeline",
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/timeline"
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/timeline")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/ads/timeline")
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{
"backfillPending": true,
"previousRange": {
"fromDate": "2023-12-25",
"toDate": "2023-12-25"
},
"previousRows": [
{}
],
"rows": [
{
"actionValues": {},
"actions": {},
"allConversions": 123,
"clicks": 123,
"conversions": 123,
"costPerConversion": 123,
"cpc": 123,
"cpm": 123,
"ctr": 123,
"currency": "<string>",
"date": "2023-12-25",
"engagement": 123,
"impressions": 123,
"purchaseValue": 123,
"reach": 123,
"roas": 123,
"spend": 123
}
]
}{
"backfillPending": true,
"previousRange": {
"fromDate": "2023-12-25",
"toDate": "2023-12-25"
},
"previousRows": [
{}
],
"rows": [
{
"actionValues": {},
"actions": {},
"allConversions": 123,
"clicks": 123,
"conversions": 123,
"costPerConversion": 123,
"cpc": 123,
"cpm": 123,
"ctr": 123,
"currency": "<string>",
"date": "2023-12-25",
"engagement": 123,
"impressions": 123,
"purchaseValue": 123,
"reach": 123,
"roas": 123,
"spend": 123
}
]
}{
"error": {
"code": "<string>",
"details": {},
"message": "<string>",
"param": "<string>",
"retryHint": "<string>",
"retryable": true,
"type": "<string>"
}
}Request contract
- Method and path: GET /apis/v1/ads/timeline
- Availability: enabled
- Request URL template:
https://api.aisa.one/apis/v1/ads/timeline - connectionId: query; required
- adAccountId: query; optional
- fromDate: query; optional
- toDate: query; optional
- platform: query; optional
- compare: query; optional
{
"operationId": "get_aisa_ads_apis_v1_ads_timeline",
"method": "GET",
"path": "/apis/v1/ads/timeline",
"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": "Optional platform-native ad account ID (e.g. Meta `act_…`, TikTok advertiser ID). Use when the connection wraps multiple platform ad accounts and the chart should show one only.",
"in": "query",
"name": "adAccountId",
"required": false,
"schema": {
"type": "string"
}
},
{
"description": "Inclusive start of metrics range (YYYY-MM-DD). Defaults to 90 days ago.",
"in": "query",
"name": "fromDate",
"required": false,
"schema": {
"format": "date",
"type": "string"
}
},
{
"description": "Inclusive end of metrics range (YYYY-MM-DD). Defaults to today. Max 730-day range.",
"in": "query",
"name": "toDate",
"required": false,
"schema": {
"format": "date",
"type": "string"
}
},
{
"description": "Restrict to one platform.",
"in": "query",
"name": "platform",
"required": false,
"schema": {
"enum": [
"facebook",
"instagram",
"tiktok",
"linkedin",
"pinterest",
"google",
"twitter",
"openai",
"reddit",
"microsoft",
"meta",
"x"
],
"type": "string"
}
},
{
"description": "Set to `previous` to also return `previousRows` for the period of the same length that ends the day before `fromDate`, with that period as `previousRange`. Needs a `fromDate` (sent or defaulted); `toDate` alone answers 400.",
"in": "query",
"name": "compare",
"required": false,
"schema": {
"enum": [
"previous"
],
"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
Daily time series of aggregate metrics. Empty rows means the account has no ad activity in the range.