v2 Filter Audiences
curl --request POST \
--url https://api.globalwebindex.com/v2/saved/audiences/filter \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"cursor": "base64_encoded_cursor",
"flags": [
"authored",
"curated"
],
"folder_id": "b140035b-3adc-43bf-a39d-8e8005c8af2a",
"limit": 10,
"name": "My Audience",
"offset": 0,
"sort_by": "updated_at.desc"
}
'import requests
url = "https://api.globalwebindex.com/v2/saved/audiences/filter"
payload = {
"cursor": "base64_encoded_cursor",
"flags": ["authored", "curated"],
"folder_id": "b140035b-3adc-43bf-a39d-8e8005c8af2a",
"limit": 10,
"name": "My Audience",
"offset": 0,
"sort_by": "updated_at.desc"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
cursor: 'base64_encoded_cursor',
flags: ['authored', 'curated'],
folder_id: 'b140035b-3adc-43bf-a39d-8e8005c8af2a',
limit: 10,
name: 'My Audience',
offset: 0,
sort_by: 'updated_at.desc'
})
};
fetch('https://api.globalwebindex.com/v2/saved/audiences/filter', 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.globalwebindex.com/v2/saved/audiences/filter",
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([
'cursor' => 'base64_encoded_cursor',
'flags' => [
'authored',
'curated'
],
'folder_id' => 'b140035b-3adc-43bf-a39d-8e8005c8af2a',
'limit' => 10,
'name' => 'My Audience',
'offset' => 0,
'sort_by' => 'updated_at.desc'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.globalwebindex.com/v2/saved/audiences/filter"
payload := strings.NewReader("{\n \"cursor\": \"base64_encoded_cursor\",\n \"flags\": [\n \"authored\",\n \"curated\"\n ],\n \"folder_id\": \"b140035b-3adc-43bf-a39d-8e8005c8af2a\",\n \"limit\": 10,\n \"name\": \"My Audience\",\n \"offset\": 0,\n \"sort_by\": \"updated_at.desc\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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.globalwebindex.com/v2/saved/audiences/filter")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"cursor\": \"base64_encoded_cursor\",\n \"flags\": [\n \"authored\",\n \"curated\"\n ],\n \"folder_id\": \"b140035b-3adc-43bf-a39d-8e8005c8af2a\",\n \"limit\": 10,\n \"name\": \"My Audience\",\n \"offset\": 0,\n \"sort_by\": \"updated_at.desc\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.globalwebindex.com/v2/saved/audiences/filter")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"cursor\": \"base64_encoded_cursor\",\n \"flags\": [\n \"authored\",\n \"curated\"\n ],\n \"folder_id\": \"b140035b-3adc-43bf-a39d-8e8005c8af2a\",\n \"limit\": 10,\n \"name\": \"My Audience\",\n \"offset\": 0,\n \"sort_by\": \"updated_at.desc\"\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"created_at": "<string>",
"datasets": [
"ds-core",
"ds-96c906f1"
],
"description": "Male millennials aged 18-24 who use social media daily",
"expression": {
"and": "<array>",
"datapoints": [
"q2_1"
],
"min_count": 123,
"not": false,
"options": [
"<string>"
],
"or": "<array>",
"question": "q2",
"suffixes": [
1
]
},
"flags": [
"authored"
],
"folder_id": "b140035b-3adc-43bf-a39d-8e8005c8af2a",
"id": "b140035b-3adc-43bf-a39d-8e8005c8af2a",
"name": "Male with credit card and short-term loan",
"permissions": {
"meta": {}
},
"position": 128,
"shared": false,
"sharings": {},
"updated_at": "<string>",
"user_id": 12345,
"v1_id": 12345
}
]
}"<string>""<string>""<string>"Audiences
v2 Filter Audiences
Filter audiences by name, flags, folder_id with pagination and sorting options.
POST
/
v2
/
saved
/
audiences
/
filter
v2 Filter Audiences
curl --request POST \
--url https://api.globalwebindex.com/v2/saved/audiences/filter \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"cursor": "base64_encoded_cursor",
"flags": [
"authored",
"curated"
],
"folder_id": "b140035b-3adc-43bf-a39d-8e8005c8af2a",
"limit": 10,
"name": "My Audience",
"offset": 0,
"sort_by": "updated_at.desc"
}
'import requests
url = "https://api.globalwebindex.com/v2/saved/audiences/filter"
payload = {
"cursor": "base64_encoded_cursor",
"flags": ["authored", "curated"],
"folder_id": "b140035b-3adc-43bf-a39d-8e8005c8af2a",
"limit": 10,
"name": "My Audience",
"offset": 0,
"sort_by": "updated_at.desc"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
cursor: 'base64_encoded_cursor',
flags: ['authored', 'curated'],
folder_id: 'b140035b-3adc-43bf-a39d-8e8005c8af2a',
limit: 10,
name: 'My Audience',
offset: 0,
sort_by: 'updated_at.desc'
})
};
fetch('https://api.globalwebindex.com/v2/saved/audiences/filter', 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.globalwebindex.com/v2/saved/audiences/filter",
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([
'cursor' => 'base64_encoded_cursor',
'flags' => [
'authored',
'curated'
],
'folder_id' => 'b140035b-3adc-43bf-a39d-8e8005c8af2a',
'limit' => 10,
'name' => 'My Audience',
'offset' => 0,
'sort_by' => 'updated_at.desc'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.globalwebindex.com/v2/saved/audiences/filter"
payload := strings.NewReader("{\n \"cursor\": \"base64_encoded_cursor\",\n \"flags\": [\n \"authored\",\n \"curated\"\n ],\n \"folder_id\": \"b140035b-3adc-43bf-a39d-8e8005c8af2a\",\n \"limit\": 10,\n \"name\": \"My Audience\",\n \"offset\": 0,\n \"sort_by\": \"updated_at.desc\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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.globalwebindex.com/v2/saved/audiences/filter")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"cursor\": \"base64_encoded_cursor\",\n \"flags\": [\n \"authored\",\n \"curated\"\n ],\n \"folder_id\": \"b140035b-3adc-43bf-a39d-8e8005c8af2a\",\n \"limit\": 10,\n \"name\": \"My Audience\",\n \"offset\": 0,\n \"sort_by\": \"updated_at.desc\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.globalwebindex.com/v2/saved/audiences/filter")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"cursor\": \"base64_encoded_cursor\",\n \"flags\": [\n \"authored\",\n \"curated\"\n ],\n \"folder_id\": \"b140035b-3adc-43bf-a39d-8e8005c8af2a\",\n \"limit\": 10,\n \"name\": \"My Audience\",\n \"offset\": 0,\n \"sort_by\": \"updated_at.desc\"\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"created_at": "<string>",
"datasets": [
"ds-core",
"ds-96c906f1"
],
"description": "Male millennials aged 18-24 who use social media daily",
"expression": {
"and": "<array>",
"datapoints": [
"q2_1"
],
"min_count": 123,
"not": false,
"options": [
"<string>"
],
"or": "<array>",
"question": "q2",
"suffixes": [
1
]
},
"flags": [
"authored"
],
"folder_id": "b140035b-3adc-43bf-a39d-8e8005c8af2a",
"id": "b140035b-3adc-43bf-a39d-8e8005c8af2a",
"name": "Male with credit card and short-term loan",
"permissions": {
"meta": {}
},
"position": 128,
"shared": false,
"sharings": {},
"updated_at": "<string>",
"user_id": 12345,
"v1_id": 12345
}
]
}"<string>""<string>""<string>"Authorizations
Body
application/json
Filter request body
Base64 encoded pagination cursor
Example:
"base64_encoded_cursor"
Filter by audience flags
Example:
["authored", "curated"]
Filter by folder ID
Example:
"b140035b-3adc-43bf-a39d-8e8005c8af2a"
Maximum number of results to return
Example:
10
Filter by audience name
Example:
"My Audience"
Number of results to skip
Example:
0
Sort field and order (format: field.order)
Example:
"updated_at.desc"
Response
OK
Show child attributes
Show child attributes
Was this page helpful?
⌘I

