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

# Get oEmbed data

> Implements the oEmbed specification (oembed.com) for bunny.net video embed URLs, allowing third-party sites and tools to auto-generate an embeddable player for a pasted video link. url must be a bunny.net player URL for an existing video — either the legacy player (e.g. "https://iframe.mediadelivery.net/embed/{libraryId}/{videoId}") or the new player (e.g. "https://player.mediadelivery.net/embed/{libraryId}/{videoId}") — not an arbitrary link. Only the library ID and video ID segments are read, so /play/ URLs are accepted as well as /embed/ ones. For private libraries, the request must satisfy the library's referer restrictions and, separately, a valid token and expires pair if token authentication is enabled — one does not substitute for the other.



## OpenAPI

````yaml https://video.bunnycdn.com/openapi/bunnynet-video-api.public.json get /OEmbed
openapi: 3.0.0
info:
  title: Stream API
  termsOfService: https://bunny.net/tos
  contact:
    name: bunny.net
    url: https://docs.bunny.net
    email: support@bunny.net
  version: 1.6.0
servers:
  - url: https://video.bunnycdn.com
security: []
tags:
  - name: Manage Collections
  - name: Manage Videos
paths:
  /OEmbed:
    get:
      tags:
        - OEmbed
      summary: Get oEmbed data
      description: >-
        Implements the oEmbed specification (oembed.com) for bunny.net video
        embed URLs, allowing third-party sites and tools to auto-generate an
        embeddable player for a pasted video link. url must be a bunny.net
        player URL for an existing video — either the legacy player (e.g.
        "https://iframe.mediadelivery.net/embed/{libraryId}/{videoId}") or the
        new player (e.g.
        "https://player.mediadelivery.net/embed/{libraryId}/{videoId}") — not an
        arbitrary link. Only the library ID and video ID segments are read, so
        /play/ URLs are accepted as well as /embed/ ones. For private libraries,
        the request must satisfy the library's referer restrictions and,
        separately, a valid token and expires pair if token authentication is
        enabled — one does not substitute for the other.
      operationId: OEmbed_GetOEmbed
      parameters:
        - name: url
          in: query
          description: >-
            The bunny.net player URL of the video to generate oEmbed data for
            (legacy iframe.mediadelivery.net or new player.mediadelivery.net
            player). Both /embed/ and /play/ paths are accepted.
          schema:
            type: string
            nullable: true
          x-position: 1
        - name: maxWidth
          in: query
          description: >-
            Maximum width in pixels for the embedded player; the player is
            scaled down to fit while preserving aspect ratio.
          schema:
            type: integer
            format: int32
            nullable: true
          x-position: 2
        - name: maxHeight
          in: query
          description: >-
            Maximum height in pixels for the embedded player; the player is
            scaled down to fit while preserving aspect ratio.
          schema:
            type: integer
            format: int32
            nullable: true
          x-position: 3
        - name: token
          in: query
          description: >-
            Signed access token, required when the video library has token
            authentication enabled. An allowed referer is checked separately and
            does not exempt the request from this requirement.
          schema:
            type: string
            default: ''
            nullable: true
          x-position: 4
        - name: expires
          in: query
          description: >-
            Unix timestamp (seconds) the token is valid until, required when the
            video library has token authentication enabled.
          schema:
            type: integer
            format: int64
            default: 0
          x-position: 5
      responses:
        '200':
          description: The oEmbed data for the video
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoOEmbedModel'
        '400':
          description: The url could not be parsed
        '401':
          description: >-
            The video's library is private and no valid token/referer was
            provided
        '404':
          description: >-
            The url is not a recognized bunny.net player URL, or the video
            library or video does not exist
components:
  schemas:
    VideoOEmbedModel:
      type: object
      additionalProperties: false
      properties:
        version:
          type: string
          description: The oEmbed spec version implemented by this response. Always "1.0".
          nullable: true
        title:
          type: string
          description: The title of the video.
          nullable: true
        type:
          type: string
          description: The oEmbed resource type. Always "video" for this endpoint.
          nullable: true
        thumbnail_url:
          type: string
          description: The CDN URL of the video's thumbnail image.
          nullable: true
        thumbnail_width:
          type: integer
          description: >-
            Width in pixels of the thumbnail image. Omitted for custom-uploaded
            thumbnails, whose dimensions are not known.
          format: int32
          nullable: true
        thumbnail_height:
          type: integer
          description: >-
            Height in pixels of the thumbnail image. Omitted for custom-uploaded
            thumbnails, whose dimensions are not known.
          format: int32
          nullable: true
        width:
          type: integer
          description: >-
            Width in pixels of the embedded player iframe, scaled to fit within
            maxWidth/maxHeight while preserving the video's aspect ratio.
          format: int32
        height:
          type: integer
          description: >-
            Height in pixels of the embedded player iframe, scaled to fit within
            maxWidth/maxHeight while preserving the video's aspect ratio.
          format: int32
        html:
          type: string
          description: The HTML <iframe> markup required to embed the video player.
          nullable: true
        provider_name:
          type: string
          description: The name of the embed provider. Always "bunny.net".
          nullable: true
        provider_url:
          type: string
          description: The URL of the embed provider. Always "https://bunny.net/".
          nullable: true

````