Instagram · Capability

Instagram Graph API — Insights

Instagram Graph API — Insights. 2 operations. Lead operation: Instagram Get Media Insights. Self-contained Naftiko capability covering one Instagram business surface.

Run with Naftiko InstagramInsights

What You Can Do

GET
Getmediainsights — Instagram Get Media Insights
/v1/{media-id}/insights
GET
Getuserinsights — Instagram Get User Insights
/v1/{user-id}/insights

MCP Tools

instagram-get-media-insights

Instagram Get Media Insights

read-only idempotent
instagram-get-user-insights

Instagram Get User Insights

read-only idempotent

Capability Spec

graph-insights.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: Instagram Graph API — Insights
  description: 'Instagram Graph API — Insights. 2 operations. Lead operation: Instagram Get Media Insights. Self-contained
    Naftiko capability covering one Instagram business surface.'
  tags:
  - Instagram
  - Insights
  created: '2026-05-19'
  modified: '2026-05-19'
binds:
- namespace: env
  keys:
    INSTAGRAM_API_KEY: INSTAGRAM_API_KEY
capability:
  consumes:
  - type: http
    namespace: graph-insights
    baseUri: https://graph.facebook.com/v21.0
    description: Instagram Graph API — Insights business capability. Self-contained, no shared references.
    resources:
    - name: media_id-insights
      path: /{media_id}/insights
      operations:
      - name: getmediainsights
        method: GET
        description: Instagram Get Media Insights
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: media_id
          in: path
          type: string
          required: true
        - name: metric
          in: query
          type: string
          description: Comma-separated list of metrics.
          required: true
        - name: access_token
          in: query
          type: string
          required: true
    - name: user_id-insights
      path: /{user_id}/insights
      operations:
      - name: getuserinsights
        method: GET
        description: Instagram Get User Insights
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: user_id
          in: path
          type: string
          required: true
        - name: metric
          in: query
          type: string
          description: Comma-separated list of metrics.
          required: true
        - name: period
          in: query
          type: string
          description: Time period for aggregation.
          required: true
        - name: since
          in: query
          type: integer
          description: Unix timestamp for start of range.
        - name: until
          in: query
          type: integer
          description: Unix timestamp for end of range.
        - name: access_token
          in: query
          type: string
          required: true
    authentication:
      type: bearer
      token: '{{env.INSTAGRAM_API_KEY}}'
  exposes:
  - type: rest
    namespace: graph-insights-rest
    port: 8080
    description: REST adapter for Instagram Graph API — Insights. One Spectral-compliant resource per consumed operation,
      prefixed with /v1.
    resources:
    - path: /v1/{media-id}/insights
      name: media-id-insights
      description: REST surface for media_id-insights.
      operations:
      - method: GET
        name: getmediainsights
        description: Instagram Get Media Insights
        call: graph-insights.getmediainsights
        with:
          media_id: rest.media_id
          metric: rest.metric
          access_token: rest.access_token
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/{user-id}/insights
      name: user-id-insights
      description: REST surface for user_id-insights.
      operations:
      - method: GET
        name: getuserinsights
        description: Instagram Get User Insights
        call: graph-insights.getuserinsights
        with:
          user_id: rest.user_id
          metric: rest.metric
          period: rest.period
          since: rest.since
          until: rest.until
          access_token: rest.access_token
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: graph-insights-mcp
    port: 9090
    transport: http
    description: MCP adapter for Instagram Graph API — Insights. One tool per consumed operation, routed inline through this
      capability's consumes block.
    tools:
    - name: instagram-get-media-insights
      description: Instagram Get Media Insights
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: graph-insights.getmediainsights
      with:
        media_id: tools.media_id
        metric: tools.metric
        access_token: tools.access_token
      outputParameters:
      - type: object
        mapping: $.
    - name: instagram-get-user-insights
      description: Instagram Get User Insights
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: graph-insights.getuserinsights
      with:
        user_id: tools.user_id
        metric: tools.metric
        period: tools.period
        since: tools.since
        until: tools.until
        access_token: tools.access_token
      outputParameters:
      - type: object
        mapping: $.