Multiple aggregate charts
Creating a chart out of your Mentions.
If you want to retrieve several charts with identical dimensions and filters (differing only in the aggregate value calculated), you can use the multi-aggregate chart endpoint to do this with a single API call.
General Format
Multi-aggregate chart data calls are in the following format:
/data/multiAggregate/{dimension1}/{dimension2}?aggregate={aggregates}
The aggregates are the data added together on the chart. Some example aggregates are:
volume
- The number of Mentions found.reachEstimate
- The estimated reach of the Mentions.
The two dimensions are your x and y axes on the chart. Some example dimensions are:
days
- The days over which the Mentions were found.queries
- The Queries that the Mentions are located in.gender
- The gender of the authors.location
- The locations the Mentions were posted from.
For full details on the available aggregates and dimensions, see the Aggregates and dimensions page of the documentation.
Note: you can request a maximum of 10 aggregates in a single chart call
Required Parameters
The charts data call has the same three required parameters as the Mentions call:
Parameter | Definition | Accepted Values |
---|---|---|
aggregate | Aggregate values to be returned | Single aggregate or many separated by commas e.g. volume or volume,reachEstimate . See Aggregates . |
queryId / queryGroupId | The ID of the Query or Query Group that contains the Mentions for which you'd like to see. | int (can be specified multiple times) (Learn how to retrieve your Query ID or Query Group ID) |
startDate | The beginning of the date range that contains the Mentions. | YYYY-MM-DD'T'hh:mm:ss.xxx+xxxx |
endDate | The end of the date range that contains the Mentions. | YYYY-MM-DD'T'hh:mm:ss.xxx+xxxx |
Note: you can specify the time zone by replacing +xxxx
with the ISO UTC offset, e.g -0500 for New York standard time. Important: The character +
should be URL encoded to %2B
Dimension Parameters
Example Call - Volume and Reach Estimate of Mentions in a Query by Sentiment
An example call is below, which charts the volume and reach estimate of Mentions (the aggregates) for the Sentiment (the first dimension) broken down by the days (the second dimension):
curl -X GET 'https://api.brandwatch.com/projects/397263282/data/multiAggregate/sentiment/days?aggregate=volume,reachEstimate&queryId=9226732&startDate=2023-05-01&endDate=2023-05-07'
The response will look like this:
{
"dimension1": "sentiment",
"dimension2": "days",
"results": [
{
"id": "negative",
"name": "negative",
"data": {},
"values": [
{
"id": "2016-05-05T00:00:00.000+0000",
"name": "2016-05-05 00:00:00.0",
"value": {
"volume": 12,
"reachEstimate": 12
},
"data": {}
},
{
"id": "2016-05-04T00:00:00.000+0000",
"name": "2016-05-04 00:00:00.0",
"value": {
"volume": 10,
"reachEstimate": 42
},
"data": {}
},
{
"id": "2016-05-02T00:00:00.000+0000",
"name": "2016-05-02 00:00:00.0",
"value": {
"volume": 7,
"reachEstimate": 38
},
"data": {}
},
{
"id": "2016-05-01T00:00:00.000+0000",
"name": "2016-05-01 00:00:00.0",
"value": {
"volume": 19,
"reachEstimate": 100
},
"data": {}
},
{
"id": "2016-05-06T00:00:00.000+0000",
"name": "2016-05-06 00:00:00.0",
"value": {
"volume": 1,
"reachEstimate": 8
},
"data": {}
},
{
"id": "2016-05-03T00:00:00.000+0000",
"name": "2016-05-03 00:00:00.0",
"value": {
"volume": 43,
"reachEstimate": 623
},
"data": {}
}
]
},
{
"id": "neutral",
"name": "neutral",
"data": {},
"values": [
{
"id": "2016-05-05T00:00:00.000+0000",
"name": "2016-05-05 00:00:00.0",
"value": {
"volume": 18,
"reachEstimate": 128
},
"data": {}
},
{
"id": "2016-05-04T00:00:00.000+0000",
"name": "2016-05-04 00:00:00.0",
"value": {
"volume": 31,
"reachEstimate": 72
},
"data": {}
},
{
"id": "2016-05-02T00:00:00.000+0000",
"name": "2016-05-02 00:00:00.0",
"value": {
"volume": 19,
"reachEstimate": 82
},
"data": {}
},
{
"id": "2016-05-01T00:00:00.000+0000",
"name": "2016-05-01 00:00:00.0",
"value": {
"volume": 63,
"reachEstimate": 300
},
"data": {}
},
{
"id": "2016-05-06T00:00:00.000+0000",
"name": "2016-05-06 00:00:00.0",
"value": {
"volume": 10,
"reachEstimate": 22
},
"data": {}
},
{
"id": "2016-05-03T00:00:00.000+0000",
"name": "2016-05-03 00:00:00.0",
"value": {
"volume": 17,
"reachEstimate": 21
},
"data": {}
}
]
},
{
"id": "positive",
"name": "positive",
"data": {},
"values": [
{
"id": "2016-05-05T00:00:00.000+0000",
"name": "2016-05-05 00:00:00.0",
"value": {
"volume": 4,
"reachEstimate": 22
},
"data": {}
},
{
"id": "2016-05-04T00:00:00.000+0000",
"name": "2016-05-04 00:00:00.0",
"value": {
"volume": 69,
"reachEstimate": 202
},
"data": {}
},
{
"id": "2016-05-02T00:00:00.000+0000",
"name": "2016-05-02 00:00:00.0",
"value": {
"volume": 11,
"reachEstimate": 63
},
"data": {}
},
{
"id": "2016-05-01T00:00:00.000+0000",
"name": "2016-05-01 00:00:00.0",
"value": {
"volume": 2,
"reachEstimate": 64
},
"data": {}
},
{
"id": "2016-05-06T00:00:00.000+0000",
"name": "2016-05-06 00:00:00.0",
"value": {
"volume": 10,
"reachEstimate": 102
},
"data": {}
},
{
"id": "2016-05-03T00:00:00.000+0000",
"name": "2016-05-03 00:00:00.0",
"value": {
"volume": 25,
"reachEstimate": 201
},
"data": {}
}
]
}
]
}
Updated about 7 hours ago