openapi: 3.0.0
info:
  title: Dailymotion Video API
  description: >-
    Get one Dailymotion video's record from its link or video ID: title, description, length, upload and update
    times, views in total and over the last day, week and month, likes, category, tags, hashtags, declared language
    and country, thumbnail, size and embeddable player link, the private, password, family safe, made for kids and
    embeddable flags, live stream state with its start and end times, the owner's country restriction, and the reason
    Dailymotion gives when the video cannot be played. Each answer also has the uploading channel with its ID, name,
    username, link, follower and video counts, verified flag and avatar.


    **Cross-linking**: Dailymotion watch and embed links returned by the Bing Videos and Yahoo Videos APIs can be
    passed as `url`.
  version: 1.0.0
servers:
- url: https://www.searchapi.io/api/v1
paths:
  "/search":
    get:
      summary: Dailymotion Video
      security:
      - ApiKeyAuth: []
      - ApiKeyQuery: []
      parameters:
      - name: engine
        in: query
        required: true
        description: Set to dailymotion_video.
        schema:
          type: string
          enum: ["dailymotion_video"]
      - name: url
        in: query
        required: false
        description: Link to a Dailymotion video, such as a watch page, a dai.ly short link, or an embed or player link. Send either url or video_id.
        schema:
          type: string
          maxLength: 2048
      - name: video_id
        in: query
        required: false
        description: Dailymotion video ID, which starts with x, or a private share ID, which starts with k. Send either url or video_id.
        schema:
          type: string
          pattern: "^(x[0-9a-z]{2,15}|k[0-9A-Za-z]{10,30})$"
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/SearchResponse"
        '400':
          description: Validation Error. There is an issue with query parameters, such as missing required parameters or invalid values.
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/ErrorResponse"
        '401':
          description: Authentication Error. The API key is missing or invalid.
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/ErrorResponse"
        '429':
          description: Rate Limit Exceeded. The number of allowed requests has been exceeded. Consider upgrading your plan or waiting for the limit to reset.
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/ErrorResponse"
        '500':
          description: Server Error. Internal server error.
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/ErrorResponse"
        '503':
          description: Timeout. We could not retrieve results in 90 seconds.
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/ErrorResponse"
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: 'Use Bearer authentication. Format: "Bearer YOUR_API_KEY"'
    ApiKeyQuery:
      type: apiKey
      in: query
      name: api_key
      description: Pass API key as query parameter
  schemas:
    SearchResponse:
      type: object
      properties:
        search_metadata:
          "$ref": "#/components/schemas/SearchMetadata"
        search_parameters:
          "$ref": "#/components/schemas/SearchParameters"
        video:
          "$ref": "#/components/schemas/Video"
        channel:
          "$ref": "#/components/schemas/Channel"
        error:
          type: string
          description: Message saying the video was not found or is private.
    SearchMetadata:
      type: object
      required:
      - status
      - created_at
      properties:
        id:
          type: string
          description: Unique identifier for the search request
        status:
          type: string
          description: Status of the search request
        created_at:
          type: string
          format: date-time
          description: Timestamp when the search was created
        request_time_taken:
          type: number
          description: Time taken to make the request in seconds
        parsing_time_taken:
          type: number
          description: Time taken to parse the results in seconds
        total_time_taken:
          type: number
          description: Total time taken for the search in seconds
        request_url:
          type: string
          description: Dailymotion URL for this video
        html_url:
          type: string
          description: URL to view HTML results
        json_url:
          type: string
          description: URL to view JSON results
    SearchParameters:
      type: object
      properties:
        engine:
          type: string
          enum: ["dailymotion_video"]
          description: Set to dailymotion_video.
        url:
          type: string
          description: Link to the Dailymotion video.
        video_id:
          type: string
          description: Dailymotion video ID or private share ID.
    Video:
      type: object
      required:
      - id
      properties:
        id:
          type: string
          description: Dailymotion ID of the video.
        title:
          type: string
          description: Title of the video.
        link:
          type: string
          description: Link to the video on Dailymotion.
        embed_link:
          type: string
          description: Link to Dailymotion's embeddable player for the video.
        description:
          type: string
          description: Description of the video, with its line breaks as newlines.
        length_seconds:
          type: integer
          description: Length of the video in seconds.
        views:
          type: integer
          description: Number of views.
        views_last_day:
          type: integer
          description: Number of views in the last day.
        views_last_week:
          type: integer
          description: Number of views in the last week.
        views_last_month:
          type: integer
          description: Number of views in the last month.
        likes:
          type: integer
          description: Number of likes.
        author:
          type: string
          description: Display name of the channel that uploaded the video.
        category:
          type: string
          description: Dailymotion category of the video, in English.
        category_id:
          type: string
          description: Dailymotion's ID for the category of the video.
        keywords:
          type: array
          description: Tags the uploader added to the video.
          items:
            type: string
        hashtags:
          type: array
          description: Hashtags attached to the video, each with its leading hash sign.
          items:
            type: string
        language:
          type: string
          description: Spoken language the uploader declared, as an ISO 639 code.
        country:
          type: string
          description: Country the uploader declared, as an ISO 3166-1 alpha-2 code.
        iso_date:
          type: string
          format: date-time
          description: Time the video was uploaded, in ISO 8601 UTC.
        iso_last_updated:
          type: string
          format: date-time
          description: Time the video was last updated, in ISO 8601 UTC.
        thumbnail:
          type: string
          description: URL of the video's 1080p thumbnail.
        width:
          type: integer
          description: Width of the source video in pixels.
        height:
          type: integer
          description: Height of the source video in pixels.
        is_private:
          type: boolean
          description: Whether the video is private.
        is_password_protected:
          type: boolean
          description: Whether the video needs a password to play.
        is_family_safe:
          type: boolean
          description: Whether the video is suitable for all audiences, the opposite of Dailymotion's explicit flag.
        is_created_for_kids:
          type: boolean
          description: Whether the uploader marked the video as made for kids.
        is_embeddable:
          type: boolean
          description: Whether the owner allows the video to be embedded on other sites.
        is_live_content:
          type: boolean
          description: Whether the video is a live stream.
        is_live:
          type: boolean
          description: Whether the live stream is on the air now.
        live_status:
          type: string
          description: State of the live stream as Dailymotion names it, such as on_air or ended.
        iso_live_start:
          type: string
          format: date-time
          description: Time the live stream started, in ISO 8601 UTC.
        iso_live_end:
          type: string
          format: date-time
          description: Time the live stream ended, in ISO 8601 UTC.
        geo_restriction:
          "$ref": "#/components/schemas/GeoRestriction"
        access_error:
          "$ref": "#/components/schemas/AccessError"
    GeoRestriction:
      type: object
      description: Countries where the owner allows or blocks the video.
      required:
      - mode
      - countries
      properties:
        mode:
          type: string
          enum: ["allow", "deny"]
          description: Whether the video plays only in the listed countries or everywhere except them.
        countries:
          type: array
          description: ISO 3166-1 alpha-2 codes of the listed countries.
          items:
            type: string
    AccessError:
      type: object
      description: Reason Dailymotion gives for the video not being playable.
      required:
      - code
      properties:
        code:
          type: string
          description: Dailymotion's access error code.
        title:
          type: string
          description: Dailymotion's title for the access error.
    Channel:
      type: object
      properties:
        id:
          type: string
          description: Dailymotion ID of the channel.
        name:
          type: string
          description: Display name of the channel.
        username:
          type: string
          description: Username of the channel, as in its link.
        link:
          type: string
          description: Link to the channel on Dailymotion.
        subscribers:
          type: integer
          description: Number of followers of the channel.
        videos:
          type: integer
          description: Number of videos the channel has published.
        is_verified:
          type: boolean
          description: Whether Dailymotion verified the channel.
        thumbnail:
          type: string
          description: URL of the channel's 240 px avatar.
    ErrorResponse:
      type: object
      required:
      - error
      properties:
        error:
          type: string
          description: Error message describing what went wrong
