curl --request POST \
--url https://api.adside.ai/v1/workspaces/{workspaceId}/snapchat/stats/get \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"entity_id": "<string>",
"granularity": "DAY",
"fields": [
"impressions",
"swipes",
"spend",
"video_views",
"quartile_1",
"quartile_2",
"quartile_3",
"view_completion",
"conversion_purchases",
"conversion_sign_ups",
"conversion_purchases_value"
],
"start_time": "<string>",
"end_time": "<string>",
"pivot": [
"<string>"
]
}
'import requests
url = "https://api.adside.ai/v1/workspaces/{workspaceId}/snapchat/stats/get"
payload = {
"entity_id": "<string>",
"granularity": "DAY",
"fields": ["impressions", "swipes", "spend", "video_views", "quartile_1", "quartile_2", "quartile_3", "view_completion", "conversion_purchases", "conversion_sign_ups", "conversion_purchases_value"],
"start_time": "<string>",
"end_time": "<string>",
"pivot": ["<string>"]
}
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({
entity_id: '<string>',
granularity: 'DAY',
fields: [
'impressions',
'swipes',
'spend',
'video_views',
'quartile_1',
'quartile_2',
'quartile_3',
'view_completion',
'conversion_purchases',
'conversion_sign_ups',
'conversion_purchases_value'
],
start_time: '<string>',
end_time: '<string>',
pivot: ['<string>']
})
};
fetch('https://api.adside.ai/v1/workspaces/{workspaceId}/snapchat/stats/get', 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}/snapchat/stats/get",
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([
'entity_id' => '<string>',
'granularity' => 'DAY',
'fields' => [
'impressions',
'swipes',
'spend',
'video_views',
'quartile_1',
'quartile_2',
'quartile_3',
'view_completion',
'conversion_purchases',
'conversion_sign_ups',
'conversion_purchases_value'
],
'start_time' => '<string>',
'end_time' => '<string>',
'pivot' => [
'<string>'
]
]),
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}/snapchat/stats/get"
payload := strings.NewReader("{\n \"entity_id\": \"<string>\",\n \"granularity\": \"DAY\",\n \"fields\": [\n \"impressions\",\n \"swipes\",\n \"spend\",\n \"video_views\",\n \"quartile_1\",\n \"quartile_2\",\n \"quartile_3\",\n \"view_completion\",\n \"conversion_purchases\",\n \"conversion_sign_ups\",\n \"conversion_purchases_value\"\n ],\n \"start_time\": \"<string>\",\n \"end_time\": \"<string>\",\n \"pivot\": [\n \"<string>\"\n ]\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}/snapchat/stats/get")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"entity_id\": \"<string>\",\n \"granularity\": \"DAY\",\n \"fields\": [\n \"impressions\",\n \"swipes\",\n \"spend\",\n \"video_views\",\n \"quartile_1\",\n \"quartile_2\",\n \"quartile_3\",\n \"view_completion\",\n \"conversion_purchases\",\n \"conversion_sign_ups\",\n \"conversion_purchases_value\"\n ],\n \"start_time\": \"<string>\",\n \"end_time\": \"<string>\",\n \"pivot\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.adside.ai/v1/workspaces/{workspaceId}/snapchat/stats/get")
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 \"entity_id\": \"<string>\",\n \"granularity\": \"DAY\",\n \"fields\": [\n \"impressions\",\n \"swipes\",\n \"spend\",\n \"video_views\",\n \"quartile_1\",\n \"quartile_2\",\n \"quartile_3\",\n \"view_completion\",\n \"conversion_purchases\",\n \"conversion_sign_ups\",\n \"conversion_purchases_value\"\n ],\n \"start_time\": \"<string>\",\n \"end_time\": \"<string>\",\n \"pivot\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_bodyStats get
Get Snapchat delivery/reach/conversion stats for an ad account, campaign, ad squad, or ad. spend and every *_value conversion metric are returned already converted from Snapchat’s micro-currency to the ad account’s normal currency units (÷ 1,000,000).
CLI: adside snapchat stats get
curl --request POST \
--url https://api.adside.ai/v1/workspaces/{workspaceId}/snapchat/stats/get \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"entity_id": "<string>",
"granularity": "DAY",
"fields": [
"impressions",
"swipes",
"spend",
"video_views",
"quartile_1",
"quartile_2",
"quartile_3",
"view_completion",
"conversion_purchases",
"conversion_sign_ups",
"conversion_purchases_value"
],
"start_time": "<string>",
"end_time": "<string>",
"pivot": [
"<string>"
]
}
'import requests
url = "https://api.adside.ai/v1/workspaces/{workspaceId}/snapchat/stats/get"
payload = {
"entity_id": "<string>",
"granularity": "DAY",
"fields": ["impressions", "swipes", "spend", "video_views", "quartile_1", "quartile_2", "quartile_3", "view_completion", "conversion_purchases", "conversion_sign_ups", "conversion_purchases_value"],
"start_time": "<string>",
"end_time": "<string>",
"pivot": ["<string>"]
}
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({
entity_id: '<string>',
granularity: 'DAY',
fields: [
'impressions',
'swipes',
'spend',
'video_views',
'quartile_1',
'quartile_2',
'quartile_3',
'view_completion',
'conversion_purchases',
'conversion_sign_ups',
'conversion_purchases_value'
],
start_time: '<string>',
end_time: '<string>',
pivot: ['<string>']
})
};
fetch('https://api.adside.ai/v1/workspaces/{workspaceId}/snapchat/stats/get', 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}/snapchat/stats/get",
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([
'entity_id' => '<string>',
'granularity' => 'DAY',
'fields' => [
'impressions',
'swipes',
'spend',
'video_views',
'quartile_1',
'quartile_2',
'quartile_3',
'view_completion',
'conversion_purchases',
'conversion_sign_ups',
'conversion_purchases_value'
],
'start_time' => '<string>',
'end_time' => '<string>',
'pivot' => [
'<string>'
]
]),
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}/snapchat/stats/get"
payload := strings.NewReader("{\n \"entity_id\": \"<string>\",\n \"granularity\": \"DAY\",\n \"fields\": [\n \"impressions\",\n \"swipes\",\n \"spend\",\n \"video_views\",\n \"quartile_1\",\n \"quartile_2\",\n \"quartile_3\",\n \"view_completion\",\n \"conversion_purchases\",\n \"conversion_sign_ups\",\n \"conversion_purchases_value\"\n ],\n \"start_time\": \"<string>\",\n \"end_time\": \"<string>\",\n \"pivot\": [\n \"<string>\"\n ]\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}/snapchat/stats/get")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"entity_id\": \"<string>\",\n \"granularity\": \"DAY\",\n \"fields\": [\n \"impressions\",\n \"swipes\",\n \"spend\",\n \"video_views\",\n \"quartile_1\",\n \"quartile_2\",\n \"quartile_3\",\n \"view_completion\",\n \"conversion_purchases\",\n \"conversion_sign_ups\",\n \"conversion_purchases_value\"\n ],\n \"start_time\": \"<string>\",\n \"end_time\": \"<string>\",\n \"pivot\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.adside.ai/v1/workspaces/{workspaceId}/snapchat/stats/get")
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 \"entity_id\": \"<string>\",\n \"granularity\": \"DAY\",\n \"fields\": [\n \"impressions\",\n \"swipes\",\n \"spend\",\n \"video_views\",\n \"quartile_1\",\n \"quartile_2\",\n \"quartile_3\",\n \"view_completion\",\n \"conversion_purchases\",\n \"conversion_sign_ups\",\n \"conversion_purchases_value\"\n ],\n \"start_time\": \"<string>\",\n \"end_time\": \"<string>\",\n \"pivot\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_bodyAuthorizations
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
Which level of the hierarchy to pull stats for
adaccount, campaign, adsquad, ad Required for campaign/adsquad/ad. For adaccount, omit it: it defaults to the ad account this workspace is connected to, and any other account is refused.
DAY needs start_time/end_time within 31 days; HOUR within 7 days; TOTAL/LIFETIME need no date range (LIFETIME is finalized-only data).
TOTAL, DAY, HOUR, LIFETIME One call per parent: 'ad' at any level, 'adsquad' on a campaign, 'campaign' on an ad account.
ad, adsquad, campaign Metric names, e.g. impressions, swipes, spend, video_views_5s
ISO 8601, required for DAY/HOUR granularity
ISO 8601, required for DAY/HOUR granularity
Insights breakdown dimension (DAY/TOTAL/LIFETIME only)
GEO, DEMO, INTEREST, DEVICE Pivot fields for the chosen dimension, e.g. gender,age_bucket for DEMO
Default 28_DAY
1_DAY, 7_DAY, 28_DAY Default 1_DAY
none, 1_HOUR, 3_HOUR, 6_HOUR, 1_DAY, 7_DAY Response
Success