curl --request POST \
--url https://app.adstellar.ai/api/v1/tools/query_performance \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"startDate": "<string>",
"endDate": "<string>",
"adAccount": "<string>",
"campaignId": "<string>",
"adSetId": "<string>",
"limit": 25,
"workspaceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "https://app.adstellar.ai/api/v1/tools/query_performance"
payload = {
"startDate": "<string>",
"endDate": "<string>",
"adAccount": "<string>",
"campaignId": "<string>",
"adSetId": "<string>",
"limit": 25,
"workspaceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
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({
startDate: '<string>',
endDate: '<string>',
adAccount: '<string>',
campaignId: '<string>',
adSetId: '<string>',
limit: 25,
workspaceId: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://app.adstellar.ai/api/v1/tools/query_performance', 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://app.adstellar.ai/api/v1/tools/query_performance",
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([
'startDate' => '<string>',
'endDate' => '<string>',
'adAccount' => '<string>',
'campaignId' => '<string>',
'adSetId' => '<string>',
'limit' => 25,
'workspaceId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]),
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://app.adstellar.ai/api/v1/tools/query_performance"
payload := strings.NewReader("{\n \"startDate\": \"<string>\",\n \"endDate\": \"<string>\",\n \"adAccount\": \"<string>\",\n \"campaignId\": \"<string>\",\n \"adSetId\": \"<string>\",\n \"limit\": 25,\n \"workspaceId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\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://app.adstellar.ai/api/v1/tools/query_performance")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"startDate\": \"<string>\",\n \"endDate\": \"<string>\",\n \"adAccount\": \"<string>\",\n \"campaignId\": \"<string>\",\n \"adSetId\": \"<string>\",\n \"limit\": 25,\n \"workspaceId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.adstellar.ai/api/v1/tools/query_performance")
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 \"startDate\": \"<string>\",\n \"endDate\": \"<string>\",\n \"adAccount\": \"<string>\",\n \"campaignId\": \"<string>\",\n \"adSetId\": \"<string>\",\n \"limit\": 25,\n \"workspaceId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}"
response = http.request(request)
puts response.read_bodyQuery synced Meta ads performance (spend, impressions, clicks, results, ROAS, budget) grouped by campaign / ad set / ad / creative component, over a date range. Use list_ad_accounts first to discover ad account ids. Data freshness depends on the team's sync schedule; check last_synced_at in list_ad_accounts.
Query synced Meta ads performance (spend, impressions, clicks, results, ROAS, budget) grouped by campaign / ad set / ad / creative component, over a date range. Use list_ad_accounts first to discover ad account ids. Data freshness depends on the team’s sync schedule; check last_synced_at in list_ad_accounts.
curl --request POST \
--url https://app.adstellar.ai/api/v1/tools/query_performance \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"startDate": "<string>",
"endDate": "<string>",
"adAccount": "<string>",
"campaignId": "<string>",
"adSetId": "<string>",
"limit": 25,
"workspaceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "https://app.adstellar.ai/api/v1/tools/query_performance"
payload = {
"startDate": "<string>",
"endDate": "<string>",
"adAccount": "<string>",
"campaignId": "<string>",
"adSetId": "<string>",
"limit": 25,
"workspaceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
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({
startDate: '<string>',
endDate: '<string>',
adAccount: '<string>',
campaignId: '<string>',
adSetId: '<string>',
limit: 25,
workspaceId: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://app.adstellar.ai/api/v1/tools/query_performance', 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://app.adstellar.ai/api/v1/tools/query_performance",
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([
'startDate' => '<string>',
'endDate' => '<string>',
'adAccount' => '<string>',
'campaignId' => '<string>',
'adSetId' => '<string>',
'limit' => 25,
'workspaceId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]),
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://app.adstellar.ai/api/v1/tools/query_performance"
payload := strings.NewReader("{\n \"startDate\": \"<string>\",\n \"endDate\": \"<string>\",\n \"adAccount\": \"<string>\",\n \"campaignId\": \"<string>\",\n \"adSetId\": \"<string>\",\n \"limit\": 25,\n \"workspaceId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\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://app.adstellar.ai/api/v1/tools/query_performance")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"startDate\": \"<string>\",\n \"endDate\": \"<string>\",\n \"adAccount\": \"<string>\",\n \"campaignId\": \"<string>\",\n \"adSetId\": \"<string>\",\n \"limit\": 25,\n \"workspaceId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.adstellar.ai/api/v1/tools/query_performance")
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 \"startDate\": \"<string>\",\n \"endDate\": \"<string>\",\n \"adAccount\": \"<string>\",\n \"campaignId\": \"<string>\",\n \"adSetId\": \"<string>\",\n \"limit\": 25,\n \"workspaceId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}"
response = http.request(request)
puts response.read_bodyAuthorizations
AdStellar API key (ast_live_...)
Body
What to group by. Default "campaign".
campaign, ad_set, ad, ad_combination, audience_variant, creative, headline, primary_text, description, cta, interest, custom_audience, lookalike, behavior, country, landing_page, audience, placement Date-range preset. Default "last_7d".
today, yesterday, last_7d, last_14d, last_30d, last_90d, mtd, last_quarter, lifetime Explicit range start (YYYY-MM-DD), use with endDate.
Explicit range end (YYYY-MM-DD).
Ad account name or id. Omit for the whole workspace.
Drill into one campaign (its ad sets or ads).
Drill into one ad set (its ads).
Max rows (default 50).
1 <= x <= 50Which workspace to query (must be one this credential can access). Omit for the primary workspace.
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$Response
Tool result