frangulyan
frangulyan

Reputation: 3867

Youtube search API doesn't return sd/max resolution thumbnails

I am using the youtube api v3 to search for videos. Here is an example:

GET https://www.googleapis.com/youtube/v3/search?part=snippet&maxResults=10&q=taylor+swift&type=video&key={YOUR_API_KEY}

In the search results I am getting the following information for thumbnails:

...
"title": "Taylor Swift - Delicate",
"thumbnails": {
 "default": {
  "url": "https://i.ytimg.com/vi/tCXGJQYZ9JA/default.jpg",
  "width": 120,
  "height": 90
 },
 "medium": {
  "url": "https://i.ytimg.com/vi/tCXGJQYZ9JA/mqdefault.jpg",
  "width": 320,
  "height": 180
 },
 "high": {
  "url": "https://i.ytimg.com/vi/tCXGJQYZ9JA/hqdefault.jpg",
  "width": 480,
  "height": 360
 }
},
...

However, if I manually change the link, I can see that the standard and maxres thumbnails also exist for the video - https://i.ytimg.com/vi/tCXGJQYZ9JA/maxresdefault.jpg

Why am I not getting those in search results and what can I do about them?

Upvotes: 0

Views: 323

Answers (1)

johnh10
johnh10

Reputation: 4185

This seems like a bug you should report.

Your search query returns only 3 thumbnails for that video, but if you then do a videos request

https://www.googleapis.com/youtube/v3/videos?part=snippet&id=tCXGJQYZ9JA&key={YOUR_API_KEY}

It will return all 5 thumbnails:

"title": "Taylor Swift - Delicate",
"thumbnails": {
 "default": {
  "url": "https://i.ytimg.com/vi/tCXGJQYZ9JA/default.jpg",
  "width": 120,
  "height": 90
 },
 "medium": {
  "url": "https://i.ytimg.com/vi/tCXGJQYZ9JA/mqdefault.jpg",
  "width": 320,
  "height": 180
 },
 "high": {
  "url": "https://i.ytimg.com/vi/tCXGJQYZ9JA/hqdefault.jpg",
  "width": 480,
  "height": 360
 },
 "standard": {
  "url": "https://i.ytimg.com/vi/tCXGJQYZ9JA/sddefault.jpg",
  "width": 640,
  "height": 480
 },
 "maxres": {
  "url": "https://i.ytimg.com/vi/tCXGJQYZ9JA/maxresdefault.jpg",
  "width": 1280,
  "height": 720
 }
},

Upvotes: 1

Related Questions