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
}
]
}
}
}'
{
"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,
"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
}
}
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
}
]
}
}
}'
{
"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,
"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
}
}
Crosstab query.
Audiences and filters as parameters for Crosstab Builder metrics.
Unordered stream of query responses as json objects.
Result for an intersection of row and column audiences identified by its index starting from 0.
Was this page helpful?