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

# Get audience analysis

> Fetch AI-enriched audience analysis for a profile, including demographics, interests, community health, and brand safety statistics.

**Note**: This endpoint consumes 100 quota units per request.




## OpenAPI

````yaml GET /platforms/{platform}/profiles/{profile_id}/audience
openapi: 3.0.3
info:
  title: Streamforge External API
  description: >
    Public-facing API for accessing normalized creator, content, and analysis
    data across Twitch, YouTube, Instagram, and TikTok.


    ## Authentication

    All requests require an API key in the `x-api-key` header.


    ## Rate Limiting

    The API uses a weight-based quota system:

    - Single item requests: 1 quota unit

    - Bulk requests: 1 quota unit per item (up to 100 items)

    - List requests: 1 quota unit per item returned (based on `limit`)

    - Advanced endpoint: 100 quota units per request


    Rate limit headers are included in all responses:

    - `X-RateLimit-{window}-limit`: Maximum requests allowed

    - `X-RateLimit-{window}-remaining`: Remaining requests

    - `X-RateLimit-{window}-reset`: ISO timestamp when limit resets


    ### Quota weights by endpoint:

    - Profile/Content endpoints: 1 quota unit per item

    - Analysis endpoint: 100 quota units per request

    - Email endpoint: 10 quota units per request

    - Socials endpoint: 10 quota units per request

    - Audience endpoint: 100 quota units per request


    ## Base URL

    Production: `https://external-api.streamforge.com`
  version: 1.0.0
  contact:
    name: Streamforge Support
    email: support@streamforge.com
servers:
  - url: https://external-api.streamforge.com
    description: Production
  - url: http://localhost:3000
    description: Local development (from .env)
    variables:
      base_url:
        default: http://localhost:3000
security:
  - ApiKeyAuth: []
tags:
  - name: Health
    description: Health check endpoint
  - name: Profiles
    description: Creator profile endpoints
  - name: Content
    description: Content (streams/videos) endpoints
  - name: Games
    description: Game metadata endpoints
  - name: Advanced
    description: Advanced insights and analysis
paths:
  /platforms/{platform}/profiles/{profile_id}/audience:
    get:
      tags:
        - Advanced
      summary: Get audience analysis
      description: >
        Fetch AI-enriched audience analysis for a profile, including
        demographics, interests, community health, and brand safety statistics.


        **Note**: This endpoint consumes 100 quota units per request.
      operationId: getAudienceAnalysis
      parameters:
        - $ref: '#/components/parameters/Platform'
        - $ref: '#/components/parameters/ProfileId'
      responses:
        '200':
          description: Audience analysis found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AudienceAnalysisResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
components:
  parameters:
    Platform:
      name: platform
      in: path
      required: true
      description: Platform identifier
      schema:
        type: string
        enum:
          - twitch
          - youtube
          - instagram
          - tiktok
        example: twitch
    ProfileId:
      name: profile_id
      in: path
      required: true
      description: Platform-specific creator ID
      schema:
        type: string
        example: '484563826'
  schemas:
    AudienceAnalysisResponse:
      type: object
      properties:
        payload:
          type: object
          properties:
            gender_distribution:
              type: object
              description: Gender breakdown of the audience
              properties:
                male:
                  type: object
                  properties:
                    percentage:
                      type: number
                female:
                  type: object
                  properties:
                    percentage:
                      type: number
                non_binary:
                  type: object
                  properties:
                    percentage:
                      type: number
            age_ranges:
              type: array
              description: Age distribution of the audience
              items:
                type: object
                properties:
                  value:
                    type: string
                    description: Age range bracket (e.g., "18-24", "25-34")
                  percentage:
                    type: number
            countries:
              type: array
              description: Geographic distribution by ISO country code
              items:
                type: object
                properties:
                  value:
                    type: string
                    description: ISO 3166-1 alpha-2 country code
                  percentage:
                    type: number
            languages:
              type: array
              description: Language distribution by ISO language code
              items:
                type: object
                properties:
                  value:
                    type: string
                    description: ISO 639-1 language code
                  percentage:
                    type: number
            ethnicity_distribution:
              type: array
              description: Ethnic background distribution
              items:
                type: object
                properties:
                  value:
                    type: string
                  percentage:
                    type: number
            occupation_distribution:
              type: array
              description: Occupation distribution
              items:
                type: object
                properties:
                  value:
                    type: string
                  percentage:
                    type: number
            income_distribution:
              type: array
              description: Income bracket distribution
              items:
                type: object
                properties:
                  value:
                    type: string
                    description: Income range (e.g., "<10K", "10K-19K", "100K+")
                  percentage:
                    type: number
            education_level:
              type: array
              description: Education level distribution
              items:
                type: object
                properties:
                  value:
                    type: string
                  percentage:
                    type: number
            family_status:
              type: array
              description: Family status distribution
              items:
                type: object
                properties:
                  value:
                    type: string
                    description: Status (e.g., "Single", "Married", "Parents")
                  percentage:
                    type: number
            religion_distribution:
              type: array
              description: Religious affiliation distribution
              items:
                type: object
                properties:
                  value:
                    type: string
                  percentage:
                    type: number
            engagement_style:
              type: array
              description: Audience engagement behavior types
              items:
                type: object
                properties:
                  value:
                    type: string
                    description: >-
                      Engagement type (e.g., "Content Reactor", "Casual
                      Commenter")
                  percentage:
                    type: number
            interests:
              type: array
              description: Audience interests with nested sub-interests
              items:
                type: object
                properties:
                  value:
                    type: string
                    description: Interest name
                  strength_rating:
                    type: number
                    description: Interest strength score (0-100)
                  emoji:
                    type: string
                    description: Representative emoji for the interest
                  sub_interests:
                    type: array
                    description: Nested sub-interests within this category
                    items:
                      type: object
                      properties:
                        value:
                          type: string
                        strength_rating:
                          type: number
                        emoji:
                          type: string
            community_health:
              type: object
              description: Community health metrics and signals
              properties:
                loyalty_score:
                  type: number
                  description: Loyalty score (0-1)
                cohesion_score:
                  type: number
                  description: Community cohesion score (0-1)
                toxicity_score:
                  type: number
                  description: Toxicity score (0-1, lower is better)
                loyalty_signals:
                  type: array
                  description: Observed loyalty indicators
                  items:
                    type: string
                cohesion_signals:
                  type: array
                  description: Observed cohesion indicators
                  items:
                    type: string
                toxicity_signals:
                  type: array
                  description: Observed toxicity indicators
                  items:
                    type: string
            brand_safety:
              type: object
              description: Brand safety assessment
              properties:
                overall_risk_level:
                  type: number
                  description: Overall risk score (0-1, lower is safer)
                risk_factors:
                  type: array
                  description: Identified risk factors with frequency
                  items:
                    type: object
                    properties:
                      factor:
                        type: string
                        description: >-
                          Risk factor name (e.g., "Explicit Language",
                          "Political Content")
                      frequency:
                        type: number
                        description: Frequency of occurrence (0-1)
        meta:
          allOf:
            - $ref: '#/components/schemas/Meta'
            - type: object
              properties:
                last_updated_at:
                  type: string
                  format: date-time
                  description: Timestamp when the audience analysis was last updated
                  nullable: true
    Meta:
      type: object
      properties:
        source:
          type: string
        received_at:
          type: string
          format: date-time
        request_id:
          type: string
          format: uuid
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            status:
              type: integer
            message:
              type: string
        meta:
          type: object
          properties:
            request_id:
              type: string
              format: uuid
  responses:
    BadRequest:
      description: Bad request - validation error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              status: 400
              message: Invalid platform or missing required parameter
            meta:
              request_id: 5e7c0137-1ed3-4b4b-8e5f-3d9cf00f7ac4
    Unauthorized:
      description: Missing API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              status: 401
              message: API key is required
            meta:
              request_id: 5e7c0137-1ed3-4b4b-8e5f-3d9cf00f7ac4
    Forbidden:
      description: Invalid or revoked API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              status: 403
              message: Invalid API key
            meta:
              request_id: 5e7c0137-1ed3-4b4b-8e5f-3d9cf00f7ac4
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              status: 404
              message: Profile not found
            meta:
              request_id: 5e7c0137-1ed3-4b4b-8e5f-3d9cf00f7ac4
    TooManyRequests:
      description: Rate limit exceeded
      headers:
        Retry-After:
          schema:
            type: integer
          description: Seconds until retry is safe
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              status: 429
              message: Rate limit exceeded
            meta:
              request_id: 5e7c0137-1ed3-4b4b-8e5f-3d9cf00f7ac4
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: |
        Your API key. Include it in the `x-api-key` header for all requests.

````