0
votes

I need id of video for example https://www.youtube.com/watch?v=wIN0tTy-Jmg

the id which I need is wIN0tTy-Jmg

I know about https://developers.google.com/apis-explorer/#p/youtube/v3/youtube.activities.list?part=snippet&channelId=UCuaCWszD8Z2bZcSNvlAR6UA&maxResults=50&fields=items(snippet(thumbnails%252Fdefault%252Ctitle))&_h=14&

but it returns only 50 videos and sometimes I can't get video which has title that I need

I need only one video id, I know title and given channel ID

How to get this id? Any ideas?

1
Is it your video?DaImTo
yes it is my videotest qtstes

1 Answers

0
votes

The youtube api does not have a video get method. So there is no way to directly get just a single video.

I am not sure why you are using the activites.list method.

I would use a search.list and send the channel id. example

request

GET https://www.googleapis.com/youtube/v3/search?part=snippet&channelId=UCWnY0GoKFnFY0oeaEN605Ug&maxResults=50&key={YOUR_API_KEY}

response

{
 "kind": "youtube#searchListResponse",
 "etag": "\"XI7nbFXulYBIpL0ayR_gDh3eu1k/9HyOjSMVnKv1vm239plm060CuiY\"",
 "nextPageToken": "CDIQAA",
 "regionCode": "DK",
 "pageInfo": {
  "totalResults": 71,
  "resultsPerPage": 50
 },
 ...

}

It is still returning more then the max 50 rows. You are going to have to use the next page token to get the next page of results.