ios - YouTube API without Credentials -



ios - YouTube API without Credentials -

is possible create youtube app access videos on channel isn't channel? don't have login details channel , can't credentials apart public urls?

yes. you'll want utilize next endpoints.

if know channel id, request to:

https://www.googleapis.com/youtube/v3/channels?part=contentdetails&id={channel_id}&key={your_api_key}

alternatively, if know display name, request to:

https://www.googleapis.com/youtube/v3/channels?part=contentdetails&forusername={display_name}&key={your_api_key}

in either case, won't need oauth credentials need provide read-only api key obtain developer's console (don't forget turn on youtube info api).

once you've made 1 of 2 calls, you'll json packet. in packet, @ items attribute -- it'll have associated channels id or display name. loop on items, , each 1 can access contentdetails.relatedplaylists.uploads id of channel's uploads feed.

with uploads feed id, create 1 final request:

get https://www.googleapis.com/youtube/v3/playlistitems?part=snippet&playlistid={uploads_id}&key={your_api_key}

you'll channel's videos in response json packet's items attribute. note phone call playlistitems endpoint can include maxresults parameter, utilize pagetokens pagination (when there more results phone call returning), etc.

ios youtube-api

Comments

Popular posts from this blog

model view controller - MVC Rails Planning -

ruby on rails - Devise Logout Error in RoR -

html - Submenu setup with jquery and effect 'fold' -