Search platform audiences
curl --request POST \
--url https://api.globalwebindex.com/v1/spark-api/audiences/search \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"search_term": "gen z",
"dataset_codes": [
"ds-core"
],
"exclude_audience_ids": [
"82d06fe7-b933-42f7-bd83-2d47b065fdcd"
],
"limit": 8
}
'import requests
url = "https://api.globalwebindex.com/v1/spark-api/audiences/search"
payload = {
"search_term": "gen z",
"dataset_codes": ["ds-core"],
"exclude_audience_ids": ["82d06fe7-b933-42f7-bd83-2d47b065fdcd"],
"limit": 8
}
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({
search_term: 'gen z',
dataset_codes: ['ds-core'],
exclude_audience_ids: ['82d06fe7-b933-42f7-bd83-2d47b065fdcd'],
limit: 8
})
};
fetch('https://api.globalwebindex.com/v1/spark-api/audiences/search', 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/v1/spark-api/audiences/search",
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([
'search_term' => 'gen z',
'dataset_codes' => [
'ds-core'
],
'exclude_audience_ids' => [
'82d06fe7-b933-42f7-bd83-2d47b065fdcd'
],
'limit' => 8
]),
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/v1/spark-api/audiences/search"
payload := strings.NewReader("{\n \"search_term\": \"gen z\",\n \"dataset_codes\": [\n \"ds-core\"\n ],\n \"exclude_audience_ids\": [\n \"82d06fe7-b933-42f7-bd83-2d47b065fdcd\"\n ],\n \"limit\": 8\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/v1/spark-api/audiences/search")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"search_term\": \"gen z\",\n \"dataset_codes\": [\n \"ds-core\"\n ],\n \"exclude_audience_ids\": [\n \"82d06fe7-b933-42f7-bd83-2d47b065fdcd\"\n ],\n \"limit\": 8\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.globalwebindex.com/v1/spark-api/audiences/search")
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 \"search_term\": \"gen z\",\n \"dataset_codes\": [\n \"ds-core\"\n ],\n \"exclude_audience_ids\": [\n \"82d06fe7-b933-42f7-bd83-2d47b065fdcd\"\n ],\n \"limit\": 8\n}"
response = http.request(request)
puts response.read_body{
"audiences": [
{
"id": "b9272035-d1f0-4d56-a6bb-074847702c42",
"title": "OADB: Gen Z Who Aren't Students",
"description": "This audience consists of individuals who are part of Gen Z.",
"type": "curated",
"datasets": [
"ds-core"
]
}
]
}{
"code": 400,
"message": "Bad request reason"
}{
"message": "Unauthorized"
}{
"code": 422,
"message": "Unprocessable entity reason"
}{
"code": 500,
"message": "There was an error processing your request. Please try again later."
}Audiences
Search platform audiences
Returns relevant platform audiences filtered by search term, dataset codes, and optional audience exclusions.
POST
/
v1
/
spark-api
/
audiences
/
search
Search platform audiences
curl --request POST \
--url https://api.globalwebindex.com/v1/spark-api/audiences/search \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"search_term": "gen z",
"dataset_codes": [
"ds-core"
],
"exclude_audience_ids": [
"82d06fe7-b933-42f7-bd83-2d47b065fdcd"
],
"limit": 8
}
'import requests
url = "https://api.globalwebindex.com/v1/spark-api/audiences/search"
payload = {
"search_term": "gen z",
"dataset_codes": ["ds-core"],
"exclude_audience_ids": ["82d06fe7-b933-42f7-bd83-2d47b065fdcd"],
"limit": 8
}
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({
search_term: 'gen z',
dataset_codes: ['ds-core'],
exclude_audience_ids: ['82d06fe7-b933-42f7-bd83-2d47b065fdcd'],
limit: 8
})
};
fetch('https://api.globalwebindex.com/v1/spark-api/audiences/search', 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/v1/spark-api/audiences/search",
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([
'search_term' => 'gen z',
'dataset_codes' => [
'ds-core'
],
'exclude_audience_ids' => [
'82d06fe7-b933-42f7-bd83-2d47b065fdcd'
],
'limit' => 8
]),
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/v1/spark-api/audiences/search"
payload := strings.NewReader("{\n \"search_term\": \"gen z\",\n \"dataset_codes\": [\n \"ds-core\"\n ],\n \"exclude_audience_ids\": [\n \"82d06fe7-b933-42f7-bd83-2d47b065fdcd\"\n ],\n \"limit\": 8\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/v1/spark-api/audiences/search")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"search_term\": \"gen z\",\n \"dataset_codes\": [\n \"ds-core\"\n ],\n \"exclude_audience_ids\": [\n \"82d06fe7-b933-42f7-bd83-2d47b065fdcd\"\n ],\n \"limit\": 8\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.globalwebindex.com/v1/spark-api/audiences/search")
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 \"search_term\": \"gen z\",\n \"dataset_codes\": [\n \"ds-core\"\n ],\n \"exclude_audience_ids\": [\n \"82d06fe7-b933-42f7-bd83-2d47b065fdcd\"\n ],\n \"limit\": 8\n}"
response = http.request(request)
puts response.read_body{
"audiences": [
{
"id": "b9272035-d1f0-4d56-a6bb-074847702c42",
"title": "OADB: Gen Z Who Aren't Students",
"description": "This audience consists of individuals who are part of Gen Z.",
"type": "curated",
"datasets": [
"ds-core"
]
}
]
}{
"code": 400,
"message": "Bad request reason"
}{
"message": "Unauthorized"
}{
"code": 422,
"message": "Unprocessable entity reason"
}{
"code": 500,
"message": "There was an error processing your request. Please try again later."
}Authorizations
Body
application/json
Audience search request payload.
Request payload for audience search.
Required text filter for audience title and description.
Example:
"gen z"
Optional dataset codes used to scope results.
Example:
["ds-core"]
Optional audience UUIDs to exclude from results.
Pattern:
^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$Example:
["82d06fe7-b933-42f7-bd83-2d47b065fdcd"]
Optional maximum number of audiences to return (1-100). Omit to use the service default 20.
Required range:
1 <= x <= 100Example:
8
Response
Successful response
Response payload for audience search.
Matching audiences.
Show child attributes
Show child attributes
Was this page helpful?
⌘I

