Skip to main content

Fetch product videos

Retrieve videos attached to a product for embedding on the product detail page.

Query

query GetProductVideos($productId: Int!) {
product(productId: $productId) {
productId
media {
videos {
items {
id
type
priority
description(language: "NL") { language value }
videos {
language
uri
mimeType
}
}
itemsFound
}
}
}
}

Variables

{
"productId": 25
}

Response

{
"data": {
"product": {
"productId": 25,
"media": {
"videos": {
"items": [
{
"id": "06ca1458-15aa-4634-a843-c5b7585c4cab",
"type": "VIDEO",
"priority": 1000,
"description": [{ "language": "NL", "value": "SAGA101 - SAGA107" }],
"videos": [
{
"language": "NL",
"uri": "https://www.youtube.com/embed/DJDVrhqLm20",
"mimeType": "video/mp4"
}
]
}
],
"itemsFound": 1
}
}
}
}
}

How it works

Each MediaVideo item contains a nested videos array with the video URIs per language. The uri field typically contains a YouTube or Vimeo embed URL that you can use directly in an <iframe>. For self-hosted videos, use the uri as the <video> source and check mimeType for the format. The description field provides a display caption. Sort by priority for display order (lower values appear first). The videos response is paginated — pass a search argument with page and offset if the product has many videos.

See also