> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.simplified.com/api-reference/social-media/analytics/get-social-media-analytics-range/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 time-series analytics for specific metrics POST https://api.simplified.com/api/v1/service/social-media/analytics/range Content-Type: application/json Retrieve time-series data for selected metrics of a social media account within a date range. Available metrics depend on the social network: - **Instagram**: impressions (deprecated), views, reach, profile_views, follower_count, text_message_clicks, website_clicks, email_contacts, posts_count, accounts_engaged, profile_links_taps, replies, shares, saves, total_interactions - **Facebook**: engaged_users, post_impression, post_impression_total, post_reach_total, post_impression_paid, post_reach_paid, post_reach, page_post_engagements, new_fan, reactions, total_fans, total_follows, link_clicks, video_play, other_clicks, photo_view, posts_count, post_reach_viral, page_reach - **LinkedIn (Company)**: posts_count, impressions, unique_impressions, comments, likes, clicks, engagement, shares, allFollowers, organicFollowers, paidFollowers - **LinkedIn (Personal)**: memberFollowers, impressions, comments, reactions, shares - **Twitter/X**: posts_count, retweetCount, replyCount, likeCount, quoteCount - **YouTube**: views, comments, likes, dislikes, estimatedMinutesWatched, averageViewDuration, posts_count - **Pinterest**: engagement_rate, save, pin_click_rate, outbound_click, video_mrc_view, video_avg_watch_time, impression, engagement, video_v50_watch_time, outbound_click_rate, save_rate, quartile_95_percent_view, video_start, video_10s_view, pin_click, posts_count - **TikTok (Personal)**: posts_count, follower_count, likes_count - **TikTok Business**: posts_count, audience_genders, audience_countries, comments, shares, audience_activity, profile_views, followers_count, video_views - **Threads**: views, followers_count, likes, replies, reposts, quotes, clicks, posts_count - **Google My Business**: posts_count, queries_indirect, queries_direct, queries_chain, views_maps, views_search, actions_website, actions_phone, actions_driving_directions, business_impressions_desktop_maps, business_impressions_mobile_maps, business_impressions_mobile_search, business_impressions_desktop_search Unknown metrics are ignored by the API. Reference: https://docs.simplified.com/api-reference/social-media/analytics/get-social-media-analytics-range ## Authentication - `Authorization` header (required) (prefixed with ` Api-Key `) — Header authentication of the form `Api-Key ` - `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer `, where token is your auth token. ## Request ### Body (application/json) This endpoint expects an AnalyticsRangeRequest. - `account_id` (integer, required) — Social media account ID - `metrics` (list of enum, required) — List of metrics to retrieve. Available values depend on the social network — see endpoint description. - Allowed values: `impressions`, `views`, `reach`, `profile_views`, `follower_count`, `text_message_clicks`, `website_clicks`, `email_contacts`, `posts_count`, `accounts_engaged`, `profile_links_taps`, `replies`, `shares`, `saves`, `total_interactions`, `engaged_users`, `post_impression`, `post_impression_total`, `post_reach_total`, `post_impression_paid`, `post_reach_paid`, `post_reach`, `page_post_engagements`, `new_fan`, `reactions`, `total_fans`, `total_follows`, `link_clicks`, `video_play`, `other_clicks`, `photo_view`, `post_reach_viral`, `page_reach`, `unique_impressions`, `comments`, `likes`, `clicks`, `engagement`, `allFollowers`, `organicFollowers`, `paidFollowers`, `memberFollowers`, `retweetCount`, `replyCount`, `likeCount`, `quoteCount`, `dislikes`, `estimatedMinutesWatched`, `averageViewDuration`, `engagement_rate`, `save`, `pin_click_rate`, `outbound_click`, `video_mrc_view`, `video_avg_watch_time`, `impression`, `video_v50_watch_time`, `outbound_click_rate`, `save_rate`, `quartile_95_percent_view`, `video_start`, `video_10s_view`, `pin_click`, `likes_count`, `audience_genders`, `audience_countries`, `audience_activity`, `followers_count`, `video_views`, `reposts`, `quotes`, `queries_indirect`, `queries_direct`, `queries_chain`, `views_maps`, `views_search`, `actions_website`, `actions_phone`, `actions_driving_directions`, `business_impressions_desktop_maps`, `business_impressions_mobile_maps`, `business_impressions_mobile_search`, `business_impressions_desktop_search` - `date_from` (date, required) — Start date in format YYYY-MM-DD - `date_to` (date, required) — End date in format YYYY-MM-DD - `tz` (string, optional, default: UTC) — Timezone (e.g. UTC, Europe/Warsaw) ## Response ### 200 Time-series data for requested metrics - `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. - `data` (list of AnalyticsRangeResponseDataItems, optional, nullable) - `baseLine` (map from string to AnalyticsMetric, optional, nullable) — Aggregated totals for the requested period, keyed by metric id - `additional` (map from string to list of AnalyticsMetric, optional, nullable) — Extra metrics computed over different time windows (e.g. 28-day reach), keyed by metric id ## Types ### AnalyticsRangeResponseDataItems - `date` (date, optional) - `metrics` (list of AnalyticsMetric, optional, nullable) ### 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 **Request** ```json { "account_id": 1, "metrics": [ "impressions" ], "date_from": "2023-01-15", "date_to": "2023-01-15" } ``` **Response** ```json { "status": "ENABLED", "account_active": true, "data": [ { "date": "2023-01-15", "metrics": [ { "id": "string", "value": 1.1, "prevValue": 1.1 } ] } ], "baseLine": {}, "additional": {} } ``` **SDK Code** ```python import requests url = "https://api.simplified.com/api/v1/service/social-media/analytics/range" payload = { "account_id": 1, "metrics": ["impressions"], "date_from": "2023-01-15", "date_to": "2023-01-15" } headers = { "Authorization": "Api-Key ", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript const url = 'https://api.simplified.com/api/v1/service/social-media/analytics/range'; const options = { method: 'POST', headers: {Authorization: 'Api-Key ', 'Content-Type': 'application/json'}, body: '{"account_id":1,"metrics":["impressions"],"date_from":"2023-01-15","date_to":"2023-01-15"}' }; 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" "strings" "net/http" "io" ) func main() { url := "https://api.simplified.com/api/v1/service/social-media/analytics/range" payload := strings.NewReader("{\n \"account_id\": 1,\n \"metrics\": [\n \"impressions\"\n ],\n \"date_from\": \"2023-01-15\",\n \"date_to\": \"2023-01-15\"\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Authorization", "Api-Key ") req.Header.Add("Content-Type", "application/json") 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/range") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Authorization"] = 'Api-Key ' request["Content-Type"] = 'application/json' request.body = "{\n \"account_id\": 1,\n \"metrics\": [\n \"impressions\"\n ],\n \"date_from\": \"2023-01-15\",\n \"date_to\": \"2023-01-15\"\n}" response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.simplified.com/api/v1/service/social-media/analytics/range") .header("Authorization", "Api-Key ") .header("Content-Type", "application/json") .body("{\n \"account_id\": 1,\n \"metrics\": [\n \"impressions\"\n ],\n \"date_from\": \"2023-01-15\",\n \"date_to\": \"2023-01-15\"\n}") .asString(); ``` ```php request('POST', 'https://api.simplified.com/api/v1/service/social-media/analytics/range', [ 'body' => '{ "account_id": 1, "metrics": [ "impressions" ], "date_from": "2023-01-15", "date_to": "2023-01-15" }', 'headers' => [ 'Authorization' => 'Api-Key ', 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.simplified.com/api/v1/service/social-media/analytics/range"); var request = new RestRequest(Method.POST); request.AddHeader("Authorization", "Api-Key "); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"account_id\": 1,\n \"metrics\": [\n \"impressions\"\n ],\n \"date_from\": \"2023-01-15\",\n \"date_to\": \"2023-01-15\"\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = [ "Authorization": "Api-Key ", "Content-Type": "application/json" ] let parameters = [ "account_id": 1, "metrics": ["impressions"], "date_from": "2023-01-15", "date_to": "2023-01-15" ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.simplified.com/api/v1/service/social-media/analytics/range")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers request.httpBody = postData as Data 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() ```