Facebook Insights API

The Insights API from Facebook — 3 operation(s) for insights.

OpenAPI Specification

facebook-insights-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Facebook Graph Ad Accounts Insights API
  description: The primary way to read and write data to the Facebook social graph, providing access to user profiles, posts, pages, photos, videos, comments, and social interactions.
  version: '21.0'
  contact:
    name: Meta Platforms
    url: https://developers.facebook.com
  x-generated-from: documentation
  x-last-validated: '2026-04-18'
servers:
- url: https://graph.facebook.com/v21.0
  description: Facebook Graph API v21.0
security:
- BearerAuth: []
tags:
- name: Insights
paths:
  /{ig-user-id}/insights:
    get:
      operationId: getInstagramInsights
      summary: Facebook Get Instagram Insights
      description: Retrieve insights for an Instagram account.
      tags:
      - Insights
      parameters:
      - name: ig-user-id
        in: path
        required: true
        description: The Instagram user ID.
        schema:
          type: string
        example: '17841405822304914'
      - name: metric
        in: query
        required: true
        description: Comma-separated list of metrics.
        schema:
          type: string
        example: impressions,reach,follower_count
      - name: period
        in: query
        required: true
        description: Aggregation period.
        schema:
          type: string
          enum:
          - day
          - week
          - days_28
          - month
          - lifetime
        example: day
      responses:
        '200':
          description: Insights retrieved successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InstagramInsightList'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /act_{ad-account-id}/insights:
    get:
      operationId: getAccountInsights
      summary: Facebook Get Account Insights
      description: Retrieve advertising insights for an ad account.
      tags:
      - Insights
      parameters:
      - name: ad-account-id
        in: path
        required: true
        description: The ad account ID.
        schema:
          type: string
        example: '123456789'
      - name: date_preset
        in: query
        description: Predefined date range for insights.
        schema:
          type: string
          enum:
          - today
          - yesterday
          - last_7d
          - last_30d
          - this_month
        example: last_7d
      responses:
        '200':
          description: Insights retrieved successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InsightList'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /{threads-user-id}/insights:
    get:
      operationId: getThreadsInsights
      summary: Facebook Get Threads Insights
      description: Retrieve insights for a Threads user.
      tags:
      - Insights
      parameters:
      - name: threads-user-id
        in: path
        required: true
        description: The Threads user ID.
        schema:
          type: string
        example: '12345678901234567'
      - name: metric
        in: query
        required: true
        description: Comma-separated list of metrics.
        schema:
          type: string
        example: views,likes,replies
      responses:
        '200':
          description: Insights retrieved successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ThreadsInsightList'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
components:
  schemas:
    InstagramInsightList:
      type: object
      description: List of Instagram insights.
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/InstagramInsight'
    ThreadsInsight:
      type: object
      description: A Threads insight metric.
      properties:
        name:
          type: string
          description: Metric name.
          example: views
        period:
          type: string
          description: Aggregation period.
        values:
          type: array
          items:
            type: object
            properties:
              value:
                type: integer
    Insight:
      type: object
      description: Advertising performance insight.
      properties:
        impressions:
          type: string
          description: Number of impressions.
          example: '15000'
        clicks:
          type: string
          description: Number of clicks.
          example: '450'
        spend:
          type: string
          description: Amount spent.
          example: '125.50'
        cpc:
          type: string
          description: Cost per click.
          example: '0.28'
        cpm:
          type: string
          description: Cost per thousand impressions.
          example: '8.37'
        ctr:
          type: string
          description: Click-through rate.
          example: '3.00'
        reach:
          type: string
          description: Number of unique users reached.
          example: '12000'
        date_start:
          type: string
          format: date
          description: Start date of the insight period.
        date_stop:
          type: string
          format: date
          description: End date of the insight period.
    InstagramInsight:
      type: object
      description: An Instagram account insight metric.
      properties:
        name:
          type: string
          description: Metric name.
          example: impressions
        period:
          type: string
          description: Aggregation period.
          example: day
        values:
          type: array
          items:
            type: object
            properties:
              value:
                type: integer
                description: Metric value.
              end_time:
                type: string
                format: date-time
                description: End time of the period.
    ThreadsInsightList:
      type: object
      description: List of Threads insights.
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/ThreadsInsight'
    InsightList:
      type: object
      description: Paginated list of insights.
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/Insight'
        paging:
          $ref: '#/components/schemas/Paging'
    Paging:
      type: object
      description: Pagination cursors.
      properties:
        cursors:
          type: object
          properties:
            before:
              type: string
            after:
              type: string
        next:
          type: string
          format: uri
        previous:
          type: string
          format: uri
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: OAuth 2.0 access token for Facebook Graph API.