Getting started
- Introduction
- Prerequisites
- Rules of our API
- Quickstarts
Transition from V1 to V2 API
Platform API
- Reference
- Audiences
- Authorization
- Categories
- Crosstabs
- Insights
- Locations
- Namespaces
- Query
- Questions
- Splitters
- Taxonomy
- Waves
Query
v2 Stats Query
For any query (JSON object) with question, audiences and filters in request body it responses with results for chart builder metrics according the query.
POST
/
v2
/
query
/
stats
curl --request POST \
--url https://api.globalwebindex.com/v2/query/stats \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '{
"question": "q20",
"datapoints": [
"q20_3",
"q20_1",
"q20_5",
"q20_6",
"q20_7",
"q20_4",
"q20_2"
],
"suffixes": [
"1",
"2",
"3"
],
"splitter": "waves",
"segments": [
"q1_2019",
"q2_2019",
"q3_2019",
"q4_2019"
],
"segmented_base": true,
"audiences": [
{
"id": "133",
"name": "my_audience",
"expression": {
"and": [
{
"question": "q2",
"datapoints": [
"q2_1",
"q2_2"
],
"min_count": 1,
"not": false
},
{
"question": "q20",
"datapoints": [
"q20_2"
],
"min_count": 1,
"suffixes": [
"1",
"2",
"3"
],
"not": false
}
]
}
}
],
"locations": [
"s2_1",
"s2_44"
],
"waves": [
"q1_2019",
"q2_2019",
"q3_2019",
"q4_2019"
],
"base_audience": {
"id": "123",
"name": "base_audience",
"expression": {
"and": [
{
"question": "q2",
"datapoints": [
"q2_1",
"q2_2"
],
"min_count": 1,
"not": false
},
{
"question": "q20",
"datapoints": [
"q20_2"
],
"min_count": 1,
"suffixes": [
"1",
"2",
"3"
],
"not": false
}
]
}
}
}'
{
"meta": {
"type": "DATAPOINTS-SEGMENTS",
"question": "q20",
"splitter": "waves"
},
"data": [
{
"datapoint": "q20_3",
"waves": [
"q1_2019",
"q2_2019",
"q3_2019",
"q4_2019"
],
"segment": "q1_2019",
"metrics": {
"positive_size": 123,
"positive_sample": 123,
"audience_index": 123,
"audience_percentage": 123,
"audience_sample": 123,
"audience_size": 123,
"datapoint_percentage": 123,
"datapoint_sample": 123,
"datapoint_size": 123
},
"audience": "133",
"suffixes": [
1,
2,
3
]
}
]
}
Authorizations
Body
application/json
Chart builder query.
Question, audiences and filters as parameters for chart builder metrics.
Response
200
application/json
Correct results for given query.
Result of chart builder query
curl --request POST \
--url https://api.globalwebindex.com/v2/query/stats \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '{
"question": "q20",
"datapoints": [
"q20_3",
"q20_1",
"q20_5",
"q20_6",
"q20_7",
"q20_4",
"q20_2"
],
"suffixes": [
"1",
"2",
"3"
],
"splitter": "waves",
"segments": [
"q1_2019",
"q2_2019",
"q3_2019",
"q4_2019"
],
"segmented_base": true,
"audiences": [
{
"id": "133",
"name": "my_audience",
"expression": {
"and": [
{
"question": "q2",
"datapoints": [
"q2_1",
"q2_2"
],
"min_count": 1,
"not": false
},
{
"question": "q20",
"datapoints": [
"q20_2"
],
"min_count": 1,
"suffixes": [
"1",
"2",
"3"
],
"not": false
}
]
}
}
],
"locations": [
"s2_1",
"s2_44"
],
"waves": [
"q1_2019",
"q2_2019",
"q3_2019",
"q4_2019"
],
"base_audience": {
"id": "123",
"name": "base_audience",
"expression": {
"and": [
{
"question": "q2",
"datapoints": [
"q2_1",
"q2_2"
],
"min_count": 1,
"not": false
},
{
"question": "q20",
"datapoints": [
"q20_2"
],
"min_count": 1,
"suffixes": [
"1",
"2",
"3"
],
"not": false
}
]
}
}
}'
{
"meta": {
"type": "DATAPOINTS-SEGMENTS",
"question": "q20",
"splitter": "waves"
},
"data": [
{
"datapoint": "q20_3",
"waves": [
"q1_2019",
"q2_2019",
"q3_2019",
"q4_2019"
],
"segment": "q1_2019",
"metrics": {
"positive_size": 123,
"positive_sample": 123,
"audience_index": 123,
"audience_percentage": 123,
"audience_sample": 123,
"audience_size": 123,
"datapoint_percentage": 123,
"datapoint_sample": 123,
"datapoint_size": 123
},
"audience": "133",
"suffixes": [
1,
2,
3
]
}
]
}
Assistant
Responses are generated using AI and may contain mistakes.