How can I get only video ID of video? As I know, I should use fields for that but I don\'t understand how do they work. My code:
service = build(\'youtube\', \'v
Try out below code:
import requests
import json
payload = {'part': 'snippet', 'key': DEVELOPER_KEY, 'order':'viewCount', 'q': 'A R Rahman', 'maxResults': 1}
l = requests.Session().get('https://www.googleapis.com/youtube/v3/search', params=payload)
resp_dict = json.loads(l.content)
print resp_dict['items']
for i in resp_dict['items']:
print "VideoId: ",i['id']['videoId']