Audience/Segment
Estimate the reach of a set of filters
A read-only query sent as POST: estimates reach and page impressions over the last 31 days for filters that haven’t been saved yet, such as an audience being built. Nothing is stored. Send no filters to estimate across every publisher you can see.
POST
/
v1
/
segment
/
reach
Estimate the reach of a set of filters
curl --request POST \
--url https://api.tagdeliver.com/v1/segment/reach \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"contextual_category": [
"vehicles"
],
"organisation": [
3
]
}
'import requests
url = "https://api.tagdeliver.com/v1/segment/reach"
payload = {
"contextual_category": ["vehicles"],
"organisation": [3]
}
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({contextual_category: ['vehicles'], organisation: [3]})
};
fetch('https://api.tagdeliver.com/v1/segment/reach', 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.tagdeliver.com/v1/segment/reach",
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([
'contextual_category' => [
'vehicles'
],
'organisation' => [
3
]
]),
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.tagdeliver.com/v1/segment/reach"
payload := strings.NewReader("{\n \"contextual_category\": [\n \"vehicles\"\n ],\n \"organisation\": [\n 3\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.tagdeliver.com/v1/segment/reach")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"contextual_category\": [\n \"vehicles\"\n ],\n \"organisation\": [\n 3\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tagdeliver.com/v1/segment/reach")
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 \"contextual_category\": [\n \"vehicles\"\n ],\n \"organisation\": [\n 3\n ]\n}"
response = http.request(request)
puts response.read_body{
"results": {
"reach": 8200,
"impressions": 15400
},
"success": true
}{
"success": false,
"message": "Token not found."
}{
"success": false,
"message": "User forbidden"
}{
"status": 500,
"message": "An error occurred [4f2k], please try again shortly or contact your account manager for further assistance."
}Authorizations
Body
application/json
The filters, in the same shape as an audience's targets. Not validated; empty values are skipped.
Was this page helpful?
⌘I
Estimate the reach of a set of filters
curl --request POST \
--url https://api.tagdeliver.com/v1/segment/reach \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"contextual_category": [
"vehicles"
],
"organisation": [
3
]
}
'import requests
url = "https://api.tagdeliver.com/v1/segment/reach"
payload = {
"contextual_category": ["vehicles"],
"organisation": [3]
}
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({contextual_category: ['vehicles'], organisation: [3]})
};
fetch('https://api.tagdeliver.com/v1/segment/reach', 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.tagdeliver.com/v1/segment/reach",
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([
'contextual_category' => [
'vehicles'
],
'organisation' => [
3
]
]),
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.tagdeliver.com/v1/segment/reach"
payload := strings.NewReader("{\n \"contextual_category\": [\n \"vehicles\"\n ],\n \"organisation\": [\n 3\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.tagdeliver.com/v1/segment/reach")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"contextual_category\": [\n \"vehicles\"\n ],\n \"organisation\": [\n 3\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tagdeliver.com/v1/segment/reach")
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 \"contextual_category\": [\n \"vehicles\"\n ],\n \"organisation\": [\n 3\n ]\n}"
response = http.request(request)
puts response.read_body{
"results": {
"reach": 8200,
"impressions": 15400
},
"success": true
}{
"success": false,
"message": "Token not found."
}{
"success": false,
"message": "User forbidden"
}{
"status": 500,
"message": "An error occurred [4f2k], please try again shortly or contact your account manager for further assistance."
}