# Social Analytics Insights

> Best time to post, posting frequency and engagement decay, computed from your own history

- **URL**: https://orshot.com/docs/api-reference/social-analytics-insights

---

## Overview

Returns the three computed insights from your posting history: the best time slots to post (by day of week and hour, UTC), how posting frequency relates to engagement per platform, and how fast posts stop earning engagement after publishing.

These power the "Best time to post" heatmap on the Analytics page. All three are computed from your accounts' actual engagement, not generic benchmarks.

```markdown tab="Endpoint"
https://api.orshot.com/v1/social/analytics/insights
```

## Request

**Request**
```js
await fetch("https://api.orshot.com/v1/social/analytics/insights", {
  method: "GET",
  headers: {
    Authorization: "Bearer <ORSHOT_API_KEY>",
  },
});
```

**Response**
```json
{
  "data": {
    "best_times": [
      {
        "day_of_week": 1,
        "hour_utc": 9,
        "avg_engagement": 69,
        "post_count": 1
      }
    ],
    "frequency": [
      {
        "platform": "linkedin",
        "posts_per_week": 4,
        "avg_engagement_rate": 5.5,
        "avg_engagement": 12,
        "weeks_observed": 6
      }
    ],
    "decay": [
      {
        "order": 0,
        "label": "First 24h",
        "pct_of_final_engagement": 62,
        "post_count": 18
      }
    ]
  }
}
```

`day_of_week` is Monday-first: `0` is Monday, `6` is Sunday. An insight the provider cannot compute yet (for example, too little posting history) comes back as an empty array rather than an error.

## Query Parameters

| Parameter  | Type   | Required | Description                                                                              |
| ---------- | ------ | -------- | ---------------------------------------------------------------------------------------- |
| `platform` | String | No       | Only this platform, e.g. `linkedin`                                                       |
| `account_id` | Integer | No     | Only this connected account                                                               |
| `source`   | String | No       | `all` (default), `orshot` (published through Orshot) or `external` (synced from platform) |
| `refresh`  | String | No       | Pass `1` to bypass the cache and recompute                                                |

## Error Responses

Same as the [analytics overview endpoint](https://orshot.com/docs/api-reference/social-analytics-list): `403` with code `analytics_not_enabled`, and `429` with a `Retry-After` header when the 10 requests per minute analytics budget is exhausted. An `account_id` that does not belong to the workspace returns `404`.