> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.simplified.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.simplified.com/_mcp/server.

# Social · Analytics · Get aggregated analytics for a social media account

GET https://api.simplified.com/api/v1/service/social-media/analytics/aggregated

Retrieve aggregated analytics metrics (totals and averages) for one or more social media accounts within a date range. At least one of account_id or account_ids must be provided.

Reference: https://docs.simplified.com/api-reference/social-media/analytics/get-social-media-analytics-aggregated

## Authentication

- `Authorization` header (required) (prefixed with ` Api-Key   `) — Header authentication of the form `Api-Key  <token>`
- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Query parameters

- `account_id` (integer, optional) — Social media account ID. Takes priority over account_ids if both provided.
- `account_ids` (string, optional) — Comma-separated list of social media account IDs (e.g. "123,456,789"). Used when account_id is not provided.
- `date_from` (date, required) — Start date in format YYYY-MM-DD
- `date_to` (date, required) — End date in format YYYY-MM-DD

## Response

### 200

Aggregated analytics metrics

- `accounts_status` (list of AnalyticsAggregatedResponseAccountsStatusItems, optional, nullable) — Per-account analytics availability for each requested `account_ids` entry. Use this to surface reconnect/enable CTAs for problematic accounts before consuming `data` (which is rolled up across the enabled accounts only).
- `data` (list of AnalyticsAggregatedResponseDataItems, optional, nullable)
- `baseLine` (AnalyticsAggregatedResponseBaseLine, optional)

## Types

### AnalyticsAggregatedResponseAccountsStatusItems

- `account_id` (integer, optional)
- `status` (enum, optional) — Analytics availability for the requested account. Values are returned UPPERCASE by the API (the gateway does not normalize them). When not `ENABLED` or `PROCESSING`, the rest of the response will typically be empty/null and the agent should surface a reconnect/enable CTA instead of rendering a chart.
  - Allowed values: `ENABLED`, `PROCESSING`, `DISABLED`, `ERROR`, `NO_PERMISSION`, `NOT_SUPPORTED`
- `account_active` (boolean, optional) — `false` when the social account itself is disconnected and needs a fresh OAuth reconnect (independent of `status`). When `false`, surface a "Reconnect account" CTA before any analytics data.

### AnalyticsAggregatedResponseDataItems

- `date` (date, optional)
- `metrics` (list of AnalyticsMetric, optional, nullable)

### AnalyticsAggregatedResponseBaseLine

- `impressions_aggregated` (AnalyticsMetric, optional) — A single metric value with its previous-period comparison value
- `engagement_aggregated` (AnalyticsMetric, optional) — A single metric value with its previous-period comparison value
- `followers_aggregated` (AnalyticsMetric, optional) — A single metric value with its previous-period comparison value
- `publishing_aggregated` (AnalyticsMetric, optional) — A single metric value with its previous-period comparison value

### AnalyticsMetric

A single metric value with its previous-period comparison value

- `id` (string, optional) — Metric identifier
- `value` (double, optional) — Value for the current period
- `prevValue` (double, optional) — Value for the equivalent previous period (same duration, shifted back)

## Examples

**Response**

```json
{
  "accounts_status": [
    {
      "account_id": 1,
      "status": "ENABLED",
      "account_active": true
    }
  ],
  "data": [
    {
      "date": "2023-01-15",
      "metrics": [
        {
          "id": "string",
          "value": 1.1,
          "prevValue": 1.1
        }
      ]
    }
  ],
  "baseLine": {
    "impressions_aggregated": {
      "id": "string",
      "value": 1.1,
      "prevValue": 1.1
    },
    "engagement_aggregated": {
      "id": "string",
      "value": 1.1,
      "prevValue": 1.1
    },
    "followers_aggregated": {
      "id": "string",
      "value": 1.1,
      "prevValue": 1.1
    },
    "publishing_aggregated": {
      "id": "string",
      "value": 1.1,
      "prevValue": 1.1
    }
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.simplified.com/api/v1/service/social-media/analytics/aggregated"

querystring = {"date_from":"date_from","date_to":"date_to"}

headers = {"Authorization": "Api-Key  <apiKey>"}

response = requests.get(url, headers=headers, params=querystring)

print(response.json())
```

```javascript
const url = 'https://api.simplified.com/api/v1/service/social-media/analytics/aggregated?date_from=date_from&date_to=date_to';
const options = {method: 'GET', headers: {Authorization: 'Api-Key  <apiKey>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.simplified.com/api/v1/service/social-media/analytics/aggregated?date_from=date_from&date_to=date_to"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Api-Key  <apiKey>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.simplified.com/api/v1/service/social-media/analytics/aggregated?date_from=date_from&date_to=date_to")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Api-Key  <apiKey>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.simplified.com/api/v1/service/social-media/analytics/aggregated?date_from=date_from&date_to=date_to")
  .header("Authorization", "Api-Key  <apiKey>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.simplified.com/api/v1/service/social-media/analytics/aggregated?date_from=date_from&date_to=date_to', [
  'headers' => [
    'Authorization' => 'Api-Key  <apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.simplified.com/api/v1/service/social-media/analytics/aggregated?date_from=date_from&date_to=date_to");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Api-Key  <apiKey>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Api-Key  <apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.simplified.com/api/v1/service/social-media/analytics/aggregated?date_from=date_from&date_to=date_to")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```