Histogram from global index
GET
api/v1/search/histogram/:typeRetrieve the distribution of the number of search results for a given search query. Histograms can be made for distribution over time or over specific metrics.
Path Parameters
- type string requiredExample: published
Query Parameters
- q string required
The query to search for.
Example: cats AND dogs - min string
Minimum value for bins
- max string
Maximum value for bins
- min_include string
Include min value. Allowed values: true or false. Default value: true.
- max_include string
Include max value. Allowed values: true or false. Default value: false.
- interval string
Bin Interval. Duration for published and search_indexed / Integer for histogram / not used for distribution.
- timezone string
Timezone for the duration interval (e.g. Europe/Luxembourg). Allowed values are timezone names. Default value: UTC
Example: UTC - breakdown string
Nested histogram. Allowed values: sentiment, sourcetype, country.
Example: sentiment - value_type string
Nested metric for time based histograms.
Example: engagement - top_n integer
Size limiter for demographic distribution.
Example: 10
Responses
- 200
OK
- application/json
- Schema
- Example (from schema)
- Example
Schema
- object
{}
{
"request": "GET /api/v1/search/histogram/published?q=cats%20AND%20dogs&timezone=UTC&breakdown=sentiment&value_type=engagement&access_token=abcd_1234_abcd",
"request_id": "#r8vmw3mva1r1#",
"result_histogram": {
"data": [
{
"t": 1646870400000,
"v": [
1160,
2696,
513
],
"val": [
{
"avg": 0.631896551724138,
"count": 1160,
"max": 461,
"min": 0,
"sum": 733
},
{
"avg": 59.75445103857567,
"count": 2696,
"max": 142597,
"min": 0,
"sum": 161098
},
{
"avg": 2.539961013645224,
"count": 513,
"max": 585,
"min": 0,
"sum": 1303
}
]
},
{
"t": 1646956800000,
"v": [
821,
1941,
313
],
"val": [
{
"avg": 11.053593179049939,
"count": 821,
"max": 4062,
"min": 0,
"sum": 9075
},
{
"avg": 26.512107161257084,
"count": 1941,
"max": 39225,
"min": 0,
"sum": 51460
},
{
"avg": 2.1246006389776357,
"count": 313,
"max": 295,
"min": 0,
"sum": 665
}
]
},
{
"t": 1647043200000,
"v": [
655,
1609,
395
],
"val": [
{
"avg": 15.105343511450382,
"count": 655,
"max": 9523,
"min": 0,
"sum": 9894
},
{
"avg": 3.7408328154133,
"count": 1609,
"max": 1399,
"min": 0,
"sum": 6019
},
{
"avg": 26.2,
"count": 395,
"max": 8939,
"min": 0,
"sum": 10349
}
]
},
{
"t": 1647129600000,
"v": [
778,
1875,
565
],
"val": [
{
"avg": 0.8637532133676092,
"count": 778,
"max": 426,
"min": 0,
"sum": 672
},
{
"avg": 20.535466666666668,
"count": 1875,
"max": 30834,
"min": 0,
"sum": 38504
},
{
"avg": 0.9168141592920354,
"count": 565,
"max": 284,
"min": 0,
"sum": 518
}
]
},
{
"t": 1647216000000,
"v": [
965,
2319,
349
],
"val": [
{
"avg": 1.5430051813471504,
"count": 965,
"max": 461,
"min": 0,
"sum": 1489
},
{
"avg": 4.047003018542475,
"count": 2319,
"max": 2625,
"min": 0,
"sum": 9385
},
{
"avg": 0.498567335243553,
"count": 349,
"max": 55,
"min": 0,
"sum": 174
}
]
},
{
"t": 1647302400000,
"v": [
897,
2319,
451
],
"val": [
{
"avg": 24.37346711259755,
"count": 897,
"max": 20753,
"min": 0,
"sum": 21863
},
{
"avg": 14.813712807244501,
"count": 2319,
"max": 24738,
"min": 0,
"sum": 34353
},
{
"avg": 7.06430155210643,
"count": 451,
"max": 2800,
"min": 0,
"sum": 3186
}
]
},
{
"t": 1647388800000,
"v": [
803,
2145,
362
],
"val": [
{
"avg": 0.5180572851805728,
"count": 803,
"max": 203,
"min": 0,
"sum": 416
},
{
"avg": 2.4326340326340326,
"count": 2145,
"max": 2051,
"min": 0,
"sum": 5218
},
{
"avg": 1.0828729281767955,
"count": 362,
"max": 97,
"min": 0,
"sum": 392
}
]
},
{
"t": 1647475200000,
"v": [
140,
360,
71
],
"val": [
{
"avg": 0.21428571428571427,
"count": 140,
"max": 5,
"min": 0,
"sum": 30
},
{
"avg": 0.2111111111111111,
"count": 360,
"max": 9,
"min": 0,
"sum": 76
},
{
"avg": 0.056338028169014086,
"count": 71,
"max": 3,
"min": 0,
"sum": 4
}
]
}
],
"header": {
"v": [
"POSITIVE",
"NEUTRAL",
"NEGATIVE"
]
}
},
"status_code": "0",
"status_message": "OK"
}
Loading...