Analytics & Targeting
Ads performance analytics
Summary + by-platform breakdown + daily spend chart + period-over-period trends. Date range defaults to the last 30 days. Every block here is scoped to that range, including by_campaign - unlike the campaign rows from GET /ads/campaigns, which carry a fixed 28-day total. Requires scope ads:read.
GET
/
ads
/
analytics
Ads performance analytics
curl --request GET \
--url https://api.smartlyq.com/v1/ads/analytics \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.smartlyq.com/v1/ads/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.smartlyq.com/v1/ads/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.smartlyq.com/v1/ads/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.smartlyq.com/v1/ads/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.smartlyq.com/v1/ads/analytics")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.smartlyq.com/v1/ads/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{
"success": true,
"data": {
"summary": {
"spent": 1284.5,
"impressions": 482130,
"clicks": 9210,
"conversions": 340,
"leads": 45,
"purchase_value": 5400,
"ctr": 1.91,
"cpc": 0.14,
"roas": 4.2
},
"by_platform": [
{
"platform": "meta",
"spent": 800,
"impressions": 300000,
"clicks": 6000,
"conversions": 220,
"leads": 30,
"purchase_value": 3500
}
],
"by_campaign": [
{
"id": 5001,
"spent": 128.4,
"impressions": 48213,
"clicks": 921,
"conversions": 34,
"leads": 12,
"purchase_value": 540,
"ctr": 1.91,
"cpa": 3.78,
"roas": 4.2
}
],
"spend_chart": {
"labels": [
"2026-08-25",
"2026-08-26"
],
"datasets": {
"meta": [
123
],
"google": [
123
],
"tiktok": [
123
],
"linkedin": [
123
]
}
},
"trends": {
"spent": 12.4,
"impressions": 5.1,
"clicks": -2.3,
"conversions": 8,
"leads": 0,
"purchase_value": 15.6
}
},
"meta": {
"request_id": "req_9f3a2b1c-7d4e-4a08-b2c6-5e1f8a9d0c34",
"timestamp": "2026-07-26T09:41:22Z"
}
}Authorizations
API key from Developer dashboard (Bearer token).
Query Parameters
Example:
"2026-08-01"
Example:
"2026-08-26"
Comma-separated platform:row_id pairs, e.g. meta:1,google:3. Omit for all connected accounts.
⌘I
Ads performance analytics
curl --request GET \
--url https://api.smartlyq.com/v1/ads/analytics \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.smartlyq.com/v1/ads/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.smartlyq.com/v1/ads/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.smartlyq.com/v1/ads/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.smartlyq.com/v1/ads/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.smartlyq.com/v1/ads/analytics")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.smartlyq.com/v1/ads/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{
"success": true,
"data": {
"summary": {
"spent": 1284.5,
"impressions": 482130,
"clicks": 9210,
"conversions": 340,
"leads": 45,
"purchase_value": 5400,
"ctr": 1.91,
"cpc": 0.14,
"roas": 4.2
},
"by_platform": [
{
"platform": "meta",
"spent": 800,
"impressions": 300000,
"clicks": 6000,
"conversions": 220,
"leads": 30,
"purchase_value": 3500
}
],
"by_campaign": [
{
"id": 5001,
"spent": 128.4,
"impressions": 48213,
"clicks": 921,
"conversions": 34,
"leads": 12,
"purchase_value": 540,
"ctr": 1.91,
"cpa": 3.78,
"roas": 4.2
}
],
"spend_chart": {
"labels": [
"2026-08-25",
"2026-08-26"
],
"datasets": {
"meta": [
123
],
"google": [
123
],
"tiktok": [
123
],
"linkedin": [
123
]
}
},
"trends": {
"spent": 12.4,
"impressions": 5.1,
"clicks": -2.3,
"conversions": 8,
"leads": 0,
"purchase_value": 15.6
}
},
"meta": {
"request_id": "req_9f3a2b1c-7d4e-4a08-b2c6-5e1f8a9d0c34",
"timestamp": "2026-07-26T09:41:22Z"
}
}
