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

# Get the best times to post

> When posting has worked, per weekday and hour, pooled over the chosen accounts. Each post of the last 180 days that has views counts by its engagement rate against its own account's average, and every account weighs the same, so a busy account does not drown out the others. A slot scores 50 × that ratio, pulled toward 50 when few posts are behind it, from 0 to 100: 50 is average for these accounts, 100 twice the average or better. Only networks with the `insights` type take part.

Weekdays run from `0` (Sunday) to `6` (Saturday). `best` names up to three slots with at least two posts behind them, at most one per weekday, highest first. `confidence` is `high` from 5 posts, `medium` from 2, `low` with 1 and `none` without. `offset_hours` is the timezone's offset from UTC now.

Read-only. Personal access tokens may call it with any workspace role, viewers included.

**Required permission:** `publishing:analytics:read`



## OpenAPI

````yaml /api-reference/publishing.openapi.json get /{workspace}/analytics/posting-times
openapi: 3.1.0
info:
  title: Publishing API
  version: 1.0.0
  description: >-
    Social accounts, posts, scheduling, approval, tags, media and analytics for
    one workspace.
servers:
  - url: https://app.onlysocial.io/os/api
    description: OnlySocial
security:
  - bearerAuth: []
  - apiKeyHeader: []
tags:
  - name: Diagnostics
  - name: Accounts
  - name: Posts
  - name: Media
  - name: Tags
  - name: Analytics
    description: >-
      Followers, reach, engagement and post performance, as the analytics
      dashboard shows them, plus when to post. Dates are UTC days unless a
      `timezone` is sent. Figures compared with the previous period of the same
      length are `{value, change}`, where `change` is a percentage (`100` when
      the previous period was zero, `null` when both are). Time series are lists
      of `{date, value}` points; breakdowns (ages, countries, keywords) are
      lists of `{label, value}`.
paths:
  /{workspace}/analytics/posting-times:
    get:
      tags:
        - Analytics
      summary: Get the best times to post
      description: >-
        When posting has worked, per weekday and hour, pooled over the chosen
        accounts. Each post of the last 180 days that has views counts by its
        engagement rate against its own account's average, and every account
        weighs the same, so a busy account does not drown out the others. A slot
        scores 50 × that ratio, pulled toward 50 when few posts are behind it,
        from 0 to 100: 50 is average for these accounts, 100 twice the average
        or better. Only networks with the `insights` type take part.


        Weekdays run from `0` (Sunday) to `6` (Saturday). `best` names up to
        three slots with at least two posts behind them, at most one per
        weekday, highest first. `confidence` is `high` from 5 posts, `medium`
        from 2, `low` with 1 and `none` without. `offset_hours` is the
        timezone's offset from UTC now.


        Read-only. Personal access tokens may call it with any workspace role,
        viewers included.


        **Required permission:** `publishing:analytics:read`
      operationId: analytics.postingTimes
      parameters:
        - name: workspace
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: Your workspace UUID. Must match the API key's workspace.
        - name: accounts[]
          in: query
          schema:
            type: array
            items:
              type: string
              format: uuid
          description: Account UUIDs. Defaults to every account in the workspace.
        - name: timezone
          in: query
          schema:
            type: string
            example: Europe/Berlin
          description: >-
            IANA timezone the weekdays, hours and times are in. Defaults to the
            timezone setting of the key's creator (or the token's user), then
            UTC.
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PostingTimes'
        '401':
          description: Missing or invalid credential.
        '403':
          description: The API key does not have `publishing:analytics:read`.
        '404':
          description: Unknown workspace, account or post.
        '422':
          description: >-
            Invalid input. An account that is not in the workspace
            (`accounts.0`), or an unknown timezone.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
components:
  schemas:
    PostingTimes:
      type: object
      properties:
        has_data:
          type: boolean
          description: >-
            False, with neutral scores and no `best`, when no account has scored
            history.
        timezone:
          type: string
          example: Europe/Berlin
        offset_hours:
          type: number
          example: 1
        accounts:
          type: integer
          description: Accounts with scored history.
        samples:
          type: integer
          description: Posts behind the scores.
        days:
          type: array
          description: Sunday first.
          items:
            type: object
            properties:
              day:
                type: integer
                minimum: 0
                maximum: 6
              score:
                type: integer
              samples:
                type: integer
              confidence:
                type: string
                enum:
                  - high
                  - medium
                  - low
                  - none
        day_intervals:
          type: array
          description: >-
            Seven lists, Sunday first, of twelve two-hour intervals. `end_hour`
            is exclusive.
          items:
            type: array
            items:
              type: object
              properties:
                start_hour:
                  type: integer
                end_hour:
                  type: integer
                best_hour:
                  type: integer
                score:
                  type: integer
                samples:
                  type: integer
                confidence:
                  type: string
                  enum:
                    - high
                    - medium
                    - low
                    - none
        best:
          type: array
          items:
            type: object
            properties:
              day:
                type: integer
              hour:
                type: integer
              score:
                type: integer
              samples:
                type: integer
          example:
            - day: 2
              hour: 13
              score: 74
              samples: 14
    ValidationError:
      type: object
      properties:
        message:
          type: string
          example: The date range may span at most 366 days.
        errors:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
          example:
            date_to:
              - The date range may span at most 366 days.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'A workspace API key: `Authorization: Bearer osk_...`'
    apiKeyHeader:
      type: apiKey
      in: header
      name: x-api-key
      description: The same workspace API key in the `x-api-key` header.

````

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