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

# Metadata

> Fetch metadata from any supported internet media including YouTube, TikTok, Instagram, Twitter/X and Facebook posts. Returns unified metadata with a predictable structure across all platforms.



## OpenAPI

````yaml v1-openapi GET /metadata
openapi: 3.1.0
info:
  title: Supadata
  description: Web & Social Media Content API for Developers
  version: 1.3.0
servers:
  - url: https://api.supadata.ai/v1
security:
  - apiKeyAuth: []
paths:
  /metadata:
    get:
      tags:
        - Metadata
      summary: Get media metadata
      description: >-
        Fetch metadata from any supported internet media including YouTube,
        TikTok, Instagram, Twitter/X and Facebook posts. Returns unified
        metadata with a predictable structure across all platforms.
      operationId: getMetadata
      parameters:
        - in: query
          name: url
          schema:
            $ref: '#/components/schemas/MetadataQuery'
          required: true
      responses:
        '200':
          description: Metadata retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Metadata'
        '400':
          description: Invalid Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Limit Exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      x-codeSamples:
        - lang: TypeScript
          label: Node.js
          source: |-
            import { Supadata } from '@supadata/js';

            const supadata = new Supadata({
              apiKey: 'YOUR_API_KEY',
            });

            // TikTok video, can be also YouTube, Instagram, Twitter, Facebook
            const tiktokMetadata = await supadata.metadata({
              url: 'https://www.tiktok.com/@user/video/1234567890',
            });
            console.log(tiktokMetadata);
        - lang: Python
          label: Python
          source: |-
            from supadata import Supadata

            supadata = Supadata(api_key="YOUR_API_KEY")

            # TikTok video, can be also YouTube, Instagram, Twitter, Facebook
            tiktok_metadata = supadata.metadata(
                url="https://www.tiktok.com/@user/video/1234567890"
            )
            print(f"Caption: {tiktok_metadata.description}")
            print(f"Likes: {tiktok_metadata.stats.likes}")
        - lang: Shell
          label: cURL
          source: >-
            curl -X GET
            "https://api.supadata.ai/v1/metadata?url=https%3A%2F%2Fwww.tiktok.com%2F%40user%2Fvideo%2F1234567890"
            \
              -H "x-api-key: YOUR_API_KEY" \
              -H "Content-Type: application/json"
components:
  schemas:
    MetadataQuery:
      type: string
      format: uri
      description: >-
        URL to any supported internet media. Supports YouTube videos, TikTok
        videos, Instagram reels/posts, Twitter/X posts, Facebook videos, and
        more.
      examples:
        - https://www.youtube.com/watch?v=dQw4w9WgXcQ
        - https://www.tiktok.com/@user/video/1234567890
        - https://www.instagram.com/reel/ABC123
        - https://twitter.com/user/status/1234567890
        - https://www.facebook.com/i/videos/1234567890
    Metadata:
      type: object
      properties:
        platform:
          type: string
          enum:
            - youtube
            - tiktok
            - instagram
            - twitter
            - facebook
          description: Platform where the media is hosted
        type:
          allOf:
            - $ref: '#/components/schemas/MediaType'
          example: video
        id:
          type: string
          description: Unique media identifier from the platform
          example: dQw4w9WgXcQ
        url:
          type: string
          description: Canonical URL to the media
          example: https://www.youtube.com/watch?v=dQw4w9WgXcQ
        title:
          type:
            - string
            - 'null'
          description: Media title
          example: Amazing Video Title
        description:
          type:
            - string
            - 'null'
          description: Media description or caption
          example: 'Check out this amazing content! #awesome'
        author:
          type: object
          properties:
            username:
              type: string
              example: username
            displayName:
              type: string
              example: John Doe
            avatarUrl:
              type: string
              example: https://example.com/avatar.jpg
            verified:
              type: boolean
              example: true
              description: Whether the author is verified on the platform
          required:
            - displayName
          description: Author/creator information
        stats:
          type: object
          properties:
            views:
              type:
                - number
                - 'null'
              example: 50000
              description: >-
                View count. null if unavailable or not applicable for the
                platform.
            likes:
              type:
                - number
                - 'null'
              example: 5000
              description: >-
                Like count. null if unavailable or not applicable for the
                platform.
            comments:
              type:
                - number
                - 'null'
              example: 200
              description: >-
                Comment count. null if unavailable or not applicable for the
                platform.
            shares:
              type:
                - number
                - 'null'
              example: 100
              description: >-
                Share count. null if unavailable or not applicable for the
                platform (e.g., YouTube, Instagram).
          required:
            - likes
            - comments
            - shares
          description: >-
            Engagement statistics. null values indicate the metric is
            unavailable or not applicable for the platform.
        media:
          oneOf:
            - type: object
              properties:
                type:
                  type: string
                  const: video
                  description: Media type discriminator
                duration:
                  type: number
                  example: 30
                  description: Video duration in seconds
                thumbnailUrl:
                  type: string
                  example: https://example.com/thumb.jpg
                  description: Largest/best quality thumbnail URL
              required:
                - type
            - type: object
              properties:
                type:
                  type: string
                  const: image
                  description: Media type discriminator
                url:
                  type: string
                  example: https://example.com/image.jpg
                  description: Direct URL to the image
              required:
                - type
                - url
            - type: object
              properties:
                type:
                  type: string
                  const: carousel
                  description: Media type discriminator
                items:
                  type: array
                  items:
                    oneOf:
                      - type: object
                        properties:
                          type:
                            type: string
                            const: video
                            description: Video item
                          duration:
                            type: number
                            description: Video duration in seconds
                          thumbnailUrl:
                            type: string
                            description: Video thumbnail URL
                        required:
                          - type
                      - type: object
                        properties:
                          type:
                            type: string
                            const: image
                            description: Image item
                          url:
                            type: string
                            description: Direct URL to the image
                        required:
                          - type
                          - url
                  description: Array of carousel items (images or videos)
              required:
                - type
                - items
            - type: object
              properties:
                type:
                  type: string
                  const: post
                  description: Media type discriminator for text-only posts
              required:
                - type
          description: >-
            Media-specific data, discriminated by type field (video, image,
            carousel, or post)
        tags:
          type: array
          items:
            type: string
          description: Tags, hashtags, or keywords associated with the media
          example:
            - funny
            - cats
            - viral
        createdAt:
          type: string
          description: Creation/publish timestamp (ISO 8601 format)
          example: '2024-01-15T10:30:00Z'
        additionalData:
          type: object
          additionalProperties: {}
          description: Platform-specific additional data
      required:
        - platform
        - type
        - id
    Error:
      type: object
      properties:
        error:
          type: string
          enum:
            - invalid-request
            - internal-error
            - forbidden
            - unauthorized
            - upgrade-required
            - transcript-unavailable
            - not-found
            - limit-exceeded
          description: Error code identifying the type of error
          example: invalid-request
        message:
          type: string
          description: Human readable error message
          example: Invalid Request
        details:
          type: string
          description: Detailed error description
          example: The request is invalid or malformed
        documentationUrl:
          type: string
          description: URL to error documentation
          example: https://supadata.ai/documentation/errors#invalid-request
      required:
        - error
        - message
        - details
      description: Standard error response format
    MediaType:
      type: string
      enum:
        - video
        - image
        - carousel
        - post
      description: Type of media content
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````