> ## 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 content for a game

> Fetch content (streams/videos) related to a specific game, sorted by creation/publication date.
Games only exist on Twitch and YouTube platforms.




## OpenAPI

````yaml GET /platforms/{platform}/games/{game_id}/content
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}/games/{game_id}/content:
    get:
      tags:
        - Content
      summary: List content for a game
      description: >
        Fetch content (streams/videos) related to a specific game, sorted by
        creation/publication date.

        Games only exist on Twitch and YouTube platforms.
      operationId: getGameContent
      parameters:
        - name: platform
          in: path
          required: true
          description: Platform identifier (twitch or youtube)
          schema:
            type: string
            enum:
              - twitch
              - youtube
            example: twitch
        - name: game_id
          in: path
          required: true
          description: >-
            Platform-specific game ID (Twitch game ID or YouTube game channel
            ID)
          schema:
            type: string
            example: '2011938005'
        - name: sort
          in: query
          required: false
          description: Sort field
          schema:
            type: string
            enum:
              - created_at
            default: created_at
        - name: order
          in: query
          required: false
          description: Sort order
          schema:
            type: string
            enum:
              - asc
              - desc
            default: desc
        - name: cursor
          in: query
          required: false
          description: Pagination cursor token from previous response
          schema:
            type: string
        - name: limit
          in: query
          required: false
          description: Maximum number of results per page (1-100, default 20)
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 20
        - name: content_type
          in: query
          required: false
          description: Filter by content type
          schema:
            type: string
            enum:
              - stream
              - video
              - short
              - all
            default: all
        - name: start_date
          in: query
          required: false
          description: Filter content from this date (YYYY-MM-DD)
          schema:
            type: string
            pattern: ^\d{4}-\d{2}-\d{2}$
            example: '2024-01-01'
        - name: end_date
          in: query
          required: false
          description: Filter content until this date (YYYY-MM-DD)
          schema:
            type: string
            pattern: ^\d{4}-\d{2}-\d{2}$
            example: '2024-12-31'
      responses:
        '200':
          description: Content found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GameContentResponse'
        '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:
  schemas:
    GameContentResponse:
      type: object
      properties:
        payload:
          type: array
          items:
            $ref: '#/components/schemas/Content'
        paging:
          type: object
          properties:
            limit:
              type: integer
            next_cursor:
              type: string
              nullable: true
            has_more:
              type: boolean
        meta:
          allOf:
            - $ref: '#/components/schemas/Meta'
            - type: object
              properties:
                game:
                  type: object
                  nullable: true
                  properties:
                    id:
                      type: string
                    name:
                      type: string
                    slug:
                      type: string
                      nullable: true
                platform:
                  type: string
                  enum:
                    - twitch
                    - youtube
    Content:
      type: object
      properties:
        content_id:
          type: string
        platform:
          type: string
          enum:
            - twitch
            - youtube
            - instagram
            - tiktok
        type:
          type: string
          enum:
            - stream
            - video
            - short
            - long
        title:
          type: string
          nullable: true
        description:
          type: string
          nullable: true
        created_at:
          type: string
          format: date-time
          nullable: true
          description: >-
            When content was created/published. Normalized from
            platform-specific fields (started_at for Twitch, publishedAt for
            YouTube, createdAt for TikTok and Instagram).
        ended_at:
          type: string
          format: date-time
          nullable: true
          description: When stream ended (Twitch streams only).
        duration:
          type: integer
          nullable: true
        url:
          type: string
          format: uri
          nullable: true
        categories:
          type: array
          items:
            $ref: '#/components/schemas/Category'
        tags:
          type: array
          items:
            $ref: '#/components/schemas/Tag'
        statistics:
          type: object
          properties:
            viewers:
              type: object
              properties:
                avg:
                  type: number
                  nullable: true
                max:
                  type: integer
                  nullable: true
            watched_minutes:
              type: object
              properties:
                sum:
                  type: integer
                  nullable: true
            airtime_minutes:
              type: object
              properties:
                sum:
                  type: integer
                  nullable: true
            views:
              type: object
              properties:
                sum:
                  type: integer
                  nullable: true
            likes:
              type: object
              properties:
                sum:
                  type: integer
                  nullable: true
            comments:
              type: object
              properties:
                sum:
                  type: integer
                  nullable: true
                avg:
                  type: integer
                  nullable: true
        chapters:
          type: array
          items:
            $ref: '#/components/schemas/Chapter'
          description: Twitch-specific chapter data
        profile_id:
          type: string
          nullable: true
          description: The profile ID of the creator who published this content
    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
    Category:
      type: object
      properties:
        id:
          type: string
        type:
          type: string
          enum:
            - twitch_game
            - youtube_game
            - youtube_category
        name:
          type: string
          nullable: true
        igdb_id:
          type: integer
          description: >-
            IGDB game ID (only present for game categories when IGDB data is
            available). Use this to fetch full game details from IGDB API.
          nullable: true
        igdb_name:
          type: string
          description: >-
            Official game name from IGDB (only present for game categories when
            IGDB data is available)
          nullable: true
        igdb_slug:
          type: string
          description: >-
            URL-friendly game slug from IGDB (only present for game categories
            when IGDB data is available)
          nullable: true
    Tag:
      type: object
      properties:
        id:
          type: string
        type:
          type: string
          enum:
            - twitch_tag
            - youtube_game
            - youtube_category
            - youtube_tag
        name:
          type: string
          nullable: true
    Chapter:
      type: object
      properties:
        id:
          type: string
        title:
          type: string
          nullable: true
        description:
          type: string
          nullable: true
        created_at:
          type: string
          format: date-time
          nullable: true
          description: When chapter started. Normalized from started_at.
        ended_at:
          type: string
          format: date-time
          nullable: true
          description: When chapter ended.
        duration:
          type: integer
          nullable: true
        categories:
          type: array
          items:
            $ref: '#/components/schemas/Category'
        tags:
          type: array
          items:
            $ref: '#/components/schemas/Tag'
        statistics:
          type: object
          properties:
            viewers:
              type: object
              properties:
                avg:
                  type: number
                  nullable: true
                max:
                  type: integer
                  nullable: true
  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.

````