Simple YouTube API
latest
  • Download and Installation
  • Getting started with Simple YouTube API
  • Example Scripts
    • Upload a YouTube Video
    • YouTube Search
    • Update a YouTube Video
    • Fetch My Uploads
    • Fetch available categories in YouTube
  • Reference Manual
  • LICENSE
Simple YouTube API
  • »
  • Example Scripts »
  • YouTube Search
  • Edit on GitHub

YouTube Search

from simple_youtube_api.YouTube import YouTube

with open("developer_key", "r") as myfile:
    data = myfile.read().replace("\n", "")

developer_key = data

# logging into youtube
youtube = YouTube()
youtube.login(developer_key)

# searching videos with the term
videos = youtube.search("Your Search Term")

# printing results
for video in videos:
    print(video)

# search a specific video
video = youtube.search_by_video_id("Ks-_Mh1QhMc")
print(video)
Previous Next

© Copyright 2019, Jonne Kaunisto. Revision 704f136a.

Built with Sphinx using a theme provided by Read the Docs.