curl --request POST \
--url https://api.globalwebindex.com/v2/query/crosstab \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"columns": [
{
"id": "134",
"name": "my_audience",
"expression": {
"and": [
{
"question": "q2",
"datapoints": [
"q2_1",
"q2_2"
],
"min_count": 1,
"not": false
},
{
"question": "q6",
"datapoints": [
"q6_2"
],
"min_count": 1,
"not": false
}
]
}
}
],
"rows": [
{
"id": "133",
"name": "my_audience",
"expression": {
"and": [
{
"question": "q2",
"datapoints": [
"q2_1",
"q2_2"
],
"min_count": 1,
"not": false
},
{
"question": "q6",
"datapoints": [
"q6_2"
],
"min_count": 1,
"not": false
}
]
}
}
],
"locations": [
"s2_1",
"s2_44"
],
"waves": [
"q1_2019",
"q2_2019",
"q3_2019",
"q4_2019"
],
"base_audience": {
"id": "135",
"name": "my_audience",
"expression": {
"and": [
{
"question": "q2",
"datapoints": [
"q2_1",
"q2_2"
],
"min_count": 1,
"not": false
},
{
"question": "q6",
"datapoints": [
"q6_2"
],
"min_count": 1,
"not": false
}
]
}
}
}
'import requests
url = "https://api.globalwebindex.com/v2/query/crosstab"
payload = {
"columns": [
{
"id": "134",
"name": "my_audience",
"expression": { "and": [
{
"question": "q2",
"datapoints": ["q2_1", "q2_2"],
"min_count": 1,
"not": False
},
{
"question": "q6",
"datapoints": ["q6_2"],
"min_count": 1,
"not": False
}
] }
}
],
"rows": [
{
"id": "133",
"name": "my_audience",
"expression": { "and": [
{
"question": "q2",
"datapoints": ["q2_1", "q2_2"],
"min_count": 1,
"not": False
},
{
"question": "q6",
"datapoints": ["q6_2"],
"min_count": 1,
"not": False
}
] }
}
],
"locations": ["s2_1", "s2_44"],
"waves": ["q1_2019", "q2_2019", "q3_2019", "q4_2019"],
"base_audience": {
"id": "135",
"name": "my_audience",
"expression": { "and": [
{
"question": "q2",
"datapoints": ["q2_1", "q2_2"],
"min_count": 1,
"not": False
},
{
"question": "q6",
"datapoints": ["q6_2"],
"min_count": 1,
"not": False
}
] }
}
}
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({
columns: [
{
id: '134',
name: 'my_audience',
expression: {
and: [
{question: 'q2', datapoints: ['q2_1', 'q2_2'], min_count: 1, not: false},
{question: 'q6', datapoints: ['q6_2'], min_count: 1, not: false}
]
}
}
],
rows: [
{
id: '133',
name: 'my_audience',
expression: {
and: [
{question: 'q2', datapoints: ['q2_1', 'q2_2'], min_count: 1, not: false},
{question: 'q6', datapoints: ['q6_2'], min_count: 1, not: false}
]
}
}
],
locations: ['s2_1', 's2_44'],
waves: ['q1_2019', 'q2_2019', 'q3_2019', 'q4_2019'],
base_audience: {
id: '135',
name: 'my_audience',
expression: {
and: [
{question: 'q2', datapoints: ['q2_1', 'q2_2'], min_count: 1, not: false},
{question: 'q6', datapoints: ['q6_2'], min_count: 1, not: false}
]
}
}
})
};
fetch('https://api.globalwebindex.com/v2/query/crosstab', 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/query/crosstab",
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([
'columns' => [
[
'id' => '134',
'name' => 'my_audience',
'expression' => [
'and' => [
[
'question' => 'q2',
'datapoints' => [
'q2_1',
'q2_2'
],
'min_count' => 1,
'not' => false
],
[
'question' => 'q6',
'datapoints' => [
'q6_2'
],
'min_count' => 1,
'not' => false
]
]
]
]
],
'rows' => [
[
'id' => '133',
'name' => 'my_audience',
'expression' => [
'and' => [
[
'question' => 'q2',
'datapoints' => [
'q2_1',
'q2_2'
],
'min_count' => 1,
'not' => false
],
[
'question' => 'q6',
'datapoints' => [
'q6_2'
],
'min_count' => 1,
'not' => false
]
]
]
]
],
'locations' => [
's2_1',
's2_44'
],
'waves' => [
'q1_2019',
'q2_2019',
'q3_2019',
'q4_2019'
],
'base_audience' => [
'id' => '135',
'name' => 'my_audience',
'expression' => [
'and' => [
[
'question' => 'q2',
'datapoints' => [
'q2_1',
'q2_2'
],
'min_count' => 1,
'not' => false
],
[
'question' => 'q6',
'datapoints' => [
'q6_2'
],
'min_count' => 1,
'not' => false
]
]
]
]
]),
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/query/crosstab"
payload := strings.NewReader("{\n \"columns\": [\n {\n \"id\": \"134\",\n \"name\": \"my_audience\",\n \"expression\": {\n \"and\": [\n {\n \"question\": \"q2\",\n \"datapoints\": [\n \"q2_1\",\n \"q2_2\"\n ],\n \"min_count\": 1,\n \"not\": false\n },\n {\n \"question\": \"q6\",\n \"datapoints\": [\n \"q6_2\"\n ],\n \"min_count\": 1,\n \"not\": false\n }\n ]\n }\n }\n ],\n \"rows\": [\n {\n \"id\": \"133\",\n \"name\": \"my_audience\",\n \"expression\": {\n \"and\": [\n {\n \"question\": \"q2\",\n \"datapoints\": [\n \"q2_1\",\n \"q2_2\"\n ],\n \"min_count\": 1,\n \"not\": false\n },\n {\n \"question\": \"q6\",\n \"datapoints\": [\n \"q6_2\"\n ],\n \"min_count\": 1,\n \"not\": false\n }\n ]\n }\n }\n ],\n \"locations\": [\n \"s2_1\",\n \"s2_44\"\n ],\n \"waves\": [\n \"q1_2019\",\n \"q2_2019\",\n \"q3_2019\",\n \"q4_2019\"\n ],\n \"base_audience\": {\n \"id\": \"135\",\n \"name\": \"my_audience\",\n \"expression\": {\n \"and\": [\n {\n \"question\": \"q2\",\n \"datapoints\": [\n \"q2_1\",\n \"q2_2\"\n ],\n \"min_count\": 1,\n \"not\": false\n },\n {\n \"question\": \"q6\",\n \"datapoints\": [\n \"q6_2\"\n ],\n \"min_count\": 1,\n \"not\": false\n }\n ]\n }\n }\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/query/crosstab")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"columns\": [\n {\n \"id\": \"134\",\n \"name\": \"my_audience\",\n \"expression\": {\n \"and\": [\n {\n \"question\": \"q2\",\n \"datapoints\": [\n \"q2_1\",\n \"q2_2\"\n ],\n \"min_count\": 1,\n \"not\": false\n },\n {\n \"question\": \"q6\",\n \"datapoints\": [\n \"q6_2\"\n ],\n \"min_count\": 1,\n \"not\": false\n }\n ]\n }\n }\n ],\n \"rows\": [\n {\n \"id\": \"133\",\n \"name\": \"my_audience\",\n \"expression\": {\n \"and\": [\n {\n \"question\": \"q2\",\n \"datapoints\": [\n \"q2_1\",\n \"q2_2\"\n ],\n \"min_count\": 1,\n \"not\": false\n },\n {\n \"question\": \"q6\",\n \"datapoints\": [\n \"q6_2\"\n ],\n \"min_count\": 1,\n \"not\": false\n }\n ]\n }\n }\n ],\n \"locations\": [\n \"s2_1\",\n \"s2_44\"\n ],\n \"waves\": [\n \"q1_2019\",\n \"q2_2019\",\n \"q3_2019\",\n \"q4_2019\"\n ],\n \"base_audience\": {\n \"id\": \"135\",\n \"name\": \"my_audience\",\n \"expression\": {\n \"and\": [\n {\n \"question\": \"q2\",\n \"datapoints\": [\n \"q2_1\",\n \"q2_2\"\n ],\n \"min_count\": 1,\n \"not\": false\n },\n {\n \"question\": \"q6\",\n \"datapoints\": [\n \"q6_2\"\n ],\n \"min_count\": 1,\n \"not\": false\n }\n ]\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.globalwebindex.com/v2/query/crosstab")
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 \"columns\": [\n {\n \"id\": \"134\",\n \"name\": \"my_audience\",\n \"expression\": {\n \"and\": [\n {\n \"question\": \"q2\",\n \"datapoints\": [\n \"q2_1\",\n \"q2_2\"\n ],\n \"min_count\": 1,\n \"not\": false\n },\n {\n \"question\": \"q6\",\n \"datapoints\": [\n \"q6_2\"\n ],\n \"min_count\": 1,\n \"not\": false\n }\n ]\n }\n }\n ],\n \"rows\": [\n {\n \"id\": \"133\",\n \"name\": \"my_audience\",\n \"expression\": {\n \"and\": [\n {\n \"question\": \"q2\",\n \"datapoints\": [\n \"q2_1\",\n \"q2_2\"\n ],\n \"min_count\": 1,\n \"not\": false\n },\n {\n \"question\": \"q6\",\n \"datapoints\": [\n \"q6_2\"\n ],\n \"min_count\": 1,\n \"not\": false\n }\n ]\n }\n }\n ],\n \"locations\": [\n \"s2_1\",\n \"s2_44\"\n ],\n \"waves\": [\n \"q1_2019\",\n \"q2_2019\",\n \"q3_2019\",\n \"q4_2019\"\n ],\n \"base_audience\": {\n \"id\": \"135\",\n \"name\": \"my_audience\",\n \"expression\": {\n \"and\": [\n {\n \"question\": \"q2\",\n \"datapoints\": [\n \"q2_1\",\n \"q2_2\"\n ],\n \"min_count\": 1,\n \"not\": false\n },\n {\n \"question\": \"q6\",\n \"datapoints\": [\n \"q6_2\"\n ],\n \"min_count\": 1,\n \"not\": false\n }\n ]\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"audiences": {
"row": {
"audience": "<string>",
"size": 123,
"sample": 123,
"percentage": 123,
"intersect_percentage": 123
},
"column": {
"audience": "<string>",
"size": 123,
"sample": 123,
"percentage": 123,
"intersect_percentage": 123
}
},
"base": {
"size": 123,
"sample": 123
},
"intersect": {
"size": 123,
"sample": 123,
"percentage": 123,
"index": 123
},
"row": {
"id": "133",
"name": "my_audience",
"expression": {
"and": [
{
"question": "q2",
"datapoints": [
"q2_1",
"q2_2"
],
"min_count": 1,
"not": false
},
{
"question": "q6",
"datapoints": [
"q6_2"
],
"min_count": 1,
"not": false
}
]
}
},
"row_index": 123,
"column": {
"id": "134",
"name": "my_audience",
"expression": {
"and": [
{
"question": "q2",
"datapoints": [
"q2_1",
"q2_2"
],
"min_count": 1,
"not": false
},
{
"question": "q6",
"datapoints": [
"q6_2"
],
"min_count": 1,
"not": false
}
]
}
},
"column_index": 123
}v2 Crosstab Bulk Query
For any query (JSON object) with audiences and filters in request body it gives back a response with results for specific Crosstab metrics according to the query.
curl --request POST \
--url https://api.globalwebindex.com/v2/query/crosstab \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"columns": [
{
"id": "134",
"name": "my_audience",
"expression": {
"and": [
{
"question": "q2",
"datapoints": [
"q2_1",
"q2_2"
],
"min_count": 1,
"not": false
},
{
"question": "q6",
"datapoints": [
"q6_2"
],
"min_count": 1,
"not": false
}
]
}
}
],
"rows": [
{
"id": "133",
"name": "my_audience",
"expression": {
"and": [
{
"question": "q2",
"datapoints": [
"q2_1",
"q2_2"
],
"min_count": 1,
"not": false
},
{
"question": "q6",
"datapoints": [
"q6_2"
],
"min_count": 1,
"not": false
}
]
}
}
],
"locations": [
"s2_1",
"s2_44"
],
"waves": [
"q1_2019",
"q2_2019",
"q3_2019",
"q4_2019"
],
"base_audience": {
"id": "135",
"name": "my_audience",
"expression": {
"and": [
{
"question": "q2",
"datapoints": [
"q2_1",
"q2_2"
],
"min_count": 1,
"not": false
},
{
"question": "q6",
"datapoints": [
"q6_2"
],
"min_count": 1,
"not": false
}
]
}
}
}
'import requests
url = "https://api.globalwebindex.com/v2/query/crosstab"
payload = {
"columns": [
{
"id": "134",
"name": "my_audience",
"expression": { "and": [
{
"question": "q2",
"datapoints": ["q2_1", "q2_2"],
"min_count": 1,
"not": False
},
{
"question": "q6",
"datapoints": ["q6_2"],
"min_count": 1,
"not": False
}
] }
}
],
"rows": [
{
"id": "133",
"name": "my_audience",
"expression": { "and": [
{
"question": "q2",
"datapoints": ["q2_1", "q2_2"],
"min_count": 1,
"not": False
},
{
"question": "q6",
"datapoints": ["q6_2"],
"min_count": 1,
"not": False
}
] }
}
],
"locations": ["s2_1", "s2_44"],
"waves": ["q1_2019", "q2_2019", "q3_2019", "q4_2019"],
"base_audience": {
"id": "135",
"name": "my_audience",
"expression": { "and": [
{
"question": "q2",
"datapoints": ["q2_1", "q2_2"],
"min_count": 1,
"not": False
},
{
"question": "q6",
"datapoints": ["q6_2"],
"min_count": 1,
"not": False
}
] }
}
}
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({
columns: [
{
id: '134',
name: 'my_audience',
expression: {
and: [
{question: 'q2', datapoints: ['q2_1', 'q2_2'], min_count: 1, not: false},
{question: 'q6', datapoints: ['q6_2'], min_count: 1, not: false}
]
}
}
],
rows: [
{
id: '133',
name: 'my_audience',
expression: {
and: [
{question: 'q2', datapoints: ['q2_1', 'q2_2'], min_count: 1, not: false},
{question: 'q6', datapoints: ['q6_2'], min_count: 1, not: false}
]
}
}
],
locations: ['s2_1', 's2_44'],
waves: ['q1_2019', 'q2_2019', 'q3_2019', 'q4_2019'],
base_audience: {
id: '135',
name: 'my_audience',
expression: {
and: [
{question: 'q2', datapoints: ['q2_1', 'q2_2'], min_count: 1, not: false},
{question: 'q6', datapoints: ['q6_2'], min_count: 1, not: false}
]
}
}
})
};
fetch('https://api.globalwebindex.com/v2/query/crosstab', 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/query/crosstab",
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([
'columns' => [
[
'id' => '134',
'name' => 'my_audience',
'expression' => [
'and' => [
[
'question' => 'q2',
'datapoints' => [
'q2_1',
'q2_2'
],
'min_count' => 1,
'not' => false
],
[
'question' => 'q6',
'datapoints' => [
'q6_2'
],
'min_count' => 1,
'not' => false
]
]
]
]
],
'rows' => [
[
'id' => '133',
'name' => 'my_audience',
'expression' => [
'and' => [
[
'question' => 'q2',
'datapoints' => [
'q2_1',
'q2_2'
],
'min_count' => 1,
'not' => false
],
[
'question' => 'q6',
'datapoints' => [
'q6_2'
],
'min_count' => 1,
'not' => false
]
]
]
]
],
'locations' => [
's2_1',
's2_44'
],
'waves' => [
'q1_2019',
'q2_2019',
'q3_2019',
'q4_2019'
],
'base_audience' => [
'id' => '135',
'name' => 'my_audience',
'expression' => [
'and' => [
[
'question' => 'q2',
'datapoints' => [
'q2_1',
'q2_2'
],
'min_count' => 1,
'not' => false
],
[
'question' => 'q6',
'datapoints' => [
'q6_2'
],
'min_count' => 1,
'not' => false
]
]
]
]
]),
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/query/crosstab"
payload := strings.NewReader("{\n \"columns\": [\n {\n \"id\": \"134\",\n \"name\": \"my_audience\",\n \"expression\": {\n \"and\": [\n {\n \"question\": \"q2\",\n \"datapoints\": [\n \"q2_1\",\n \"q2_2\"\n ],\n \"min_count\": 1,\n \"not\": false\n },\n {\n \"question\": \"q6\",\n \"datapoints\": [\n \"q6_2\"\n ],\n \"min_count\": 1,\n \"not\": false\n }\n ]\n }\n }\n ],\n \"rows\": [\n {\n \"id\": \"133\",\n \"name\": \"my_audience\",\n \"expression\": {\n \"and\": [\n {\n \"question\": \"q2\",\n \"datapoints\": [\n \"q2_1\",\n \"q2_2\"\n ],\n \"min_count\": 1,\n \"not\": false\n },\n {\n \"question\": \"q6\",\n \"datapoints\": [\n \"q6_2\"\n ],\n \"min_count\": 1,\n \"not\": false\n }\n ]\n }\n }\n ],\n \"locations\": [\n \"s2_1\",\n \"s2_44\"\n ],\n \"waves\": [\n \"q1_2019\",\n \"q2_2019\",\n \"q3_2019\",\n \"q4_2019\"\n ],\n \"base_audience\": {\n \"id\": \"135\",\n \"name\": \"my_audience\",\n \"expression\": {\n \"and\": [\n {\n \"question\": \"q2\",\n \"datapoints\": [\n \"q2_1\",\n \"q2_2\"\n ],\n \"min_count\": 1,\n \"not\": false\n },\n {\n \"question\": \"q6\",\n \"datapoints\": [\n \"q6_2\"\n ],\n \"min_count\": 1,\n \"not\": false\n }\n ]\n }\n }\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/query/crosstab")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"columns\": [\n {\n \"id\": \"134\",\n \"name\": \"my_audience\",\n \"expression\": {\n \"and\": [\n {\n \"question\": \"q2\",\n \"datapoints\": [\n \"q2_1\",\n \"q2_2\"\n ],\n \"min_count\": 1,\n \"not\": false\n },\n {\n \"question\": \"q6\",\n \"datapoints\": [\n \"q6_2\"\n ],\n \"min_count\": 1,\n \"not\": false\n }\n ]\n }\n }\n ],\n \"rows\": [\n {\n \"id\": \"133\",\n \"name\": \"my_audience\",\n \"expression\": {\n \"and\": [\n {\n \"question\": \"q2\",\n \"datapoints\": [\n \"q2_1\",\n \"q2_2\"\n ],\n \"min_count\": 1,\n \"not\": false\n },\n {\n \"question\": \"q6\",\n \"datapoints\": [\n \"q6_2\"\n ],\n \"min_count\": 1,\n \"not\": false\n }\n ]\n }\n }\n ],\n \"locations\": [\n \"s2_1\",\n \"s2_44\"\n ],\n \"waves\": [\n \"q1_2019\",\n \"q2_2019\",\n \"q3_2019\",\n \"q4_2019\"\n ],\n \"base_audience\": {\n \"id\": \"135\",\n \"name\": \"my_audience\",\n \"expression\": {\n \"and\": [\n {\n \"question\": \"q2\",\n \"datapoints\": [\n \"q2_1\",\n \"q2_2\"\n ],\n \"min_count\": 1,\n \"not\": false\n },\n {\n \"question\": \"q6\",\n \"datapoints\": [\n \"q6_2\"\n ],\n \"min_count\": 1,\n \"not\": false\n }\n ]\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.globalwebindex.com/v2/query/crosstab")
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 \"columns\": [\n {\n \"id\": \"134\",\n \"name\": \"my_audience\",\n \"expression\": {\n \"and\": [\n {\n \"question\": \"q2\",\n \"datapoints\": [\n \"q2_1\",\n \"q2_2\"\n ],\n \"min_count\": 1,\n \"not\": false\n },\n {\n \"question\": \"q6\",\n \"datapoints\": [\n \"q6_2\"\n ],\n \"min_count\": 1,\n \"not\": false\n }\n ]\n }\n }\n ],\n \"rows\": [\n {\n \"id\": \"133\",\n \"name\": \"my_audience\",\n \"expression\": {\n \"and\": [\n {\n \"question\": \"q2\",\n \"datapoints\": [\n \"q2_1\",\n \"q2_2\"\n ],\n \"min_count\": 1,\n \"not\": false\n },\n {\n \"question\": \"q6\",\n \"datapoints\": [\n \"q6_2\"\n ],\n \"min_count\": 1,\n \"not\": false\n }\n ]\n }\n }\n ],\n \"locations\": [\n \"s2_1\",\n \"s2_44\"\n ],\n \"waves\": [\n \"q1_2019\",\n \"q2_2019\",\n \"q3_2019\",\n \"q4_2019\"\n ],\n \"base_audience\": {\n \"id\": \"135\",\n \"name\": \"my_audience\",\n \"expression\": {\n \"and\": [\n {\n \"question\": \"q2\",\n \"datapoints\": [\n \"q2_1\",\n \"q2_2\"\n ],\n \"min_count\": 1,\n \"not\": false\n },\n {\n \"question\": \"q6\",\n \"datapoints\": [\n \"q6_2\"\n ],\n \"min_count\": 1,\n \"not\": false\n }\n ]\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"audiences": {
"row": {
"audience": "<string>",
"size": 123,
"sample": 123,
"percentage": 123,
"intersect_percentage": 123
},
"column": {
"audience": "<string>",
"size": 123,
"sample": 123,
"percentage": 123,
"intersect_percentage": 123
}
},
"base": {
"size": 123,
"sample": 123
},
"intersect": {
"size": 123,
"sample": 123,
"percentage": 123,
"index": 123
},
"row": {
"id": "133",
"name": "my_audience",
"expression": {
"and": [
{
"question": "q2",
"datapoints": [
"q2_1",
"q2_2"
],
"min_count": 1,
"not": false
},
{
"question": "q6",
"datapoints": [
"q6_2"
],
"min_count": 1,
"not": false
}
]
}
},
"row_index": 123,
"column": {
"id": "134",
"name": "my_audience",
"expression": {
"and": [
{
"question": "q2",
"datapoints": [
"q2_1",
"q2_2"
],
"min_count": 1,
"not": false
},
{
"question": "q6",
"datapoints": [
"q6_2"
],
"min_count": 1,
"not": false
}
]
}
},
"column_index": 123
}Authorizations
Body
Crosstab query.
Audiences and filters as parameters for Crosstab Builder metrics.
Object of row and column audiences to make intersection from. If only one audience is queried then the base audience is taken as the second audience. If no audience is queried then base audience is taken for both row and column audiences.
Show child attributes
Show child attributes
Object of row and column audiences to make intersection from. If only one audience is queried then the base audience is taken as the second audience. If no audience is queried then base audience is taken for both row and column audiences.
Show child attributes
Show child attributes
List of location codes to filter.
["s2_1", "s2_44"]List of wave codes to filter. If not set or empty, will default to last 4 accessible waves. This differs from other endpoints where the default is all accessible waves because of performance reasons.
["q1_2019", "q2_2019", "q3_2019", "q4_2019"]Wrapper structure containing AudienceExpression.
Show child attributes
Show child attributes
Response
Unordered stream of query responses as json objects.
Result for an intersection of row and column audiences identified by its index starting from 0.
Show child attributes
Show child attributes
Metrics of base audience used for intersection
Show child attributes
Show child attributes
Metrics of intersection of queried audiences.
Show child attributes
Show child attributes
Wrapper structure containing AudienceExpression.
Show child attributes
Show child attributes
Index to specific row audience defined by the request. If the value is equal to 0, then the audience used was "All base respondents".
Wrapper structure containing AudienceExpression.
Show child attributes
Show child attributes
Index to specific column audience defined by the request. If the value is equal to 0, then the audience used was "All base respondents".
Was this page helpful?

