Documentação

A documentação para programadores está em inglês.

Tipo de cartão

video

A video or music video with provider and id.

Version 1 · schema video.v1.schema.json

Layouts

Every card type has full. Pick a layout with the element's layout attribute, render.layout, or a theme.

Fields

The fields of card.data. Values a source doesn't provide are null; new optional fields can appear within version 1.

FieldTypeRequiredNotes
kindenumyesvideo · music
providerenumyesyoutube
video_idstringyes
titlestringyes
channelstringyes
thumbnail_urlurlyesWebKnox media URL: https://webknox.com/media/v1/<host>/<path>. Treat it as opaque.
duration_sinteger | nullyes
watch_urlurlyes
embed_allowedbooleanyesfalse when the owner blocks embedding; link out instead.

Example

A recorded answer to “Play Bohemian Rhapsody”. Open it in the Answer Lab to see every layout and style.

Response
{
  "v": 2,
  "id": "ans_98b0273223e4",
  "matched": true,
  "locale": "en",
  "skill": "music",
  "confidence": 0.9,
  "text": "Playing Queen – Bohemian Rhapsody. https://www.youtube.com/watch?v=fJ9rUzIMcZQ",
  "speech": "Playing Queen – Bohemian Rhapsody.",
  "card": {
    "type": "video",
    "version": 1,
    "data": {
      "kind": "music",
      "provider": "youtube",
      "video_id": "fJ9rUzIMcZQ",
      "title": "Queen – Bohemian Rhapsody (Official Video Remastered)",
      "channel": "Queen Official",
      "thumbnail_url": "https://webknox.com/media/v1/i.ytimg.com/vi/fJ9rUzIMcZQ/hqdefault.jpg",
      "duration_s": null,
      "watch_url": "https://www.youtube.com/watch?v=fJ9rUzIMcZQ",
      "embed_allowed": true
    }
  },
  "sources": [
    {
      "name": "YouTube",
      "url": "https://www.youtube.com/watch?v=fJ9rUzIMcZQ",
      "license": null
    }
  ],
  "follow_ups": [],
  "actions": [],
  "usage": {
    "billable": true
  }
}