Skip to content

Instantly share code, notes, and snippets.

@mickeypash
Created July 4, 2016 21:24
Show Gist options
  • Save mickeypash/dd2eb212f07591076dfaeb594a6d8c05 to your computer and use it in GitHub Desktop.
Save mickeypash/dd2eb212f07591076dfaeb594a6d8c05 to your computer and use it in GitHub Desktop.
import requests
mickey_ch_id = 'UCyHQxCUs1ENbnj36FjesG7Q'
marc_ch_id = 'UCzhG6dIYhenVoRVgcdUexLQ'
stoyan_ch_id = 'stoyanjr'
base_url = 'https://www.googleapis.com/youtube/v3/'
path = 'subscriptions?part=id&channelId=UCyHQxCUs1ENbnj36FjesG7Q&fields=items%2Fid&key='
full_path = '{0}{1}{2}'.format(base_url, path, API_KEY)
print full_path
r = requests.get(full_path)
print r.status_code
@mickeypash
Copy link
Author

Expected output:

{
 "items": [
  {
   "id": "lna0AtDOcTuYBP1NtjnqcJKEqgcrmauOgEVCQiBuwm8"
  },
  {
   "id": "lna0AtDOcTuYBP1NtjnqcOJs9CVRSEmfMQb4Uzc3nu8"
  },
  {
   "id": "lna0AtDOcTuYBP1NtjnqcPok3RpREZzKMBHsaumrAE0"
  },
  {
   "id": "lna0AtDOcTuYBP1NtjnqcGCYZK-wOcNFREtqXmUh3Ws"
  },
  {
   "id": "lna0AtDOcTuYBP1NtjnqcEBkmlnRxiaVlqLAY3stiWM"
  }
 ]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment