curl --request POST \
--url https://api.adside.ai/v1/workspaces/{workspaceId}/reporting/performance/query \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"from": "<string>",
"to": "<string>",
"level": "campaign",
"metrics": [],
"orderBy": "spend",
"orderDirection": "desc",
"limit": 10,
"channels": [],
"source": "META",
"campaignName": "<string>",
"adSetName": "<string>",
"conversionEvent": "<string>",
"timeSeries": false,
"granularity": "day",
"compareWithPreviousPeriod": false
}
'import requests
url = "https://api.adside.ai/v1/workspaces/{workspaceId}/reporting/performance/query"
payload = {
"from": "<string>",
"to": "<string>",
"level": "campaign",
"metrics": [],
"orderBy": "spend",
"orderDirection": "desc",
"limit": 10,
"channels": [],
"source": "META",
"campaignName": "<string>",
"adSetName": "<string>",
"conversionEvent": "<string>",
"timeSeries": False,
"granularity": "day",
"compareWithPreviousPeriod": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
from: '<string>',
to: '<string>',
level: 'campaign',
metrics: [],
orderBy: 'spend',
orderDirection: 'desc',
limit: 10,
channels: [],
source: 'META',
campaignName: '<string>',
adSetName: '<string>',
conversionEvent: '<string>',
timeSeries: false,
granularity: 'day',
compareWithPreviousPeriod: false
})
};
fetch('https://api.adside.ai/v1/workspaces/{workspaceId}/reporting/performance/query', 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.adside.ai/v1/workspaces/{workspaceId}/reporting/performance/query",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'from' => '<string>',
'to' => '<string>',
'level' => 'campaign',
'metrics' => [
],
'orderBy' => 'spend',
'orderDirection' => 'desc',
'limit' => 10,
'channels' => [
],
'source' => 'META',
'campaignName' => '<string>',
'adSetName' => '<string>',
'conversionEvent' => '<string>',
'timeSeries' => false,
'granularity' => 'day',
'compareWithPreviousPeriod' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.adside.ai/v1/workspaces/{workspaceId}/reporting/performance/query"
payload := strings.NewReader("{\n \"from\": \"<string>\",\n \"to\": \"<string>\",\n \"level\": \"campaign\",\n \"metrics\": [],\n \"orderBy\": \"spend\",\n \"orderDirection\": \"desc\",\n \"limit\": 10,\n \"channels\": [],\n \"source\": \"META\",\n \"campaignName\": \"<string>\",\n \"adSetName\": \"<string>\",\n \"conversionEvent\": \"<string>\",\n \"timeSeries\": false,\n \"granularity\": \"day\",\n \"compareWithPreviousPeriod\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.adside.ai/v1/workspaces/{workspaceId}/reporting/performance/query")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"from\": \"<string>\",\n \"to\": \"<string>\",\n \"level\": \"campaign\",\n \"metrics\": [],\n \"orderBy\": \"spend\",\n \"orderDirection\": \"desc\",\n \"limit\": 10,\n \"channels\": [],\n \"source\": \"META\",\n \"campaignName\": \"<string>\",\n \"adSetName\": \"<string>\",\n \"conversionEvent\": \"<string>\",\n \"timeSeries\": false,\n \"granularity\": \"day\",\n \"compareWithPreviousPeriod\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.adside.ai/v1/workspaces/{workspaceId}/reporting/performance/query")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"from\": \"<string>\",\n \"to\": \"<string>\",\n \"level\": \"campaign\",\n \"metrics\": [],\n \"orderBy\": \"spend\",\n \"orderDirection\": \"desc\",\n \"limit\": 10,\n \"channels\": [],\n \"source\": \"META\",\n \"campaignName\": \"<string>\",\n \"adSetName\": \"<string>\",\n \"conversionEvent\": \"<string>\",\n \"timeSeries\": false,\n \"granularity\": \"day\",\n \"compareWithPreviousPeriod\": false\n}"
response = http.request(request)
puts response.read_body{
"text": "<string>"
}Performance query
Query ad performance
CLI: adside reporting performance query
curl --request POST \
--url https://api.adside.ai/v1/workspaces/{workspaceId}/reporting/performance/query \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"from": "<string>",
"to": "<string>",
"level": "campaign",
"metrics": [],
"orderBy": "spend",
"orderDirection": "desc",
"limit": 10,
"channels": [],
"source": "META",
"campaignName": "<string>",
"adSetName": "<string>",
"conversionEvent": "<string>",
"timeSeries": false,
"granularity": "day",
"compareWithPreviousPeriod": false
}
'import requests
url = "https://api.adside.ai/v1/workspaces/{workspaceId}/reporting/performance/query"
payload = {
"from": "<string>",
"to": "<string>",
"level": "campaign",
"metrics": [],
"orderBy": "spend",
"orderDirection": "desc",
"limit": 10,
"channels": [],
"source": "META",
"campaignName": "<string>",
"adSetName": "<string>",
"conversionEvent": "<string>",
"timeSeries": False,
"granularity": "day",
"compareWithPreviousPeriod": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
from: '<string>',
to: '<string>',
level: 'campaign',
metrics: [],
orderBy: 'spend',
orderDirection: 'desc',
limit: 10,
channels: [],
source: 'META',
campaignName: '<string>',
adSetName: '<string>',
conversionEvent: '<string>',
timeSeries: false,
granularity: 'day',
compareWithPreviousPeriod: false
})
};
fetch('https://api.adside.ai/v1/workspaces/{workspaceId}/reporting/performance/query', 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.adside.ai/v1/workspaces/{workspaceId}/reporting/performance/query",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'from' => '<string>',
'to' => '<string>',
'level' => 'campaign',
'metrics' => [
],
'orderBy' => 'spend',
'orderDirection' => 'desc',
'limit' => 10,
'channels' => [
],
'source' => 'META',
'campaignName' => '<string>',
'adSetName' => '<string>',
'conversionEvent' => '<string>',
'timeSeries' => false,
'granularity' => 'day',
'compareWithPreviousPeriod' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.adside.ai/v1/workspaces/{workspaceId}/reporting/performance/query"
payload := strings.NewReader("{\n \"from\": \"<string>\",\n \"to\": \"<string>\",\n \"level\": \"campaign\",\n \"metrics\": [],\n \"orderBy\": \"spend\",\n \"orderDirection\": \"desc\",\n \"limit\": 10,\n \"channels\": [],\n \"source\": \"META\",\n \"campaignName\": \"<string>\",\n \"adSetName\": \"<string>\",\n \"conversionEvent\": \"<string>\",\n \"timeSeries\": false,\n \"granularity\": \"day\",\n \"compareWithPreviousPeriod\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.adside.ai/v1/workspaces/{workspaceId}/reporting/performance/query")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"from\": \"<string>\",\n \"to\": \"<string>\",\n \"level\": \"campaign\",\n \"metrics\": [],\n \"orderBy\": \"spend\",\n \"orderDirection\": \"desc\",\n \"limit\": 10,\n \"channels\": [],\n \"source\": \"META\",\n \"campaignName\": \"<string>\",\n \"adSetName\": \"<string>\",\n \"conversionEvent\": \"<string>\",\n \"timeSeries\": false,\n \"granularity\": \"day\",\n \"compareWithPreviousPeriod\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.adside.ai/v1/workspaces/{workspaceId}/reporting/performance/query")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"from\": \"<string>\",\n \"to\": \"<string>\",\n \"level\": \"campaign\",\n \"metrics\": [],\n \"orderBy\": \"spend\",\n \"orderDirection\": \"desc\",\n \"limit\": 10,\n \"channels\": [],\n \"source\": \"META\",\n \"campaignName\": \"<string>\",\n \"adSetName\": \"<string>\",\n \"conversionEvent\": \"<string>\",\n \"timeSeries\": false,\n \"granularity\": \"day\",\n \"compareWithPreviousPeriod\": false\n}"
response = http.request(request)
puts response.read_body{
"text": "<string>"
}Authorizations
A personal API key (adside_pat_…) or a token from adside login. Either carries the permissions of the person it belongs to.
Path Parameters
1Body
Inclusive start date, yyyy-MM-dd.
^\d{4}-\d{2}-\d{2}$Inclusive end date, yyyy-MM-dd.
^\d{4}-\d{2}-\d{2}$What each result row represents. Defaults to campaign.
channel, campaign, ad Metrics to show per row. Defaults to spend, impressions, clicks, ctr, cpc, cpm. reach, conversions and costPerConversion need level ad.
1spend, impressions, clicks, ctr, cpc, cpm, reach, conversions, costPerConversion Metric to rank rows by. Defaults to spend.
spend, impressions, clicks, ctr, cpc, cpm, reach, conversions, costPerConversion Sort direction. Defaults to desc (highest first).
asc, desc Maximum rows to return (1-50). Defaults to 10.
1 <= x <= 50Channel filter for level channel or campaign, e.g. ["META", "GOOGLE_SEARCH"]. Omit for every channel.
META, TIKTOK, LINKEDIN, SNAPCHAT, REDDIT, GOOGLE_SEARCH, GOOGLE_SHOPPING, GOOGLE_DEMAND_GEN, GOOGLE_VIDEO, GOOGLE_DISPLAY, GOOGLE_PERFORMANCE_MAX, GOOGLE_OTHER Level ad only: the ad platform to read ads from. Defaults to META.
META, TIKTOK, GOOGLE, LINKEDIN, SNAPCHAT, REDDIT Level ad only: keep ads whose campaign name contains this.
1 - 200Level ad only: keep ads whose ad set name contains this (Meta).
1 - 200Level ad only: the platform conversion event to count (e.g. a Meta action_type). Defaults to the workspace's primary mapped conversion for that platform.
1 - 256Level channel or campaign: also return totals per time bucket.
Bucket width for the time series: day, week or month.
day, week, month Level channel or campaign: compare with the equally long period just before from.
Response
Success