Developers

GraphQL

You can fetch Video Picker field content through Craft's GraphQL API. Add the entry section and Video Picker field to the schema used by your access token. Replace blog_blog_Entry and videoPickerField below with the generated entry type and field handle from your project.

{
    entries(id: 1234) {
        ... on blog_blog_Entry {
            videoPickerField {
                url
                date
                formattedDuration
                plays
                thumbnails
                title
                embedUrl
            }
        }
    }
}

A populated field returns data in this shape:

{
    "data": {
        "entries": [
            {
                "videoPickerField": {
                    "url": "https://youtu.be/jfKfPfyJRdk",
                    "date": "2022-07-12T22:12:29+10:00",
                    "formattedDuration": "∞",
                    "plays": 467338277,
                    "thumbnails": [
                        {
                            "url": "https://i.ytimg.com/vi/jfKfPfyJRdk/default_live.jpg",
                            "width": 120,
                            "height": 90
                        },
                        {
                            "url": "https://i.ytimg.com/vi/jfKfPfyJRdk/mqdefault_live.jpg",
                            "width": 320,
                            "height": 180
                        },
                        {
                            "url": "https://i.ytimg.com/vi/jfKfPfyJRdk/hqdefault_live.jpg",
                            "width": 480,
                            "height": 360
                        },
                        {
                            "url": "https://i.ytimg.com/vi/jfKfPfyJRdk/sddefault_live.jpg",
                            "width": 640,
                            "height": 480
                        },
                        {
                            "url": "https://i.ytimg.com/vi/jfKfPfyJRdk/maxresdefault_live.jpg",
                            "width": 1280,
                            "height": 720
                        }
                    ],
                    "title": "lofi hip hop radio 📚 beats to relax/study to",
                    "embedUrl": "https://www.youtube.com/embed/jfKfPfyJRdk?wmode=transparent"
                }
            }
        ]
    }
}

The {fieldHandle}_Video Type

Each Video Picker field exposes an object type named from its handle, such as videoPickerField_Video. Select the following fields directly within that field’s selection. All fields are nullable; available metadata depends on the provider and stored video.

FieldTypeDescription
idStringThe video identifier supplied by its provider.
urlStringThe video’s source URL.
sourceHandleStringThe configured Video Picker source handle.
dateDateTimeThe video’s publication date.
durationIntDuration in seconds.
formattedDurationStringDuration formatted for display.
playsFloatThe provider’s play count, when available, including counts above the 32-bit integer limit.
authorNameStringThe author’s display name.
authorUrlStringThe author’s URL.
authorUsernameStringThe author’s username.
thumbnailsArrayTypeThumbnail metadata as structured JSON, including URLs and dimensions.
titleStringThe video title.
descriptionStringThe video description.
privateBooleanWhether the provider marks the video as private.
widthIntVideo width in pixels.
heightIntVideo height in pixels.
embedHtmlStringEmbed HTML using the field’s embed defaults.
embedUrlStringEmbed URL using the field’s embed defaults.

thumbnails is a JSON scalar, so request it without a nested selection. Neither embedHtml nor embedUrl accepts arguments; configure embed defaults on the Video Picker field.