Skip to main content
Analytics

Get post analytics

With postId, returns analytics for a single post. Without postId, returns a paginated list of published posts with analytics. Accepts both PostPeer post IDs and external platform post IDs (auto-resolved). fromDate defaults to 90 days ago if omitted, max range 366 days. Each call costs 1 credit.

GET/v1/analytics/

Authorization

accessKey
x-access-key<token>

In: header

Query Parameters

postId?string

PostPeer post ID or external platform post ID (auto-resolved). When omitted, returns a paginated list of all published posts with analytics.

platform?string
Value in"twitter" | "instagram" | "youtube" | "tiktok" | "pinterest" | "linkedin" | "bluesky"
accountId?string

Integration ID. Required for external ID lookups and source=platform.

source?string

Where the result came from. "postpeer" = posts published via PostPeer (stored in our DB). "platform" = fetched directly from the connected platform account.

Value in"postpeer" | "platform"
fromDate?string

Inclusive start date (YYYY-MM-DD). Defaults to 90 days ago.

Formatdate
toDate?string

Inclusive end date (YYYY-MM-DD). Defaults to today.

Formatdate
sortBy?string

Sort results by this metric

Default"date"
Value in"date" | "likes" | "comments" | "impressions" | "views" | "shares" | "saves" | "clicks" | "engagement"
order?string
Value in"asc" | "desc"
limit?integer

Page size (1-100)

Default50
Range1 <= value <= 100
page?integer

Page number

Default1
Range1 <= value

Response Body

application/json

application/json

application/json

application/json

curl -X GET "https://api.postpeer.dev/v1/analytics/"
{
  "success": true,
  "post": {
    "source": "postpeer",
    "postId": "string",
    "content": "string",
    "publishedAt": "2019-08-24T14:15:22Z",
    "aggregated": {
      "impressions": 0,
      "reach": 0,
      "likes": 0,
      "comments": 0,
      "shares": 0,
      "saves": 0,
      "clicks": 0,
      "views": 0,
      "engagementRate": 0
    },
    "platforms": [
      {
        "platform": "twitter",
        "platformPostId": "string",
        "platformPostUrl": "string",
        "metrics": {
          "impressions": 0,
          "reach": 0,
          "likes": 0,
          "comments": 0,
          "shares": 0,
          "saves": 0,
          "clicks": 0,
          "views": 0,
          "engagementRate": 0
        }
      }
    ]
  }
}
{
  "success": true,
  "message": "string"
}
{
  "success": true,
  "message": "string"
}
{
  "success": true,
  "message": "string"
}