Yuriy Aizenberg
Yuriy Aizenberg

Reputation: 373

Get videos from youtube api from channel

How can i get videos from the youtube channel with duration and views count?

I tried this request:

https://www.googleapis.com/youtube/v3/search?part=snippet%2Cid&channelId=UC4H3KiOO86uiw2fAoZy6NRA&key=YOUR_API_KEY

but response doesn't contains duration/views count. Any ideas? Thx.

Upvotes: 1

Views: 489

Answers (1)

Ikai Lan
Ikai Lan

Reputation: 2240

That data is not available in the snippet field. Instead, make a second API call to the channels.list() with the video IDs and request the contentDetails and statistics fields in your response. You can find documentation on the video resource here.

Upvotes: 1

Related Questions