1

I am trying to download data in a JSON format from youtube, via their API. I have setup my python code as such:

import requests 
response = requests.get(https://www.googleapis.com/youtube/v3/commentThreads?part=snippet%2C+replies&maxResults=25&textFormat=plainText&videoId=ufGlBv8Z3NU&key={YOUR_API_KEY})
response.status_code

I am getting a 400 response error code. Basically, I am trying to follow the approach found here:Youtube Try-It

Parameters:

Part:snippet,replies

maxResults:25

textFormat:plainText

videoId:ufGlBv8Z3NU

Am I doing this all wrong? Or is there a better way to do this? My api key is a copy and paste, so I dont think there are any issues there. Any help would be greatly appreciated!

Thanks!

1
  • 1
    It is working for me. Can you post the error message you are getting. Besides the 400 usually there is a JSON explaining the cause. Commented Aug 29, 2015 at 23:25

1 Answer 1

1

You know what, it was a mistake on my part. I pasted the API key inside the curly braces, which gave me the error. Removing the curly braces fixed my issue. Thanks for checking!

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.