> ## Documentation Index
> Fetch the complete documentation index at: https://docs.postsyncer.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get analytics for multiple posts

> Fetch analytics for up to 50 posts in one request.

> [!NOTE]
>
> Needs `analytics:read`. See [Permissions](https://docs.postsyncer.com/essentials/authentication.md#permissions).

Pass `ids=4182,4183` (up to 50 post IDs) to fetch each post's totals and per-account analytics in a single request instead of polling `GET /analytics/posts/{post}` one post at a time.

## Errors

| Status | When | Retry? |
| - | - | - |
| 401 | No API key, or not a valid one. | No: fix the key. |
| 403 | The key lacks `analytics:read`, or its user is inactive. | No. |
| 422 | Missing `ids`, more than 50 IDs, or non-integer IDs. | No. |
| 429 | Rate limit reached. | Yes, after `Retry-After` seconds. |


## OpenAPI

````yaml GET /analytics/posts
openapi: 3.0.3
info:
  title: PostSyncer API
  description: >-
    Post to 12 social networks from your code: posts, media, comments,
    analytics, webhooks and more.
  version: 1.0.0
servers:
  - url: https://postsyncer.com/api/v1
security:
  - bearerAuth: []
tags:
  - name: Workspaces
    description: The workspaces the key can reach.
  - name: Accounts
    description: Connected social accounts, links to connect more, and disconnecting them.
  - name: Posts
    description: Drafts, scheduled and published posts, approvals and a post's history.
  - name: Post settings
    description: A post's auto-plug, comment moderation and contact collection.
  - name: Media
    description: >-
      The media library: file uploads, URL imports, and reading videos and
      social posts' files.
  - name: Folders
    description: Folders that organise the media library.
  - name: Comments
    description: >-
      Comments on your posts: reading, replying, editing, hiding, deleting and
      syncing them.
  - name: Reviews
    description: Google Business Profile reviews and your replies to them.
  - name: Analytics
    description: Workspace, account and post performance.
  - name: Brand
    description: >-
      A workspace's brand: identity, voice, look, accounts, competitors,
      learnings and rules.
  - name: Labels
    description: Labels used to tag posts.
  - name: Campaigns
    description: Campaigns used to group posts.
  - name: Snippets
    description: Saved snippets and hashtag groups to drop into posts.
  - name: Webhooks
    description: Signed webhook endpoints that get your notification events.
  - name: Billing
    description: >-
      The owner's plan, invoices and the links that pay for, change or cancel
      it.
  - name: Team
    description: A workspace's teammates and invitations, and their roles.
  - name: Notifications
    description: >-
      Your bell and notification settings, and the workspace's Slack, Discord
      and Telegram channels.
  - name: Blog-to-social
    description: Blog feeds that turn a workspace's new articles into posts.
  - name: Products
    description: Products the workspace's posts can promote.
  - name: Contacts
    description: People who commented on the workspace's posts, and the lists they are on.
  - name: Profile
    description: 'The key''s user: their name and sign-in email.'
  - name: API keys
    description: 'Your API keys: listing and deleting them.'
  - name: Agent sign-up
    description: >-
      An AI agent signs a person up with a code emailed to them, and gets their
      first key. No key needed.
paths:
  /analytics/posts:
    get:
      tags:
        - Analytics
      summary: Get analytics for multiple posts
      description: >-
        Needs `analytics:read`. Batch read of up to 50 posts' analytics in one
        request (`ids=1,2,3`). Returns the same per-post shape as `GET
        /analytics/posts/{post}`, omitting IDs that do not exist or are outside
        your accessible workspaces.
      operationId: getBatchPostAnalytics
      parameters:
        - name: ids
          in: query
          required: true
          description: Comma-separated list of 1 to 50 post IDs (e.g. `4182,4183`).
          schema:
            type: string
            example: 4182,4183
      responses:
        '200':
          description: Analytics for the requested posts.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        post_id:
                          type: integer
                        total:
                          $ref: '#/components/schemas/AnalyticsTotals'
                        accounts:
                          type: array
                          items:
                            $ref: '#/components/schemas/AnalyticsPostAccountRow'
              examples:
                default:
                  summary: Batch post analytics
                  value:
                    data:
                      - post_id: 4182
                        total:
                          comments: 19
                          likes: 312
                          shares: 14
                          impressions: 4970
                          quotes: 0
                          saves: 34
                          views: 0
                          reach: 4270
                          clicks: 41
                          profile_visits: 56
                          engagement_rate: 8.45
                        accounts: []
        '401':
          $ref: '#/components/responses/Unauthorized401'
        '403':
          description: The key lacks `analytics:read` or its user is inactive.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                missing_permission:
                  summary: The key lacks analytics:read
                  value:
                    message: >-
                      This API key does not have the "analytics:read"
                      permission. Edit the key in PostSyncer under Settings →
                      API to grant it.
        '422':
          description: Missing `ids`, more than 50 IDs, or invalid post IDs.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                invalid_ids:
                  summary: Invalid ids query parameter
                  value:
                    message: >-
                      Provide between 1 and 50 valid post IDs (comma-separated
                      or array).
        '429':
          $ref: '#/components/responses/RateLimited429'
      x-codeSamples:
        - lang: bash
          label: cURL
          source: |-
            curl 'https://postsyncer.com/api/v1/analytics/posts?ids=4182,4183' \
              -H 'Authorization: Bearer YOUR_API_KEY'
        - lang: javascript
          label: JavaScript
          source: >-
            const response = await
            fetch('https://postsyncer.com/api/v1/analytics/posts?ids=4182,4183',
            {
              headers: { Authorization: 'Bearer YOUR_API_KEY' },
            });

            const data = await response.json();
        - lang: python
          label: Python
          source: |-
            import requests

            response = requests.get(
                'https://postsyncer.com/api/v1/analytics/posts?ids=4182,4183',
                headers={'Authorization': 'Bearer YOUR_API_KEY'},
            )
            data = response.json()
        - lang: php
          label: PHP
          source: |-
            $response = Http::withToken('YOUR_API_KEY')
                ->get('https://postsyncer.com/api/v1/analytics/posts?ids=4182,4183');
            $data = $response->json();
components:
  schemas:
    AnalyticsTotals:
      type: object
      description: >-
        Totals of the published copies counted: each counter summed over the
        copies whose network reports it (0 when none does).
      required:
        - comments
        - likes
        - shares
        - impressions
        - quotes
        - saves
        - views
        - reach
        - clicks
        - profile_visits
        - engagement_rate
      properties:
        comments:
          type: integer
          description: Comments and replies.
        likes:
          type: integer
          description: Likes and reactions.
        shares:
          type: integer
          description: Shares plus reposts (retweets, boosts).
        impressions:
          type: integer
          description: >-
            Views of the post: its impressions or views, as the app shows them
            under Views. Engagement rate divides by this.
        quotes:
          type: integer
          description: Quote posts.
        saves:
          type: integer
          description: Saves and bookmarks.
        views:
          type: integer
          description: Video views, where the network counts them apart from `impressions`.
        reach:
          type: integer
          description: Accounts reached, where the network reports it.
        clicks:
          type: integer
          description: Link or pin clicks.
        profile_visits:
          type: integer
          description: Profile visits from the post.
        engagement_rate:
          type: number
          format: float
          nullable: true
          description: >-
            A percent with 2 decimals (5.23 means 5.23%): (likes + comments +
            shares + quotes + saves + clicks) ÷ impressions × 100. Worked out
            from the summed numbers of the copies that have impressions, never
            an average of their rates. Null when no copy has impressions.
    AnalyticsPostAccountRow:
      type: object
      description: One copy of the post, on one connected account.
      required:
        - platform_post_id
        - post_id
        - account_id
        - platform
        - status
        - post_url
        - analytics
        - account
      properties:
        platform_post_id:
          type: integer
          description: The copy's id (`platforms[].id` on the post).
        post_id:
          type: integer
        account_id:
          type: integer
          nullable: true
        platform:
          type: string
          description: The network, like `instagram`.
        status:
          type: string
          enum:
            - PENDING
            - IN_PROGRESS
            - PUBLISHED
            - FAILED
          description: The copy's status.
        post_url:
          type: string
          nullable: true
          description: The post on the network, once published.
        analytics:
          type: object
          nullable: true
          allOf:
            - $ref: '#/components/schemas/AnalyticsCopy'
          description: The numbers; null on a copy that is not published.
        account:
          type: object
          nullable: true
          allOf:
            - $ref: '#/components/schemas/Account'
          description: >-
            The account, as [Get an account](/api-reference/accounts/get) gives
            it; null when it is gone.
    Error:
      type: object
      description: >-
        An error answer. Every one has `message`, in plain words; some add an
        `error` code and fields of their own.
      required:
        - message
      properties:
        message:
          type: string
          description: What went wrong and what to do about it.
        error:
          type: string
          description: >-
            A code a few errors add, such as `rate_limited`. See [Handle
            errors](/essentials/error-handling#answers-with-an-error-code).
    AnalyticsCopy:
      type: object
      description: >-
        One published copy's numbers, as last read from its network. A counter
        the network doesn't report for this kind of post is null, not 0 (for
        example impressions on Bluesky and Mastodon, reach on TikTok).
      required:
        - comments
        - likes
        - shares
        - impressions
        - quotes
        - saves
        - views
        - reach
        - clicks
        - profile_visits
        - engagement_rate
        - pending
        - synced_at
      properties:
        comments:
          type: integer
          nullable: true
          description: Comments and replies.
        likes:
          type: integer
          nullable: true
          description: Likes and reactions.
        shares:
          type: integer
          nullable: true
          description: Shares plus reposts (retweets, boosts).
        impressions:
          type: integer
          nullable: true
          description: >-
            Views of the post: its impressions or views, as the app shows them
            under Views. Engagement rate divides by this.
        quotes:
          type: integer
          nullable: true
          description: Quote posts.
        saves:
          type: integer
          nullable: true
          description: Saves and bookmarks.
        views:
          type: integer
          nullable: true
          description: Video views, where the network counts them apart from `impressions`.
        reach:
          type: integer
          nullable: true
          description: Accounts reached, where the network reports it.
        clicks:
          type: integer
          nullable: true
          description: Link or pin clicks.
        profile_visits:
          type: integer
          nullable: true
          description: Profile visits from the post.
        engagement_rate:
          type: number
          format: float
          nullable: true
          description: >-
            A percent with 2 decimals (5.23 means 5.23%): (likes + comments +
            shares + quotes + saves + clicks) ÷ impressions × 100. Null without
            impressions.
        pending:
          type: boolean
          description: >-
            True until the copy's numbers were read from the network once; its
            counters are 0 until then.
        synced_at:
          type: string
          format: date-time
          nullable: true
          description: >-
            When the numbers were last read, ISO 8601; null before the first
            read.
    Account:
      type: object
      description: A connected social account.
      required:
        - id
        - workspace_id
        - platform
        - username
        - name
        - avatar
        - has_expired
        - needs_reconnect
        - reconnect_reason
        - platform_hold
        - renewal_failing
        - sign_in_ends_at
        - profile_url
        - is_default
        - support_threads
        - is_verified
        - plan_allows_posting
        - analytics_unavailable
      properties:
        id:
          type: integer
          description: The account's id. Posts take it in `accounts[].id`.
        workspace_id:
          type: integer
        platform:
          type: string
          enum:
            - twitter
            - linkedin
            - instagram
            - facebook
            - tiktok
            - youtube
            - threads
            - pinterest
            - bluesky
            - telegram
            - mastodon
            - google_business
          description: >-
            The network. `twitter` is X; `google_business` is Google Business
            Profile.
        username:
          type: string
          nullable: true
          description: >-
            The handle on the network, without `@` (a Mastodon handle includes
            its server).
        name:
          type: string
          nullable: true
          description: The display name on the network.
        avatar:
          type: string
          description: >-
            The profile picture, or an avatar made from the name when there is
            none.
        has_expired:
          type: boolean
          description: The same as `needs_reconnect`, kept for older integrations.
        needs_reconnect:
          type: boolean
          description: >-
            True when the sign-in no longer works, so the account can't post
            until someone reconnects it in PostSyncer. A new post leaves it out
            and lists it in `skipped_accounts`.
        reconnect_reason:
          type: string
          nullable: true
          description: >-
            The network's reason the account needs reconnecting, when it gave
            one. Null when `needs_reconnect` is false.
        platform_hold:
          type: object
          nullable: true
          description: >-
            Set when the network holds the account until its owner acts there
            (an identity check, a lock, a suspension, a restriction, the bot
            removed from a channel). The sign-in still works, so no reconnect is
            needed: posts to it fail with the network's reason until the hold is
            resolved there, and trying a failed post again asks the network
            again. Null when not held.
          required:
            - reason
            - scope
            - since
            - next_check_at
          properties:
            reason:
              type: string
              nullable: true
              description: The network's own words.
            scope:
              type: string
              nullable: true
              enum:
                - publish
                - all
                - null
              description: >-
                `publish`: only posting is held. `all`: everything the account
                does is.
            since:
              type: string
              format: date-time
              nullable: true
              description: When the network first refused.
            next_check_at:
              type: string
              format: date-time
              nullable: true
              description: >-
                When PostSyncer asks the network again (every 3 hours). Null
                while a retry is letting posts through.
        renewal_failing:
          type: object
          nullable: true
          description: >-
            Set when the network refused to renew a sign-in that still works.
            The account keeps posting until `works_until`; if the renewal is
            still refused then, it needs a reconnect. Null when renewals are
            fine.
          required:
            - reason
            - since
            - works_until
          properties:
            reason:
              type: string
              nullable: true
              description: The network's reason for refusing.
            since:
              type: string
              format: date-time
              nullable: true
              description: When the renewal was first refused.
            works_until:
              type: string
              format: date-time
              nullable: true
              description: >-
                When the sign-in stops working. Reconnect the account before
                then.
        sign_in_ends_at:
          type: string
          format: date-time
          nullable: true
          description: >-
            When the network ends this sign-in whatever PostSyncer does
            (LinkedIn: a year after it was connected). Reconnect the account
            before then. Null when the network doesn't say.
        profile_url:
          type: string
          nullable: true
          description: >-
            The account's own page on its network. Null when PostSyncer can't
            make one, for example a Mastodon account without its server, or a
            Telegram channel with no public name.
        is_default:
          type: boolean
          description: Whether the account is picked by default for new posts.
        support_threads:
          type: boolean
          nullable: true
          description: >-
            Whether a post can be a thread of several parts on this network (X,
            Threads, Bluesky and Mastodon).
        is_verified:
          type: boolean
          nullable: true
          description: >-
            Whether the network marks the account verified (X only; false
            elsewhere).
        plan_allows_posting:
          type: boolean
          description: >-
            False when the owner's plan doesn't let new posts go to this account
            (Free after the first week: 2 picked accounts). Drafts, replies and
            analytics still work.
        can_publish_articles:
          type: boolean
          description: >-
            X accounts only: true when X lets the account publish Articles (X
            Premium or Premium+). Absent for other networks.
        analytics_unavailable:
          type: object
          nullable: true
          description: >-
            Why this account's post numbers can't be read, or null when they
            can. Its posts' numbers are not read meanwhile.
          required:
            - reason
            - message
          properties:
            reason:
              type: string
              enum:
                - x_private
                - linkedin_reconnect
                - pinterest_not_business
                - google_business_no_post_stats
                - telegram_private
              description: >-
                `x_private`: a private X account. `linkedin_reconnect`: a
                LinkedIn profile on the older connection; reconnect it.
                `pinterest_not_business`: not a Pinterest business account.
                `google_business_no_post_stats`: Google gives numbers for a
                location, never for one post. `telegram_private`: a private
                Telegram channel shows no views (subscribers are still counted).
            message:
              type: string
              description: The same, in words to show a person.
        is_page:
          type: boolean
          description: >-
            LinkedIn accounts only: true for a Company Page, false for a person.
            Absent for other networks.
        location:
          type: object
          description: >-
            Google Business Profile accounts only: the location this account is.
            Absent for other networks.
          required:
            - address
            - verified
            - can_post
            - maps_uri
            - new_review_uri
          properties:
            address:
              type: string
              nullable: true
            verified:
              type: boolean
              description: Whether Google verified the location.
            can_post:
              type: boolean
              description: Whether Google lets the location publish posts.
            maps_uri:
              type: string
              nullable: true
              description: The location on Google Maps.
            new_review_uri:
              type: string
              nullable: true
              description: The link that opens Google's form for a new review.
        boards:
          type: array
          description: >-
            List accounts and Get account only. A Pinterest account's boards,
            read from Pinterest; `[]` for other networks, and when Pinterest
            can't be read. Pass a board's `id` as `accounts[].settings.board_id`
            on a post.
          items:
            type: object
            required:
              - id
              - name
              - image_cover_url
            properties:
              id:
                type: string
                nullable: true
              name:
                type: string
              image_cover_url:
                type: string
                nullable: true
        playlists:
          type: array
          nullable: true
          description: >-
            Get account only. A YouTube channel's own playlists, read from
            YouTube, up to 500. `[]` for other networks and when
            `playlists_reconnect` is `true`. `null` when YouTube didn't answer:
            the channel may still have playlists, so try again later. Pass a
            playlist's `id` as `accounts[].settings.playlist_id` on a post to
            add the video to it.
          items:
            type: object
            required:
              - id
              - title
              - privacy_status
              - video_count
            properties:
              id:
                type: string
              title:
                type: string
              privacy_status:
                type: string
                nullable: true
                enum:
                  - public
                  - unlisted
                  - private
                  - null
                description: Who can see the playlist.
              video_count:
                type: integer
                nullable: true
                description: How many videos it holds.
        playlists_reconnect:
          type: boolean
          description: >-
            Get account only. `true` for a YouTube channel that must be
            reconnected to list its playlists and add videos to them: it was
            connected before PostSyncer asked YouTube for that permission, or
            its sign-in no longer works. `false` for every other account.
        scheduled_posts:
          type: object
          description: >-
            Get account only. Scheduled posts still to go out to this account.
            Deleting the account moves the ones that go only to it to drafts
            (they keep their time); the others still go to their other accounts.
          required:
            - total
            - only_this_account
          properties:
            total:
              type: integer
            only_this_account:
              type: integer
              description: The ones with no other account.
        posts_to_put_back:
          type: object
          nullable: true
          description: >-
            Get account only. Set when this profile was disconnected and
            connected again to the same workspace, and posts it was on can get
            it back with [Put back account
            posts](/api-reference/accounts/put-back-posts). Null otherwise.
          required:
            - posts
            - counts
            - relinked
            - disconnected_at
          properties:
            posts:
              type: integer
              description: Posts that would get the account back.
            counts:
              $ref: '#/components/schemas/PutBackCounts'
            relinked:
              type: integer
              description: >-
                Published posts already linked to the account again, with their
                link, numbers and comments. That happens on its own at the
                reconnect and sends nothing.
            disconnected_at:
              type: string
              format: date-time
              nullable: true
              description: When the profile was disconnected.
    PutBackCounts:
      type: object
      description: >-
        Posts by what putting back does with them (all 11 are always there):
        `scheduled_again` (a draft the disconnect took off the schedule,
        unchanged since, scheduled again at its time), `added_to_scheduled`
        (scheduled or waiting for approval: the account is added, the time
        stays), `added_to_draft` (a draft stays a draft),
        `added_to_draft_time_passed` and `added_to_draft_changed` (taken off the
        schedule by the disconnect, but its time passed or it was edited since,
        so it stays a draft), `added_to_draft_refused` (kept a draft because the
        plan's post limit refused scheduling it), `skipped_deleted`,
        `skipped_already_there`, `skipped_went_out` (published, failed or
        sending), `skipped_time_passed` (due within 5 minutes), and `not_done`
        (an error stopped it; calling again tries it again).
      required:
        - scheduled_again
        - added_to_scheduled
        - added_to_draft
        - added_to_draft_time_passed
        - added_to_draft_changed
        - added_to_draft_refused
        - skipped_deleted
        - skipped_already_there
        - skipped_went_out
        - skipped_time_passed
        - not_done
      properties:
        scheduled_again:
          type: integer
        added_to_scheduled:
          type: integer
        added_to_draft:
          type: integer
        added_to_draft_time_passed:
          type: integer
        added_to_draft_changed:
          type: integer
        added_to_draft_refused:
          type: integer
        skipped_deleted:
          type: integer
        skipped_already_there:
          type: integer
        skipped_went_out:
          type: integer
        skipped_time_passed:
          type: integer
        not_done:
          type: integer
  responses:
    Unauthorized401:
      description: No API key, or not a valid one.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            unauthenticated:
              summary: No valid API key
              value:
                message: Unauthenticated.
    RateLimited429:
      description: >-
        More than 60 requests in a minute from this key's user (the API and the
        MCP server share the count). Wait `Retry-After` seconds.
      headers:
        Retry-After:
          description: Seconds until requests are allowed again.
          schema:
            type: integer
        X-RateLimit-Limit:
          description: Requests allowed a minute.
          schema:
            type: integer
        X-RateLimit-Remaining:
          description: Requests left this minute.
          schema:
            type: integer
        X-RateLimit-Reset:
          description: When requests are allowed again, as a Unix timestamp.
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            too_many_attempts:
              summary: Too many requests
              value:
                message: Too Many Attempts.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.