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
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.
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
Question, audiences and filters as parameters for chart builder metrics.
Question code to define datapoint scope.
"q20"
Datapoint codes to limit scopes of interest.
[
"q20_3",
"q20_1",
"q20_5",
"q20_6",
"q20_7",
"q20_4",
"q20_2"
]
Suffixes to extend datapoint codes for more detailed responses.
["1", "2", "3"]
Either 'waves' or question code used to split results to segments.
"waves"
List of wave codes, location codes or datapoint codes used to limit which segments scopes are created.
["q1_2019", "q2_2019", "q3_2019", "q4_2019"]
Switch to use each segment as base scope when doing segmentation.
List of audiences to scope question responses.
Wrapper structure containing AudienceExpression.
"133"
"my_audience"
Flexible expression of audience scope.
List of sub-expressions to apply intersection of their scopes.
Flexible expression of audience scope.
List of sub-expressions to apply intersection of their scopes.
Flexible expression of audience scope.
List of sub-expressions to apply intersection of their scopes.
Flexible expression of audience scope.
List of sub-expressions to apply union of their scopes.
Flexible expression of audience scope.
To use negation of the expression.
Question code to define datapoint scope.
"q2"
Datapoint codes to limit scopes of interest.
["q2_1", "q2_2"]
Suffixes to extend datapoint codes for more detailed responses.
["1", "2", "3"]
Minimal count of positive datapoints in one response.
1
List of sub-expressions to apply union of their scopes.
Flexible expression of audience scope.
List of sub-expressions to apply intersection of their scopes.
Flexible expression of audience scope.
List of sub-expressions to apply union of their scopes.
Flexible expression of audience scope.
To use negation of the expression.
Question code to define datapoint scope.
"q2"
Datapoint codes to limit scopes of interest.
["q2_1", "q2_2"]
Suffixes to extend datapoint codes for more detailed responses.
["1", "2", "3"]
Minimal count of positive datapoints in one response.
1
To use negation of the expression.
Question code to define datapoint scope.
"q2"
Datapoint codes to limit scopes of interest.
["q2_1", "q2_2"]
Suffixes to extend datapoint codes for more detailed responses.
["1", "2", "3"]
Minimal count of positive datapoints in one response.
1
List of sub-expressions to apply union of their scopes.
Flexible expression of audience scope.
List of sub-expressions to apply intersection of their scopes.
Flexible expression of audience scope.
List of sub-expressions to apply intersection of their scopes.
Flexible expression of audience scope.
List of sub-expressions to apply union of their scopes.
Flexible expression of audience scope.
To use negation of the expression.
Question code to define datapoint scope.
"q2"
Datapoint codes to limit scopes of interest.
["q2_1", "q2_2"]
Suffixes to extend datapoint codes for more detailed responses.
["1", "2", "3"]
Minimal count of positive datapoints in one response.
1
List of sub-expressions to apply union of their scopes.
Flexible expression of audience scope.
List of sub-expressions to apply intersection of their scopes.
Flexible expression of audience scope.
List of sub-expressions to apply union of their scopes.
Flexible expression of audience scope.
To use negation of the expression.
Question code to define datapoint scope.
"q2"
Datapoint codes to limit scopes of interest.
["q2_1", "q2_2"]
Suffixes to extend datapoint codes for more detailed responses.
["1", "2", "3"]
Minimal count of positive datapoints in one response.
1
To use negation of the expression.
Question code to define datapoint scope.
"q2"
Datapoint codes to limit scopes of interest.
["q2_1", "q2_2"]
Suffixes to extend datapoint codes for more detailed responses.
["1", "2", "3"]
Minimal count of positive datapoints in one response.
1
To use negation of the expression.
Question code to define datapoint scope.
"q2"
Datapoint codes to limit scopes of interest.
["q2_1", "q2_2"]
Suffixes to extend datapoint codes for more detailed responses.
["1", "2", "3"]
Minimal count of positive datapoints in one response.
1
{
"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
}
]
}
List of location codes to filter.
["s2_1", "s2_44"]
List of wave codes to filter.
["q1_2019", "q2_2019", "q3_2019", "q4_2019"]
Wrapper structure containing AudienceExpression.
"123"
"base_audience"
Flexible expression of audience scope.
List of sub-expressions to apply intersection of their scopes.
Flexible expression of audience scope.
List of sub-expressions to apply intersection of their scopes.
Flexible expression of audience scope.
List of sub-expressions to apply intersection of their scopes.
Flexible expression of audience scope.
List of sub-expressions to apply union of their scopes.
Flexible expression of audience scope.
To use negation of the expression.
Question code to define datapoint scope.
"q2"
Datapoint codes to limit scopes of interest.
["q2_1", "q2_2"]
Suffixes to extend datapoint codes for more detailed responses.
["1", "2", "3"]
Minimal count of positive datapoints in one response.
1
List of sub-expressions to apply union of their scopes.
Flexible expression of audience scope.
List of sub-expressions to apply intersection of their scopes.
Flexible expression of audience scope.
List of sub-expressions to apply union of their scopes.
Flexible expression of audience scope.
To use negation of the expression.
Question code to define datapoint scope.
"q2"
Datapoint codes to limit scopes of interest.
["q2_1", "q2_2"]
Suffixes to extend datapoint codes for more detailed responses.
["1", "2", "3"]
Minimal count of positive datapoints in one response.
1
To use negation of the expression.
Question code to define datapoint scope.
"q2"
Datapoint codes to limit scopes of interest.
["q2_1", "q2_2"]
Suffixes to extend datapoint codes for more detailed responses.
["1", "2", "3"]
Minimal count of positive datapoints in one response.
1
List of sub-expressions to apply union of their scopes.
Flexible expression of audience scope.
List of sub-expressions to apply intersection of their scopes.
Flexible expression of audience scope.
List of sub-expressions to apply intersection of their scopes.
Flexible expression of audience scope.
List of sub-expressions to apply union of their scopes.
Flexible expression of audience scope.
To use negation of the expression.
Question code to define datapoint scope.
"q2"
Datapoint codes to limit scopes of interest.
["q2_1", "q2_2"]
Suffixes to extend datapoint codes for more detailed responses.
["1", "2", "3"]
Minimal count of positive datapoints in one response.
1
List of sub-expressions to apply union of their scopes.
Flexible expression of audience scope.
List of sub-expressions to apply intersection of their scopes.
Flexible expression of audience scope.
List of sub-expressions to apply union of their scopes.
Flexible expression of audience scope.
To use negation of the expression.
Question code to define datapoint scope.
"q2"
Datapoint codes to limit scopes of interest.
["q2_1", "q2_2"]
Suffixes to extend datapoint codes for more detailed responses.
["1", "2", "3"]
Minimal count of positive datapoints in one response.
1
To use negation of the expression.
Question code to define datapoint scope.
"q2"
Datapoint codes to limit scopes of interest.
["q2_1", "q2_2"]
Suffixes to extend datapoint codes for more detailed responses.
["1", "2", "3"]
Minimal count of positive datapoints in one response.
1
To use negation of the expression.
Question code to define datapoint scope.
"q2"
Datapoint codes to limit scopes of interest.
["q2_1", "q2_2"]
Suffixes to extend datapoint codes for more detailed responses.
["1", "2", "3"]
Minimal count of positive datapoints in one response.
1
{
"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
}
]
}
Response
Result of chart builder query
Metadata for chart builder query result
Query type identifier.
DATAPOINTS
, DATAPOINTS-SEGMENTS
, DATAPOINTS-AUDIENCES
, DATAPOINTS-SEGMENTS-AUDIENCES
"DATAPOINTS-SEGMENTS"
Question code taken from requested query.
"q20"
Splitter code taken from request query.
"waves"
Collection of results of chart builder query
Result of chart builder query
Datapoint code taken from requested query.
"q20_3"
Codes of all waves which are positive for responses.
["q1_2019", "q2_2019", "q3_2019", "q4_2019"]
Chart builder metrics returned for requested question.
Final weighted universe in intersection of audience and datapoint scopes.
Final count of responses in intersection of audience and datapoint scopes.
Likeliness ratio between audience and datapoint scopes.
Ratio between audience with and without datapoint scope.
Count of responses in audience without datapoint scope.
Weighted universe of audience without datapoint scope.
Ratio between datapoint with and without audience scope.
Count of responses in datapoint without audience scope.
Weighted universe of datapoint without audience scope.
Segment code used to scope results.
"q1_2019"
Audience ID taken from requested query.
"133"
Suffixes to extend datapoint codes for more detailed responses.
[1, 2, 3]
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
]
}
]
}