Skip to content

acrcloud/youtube_api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Youtube API

Requirements

  • Python 2.7
  • requests
  • lxml

Usage:

Search 100 channels about vevo:

#!/usr/bin/env python
# coding:utf-8
# params:
# key: keywords
# type: the type of result
# maxresults: the maximum number of items that should be returned in the result set
# num: number of you need
# region: region code , default is US

import youtube_api
youtube = youtube_api.YoutubeAPI('Your api key from Google Api Console')
data = youtube.search('vevo', 'channel', 50, 100, 'US')
print data

Get playlists by channel id

#!/usr/bin/env python
# coding:utf-8
# params:
# channel id

import youtube_api
youtube = youtube_api.YoutubeAPI('Your api key from Google Api Console')
data = youtube.get_playlistid_by_channelid('UC-9-kyTW8ZkZNDHQJ6FgpwQ')
print data

Get video id by playlist id

#!/usr/bin/env python
# coding:utf-8
# params:
# playlist id

import youtube_api
youtube = youtube_api.YoutubeAPI('Your api key from Google Api Console')
data = youtube.get_videoid_by_playlistid('PL976DE11BCA1AF15E')
print data

Get user's uploads playlist by user's channelid

#!/usr/bin/env python
# coding:utf-8
# params:
# user's channel id

import youtube_api
youtube = youtube_api.YoutubeAPI('Your api key from Google Api Console')
data = youtube.get_useruploadsplaylist_by_userchannelid('UCANLZYMidaCbLQFWXBC95Jg')
print data

Get channelid by videoid

#!/usr/bin/env python
# coding:utf-8
# params:
# video id

import youtube_api
youtube = youtube_api.YoutubeAPI
data = youtube.get_channelid_by_videoid('8xg3vE8Ie_E')
print data

Get channelid by username

#!/usr/bin/env python
# coding:utf-8
# params:
# username

import youtube_api
youtube = youtube_api.YoutubeAPI
data = youtube.get_channelid_by_username('TaylorSwiftVEVO')
print data

Determine whether the channel is Verified

#!/usr/bin/env python
# coding:utf-8
# params:
# channel id

import youtube_api
youtube = youtube_api.YoutubeAPI
data = youtube.verify_channel('UCANLZYMidaCbLQFWXBC95Jg')
print data

Youtube Data API v3

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages