0

I have a python script which uses Google Blogger API with oauth 2.0. Now the problem is that there is a function blogger.posts.insert. It is returning an error "HTTP 403 'Rate Limited Exceeded'".

Can anybody tell me how to fix this? I also tried to do the same in python and the error is still there..

Note: blogger.posts.update function works perfectly!

credentials = storage.get()
http = httplib2.Http()
http = credentials.authorize(http)
service = build('blogger', 'v3', http=http)
TheBlogID = 'somethingHERE'
print "fetching posts, please wait!"

posts = service.posts()
thisposties = posts.list(blogId=TheBlogID).execute()

posts.insert(blogId=TheBlogID, # THIS IS THE PROBLEM
   body=body, 
   isDraft=False, fetchImages=False, fetchBody=True).execute()

EDIT: Also I must tell you that just a few minutes ago I created credentials by selectingWeb Application here : https://console.developers.google.com/apis/credentials? but it stopped working after adding 50 posts and so I switched to other. Also I tried to create a new credential with Web Application but the redirect URL for urn:ietf:wg:oauth:2.0:oob is denying so currently I am using other as credential for oauth 2.0 and getting this error when trying to insert ...

I also tried from here: https://developers.google.com/apis-explorer/#p/blogger/v3/ Same ERROR... I'm assuming this is some bug with google API...

6
  • How freequently do you send the request? I think it can be a response you get from the API because you send too many requests (and not a problem with your code) Jun 17, 2016 at 21:30
  • It's not working from the start. I'm not sending in a loop so it should've worked at least when the script called the function for the first time but sadly no.
    – ryspbsk
    Jun 17, 2016 at 21:38
  • Is someone else also using those credentials? Jun 17, 2016 at 21:45
  • Nope, I am the only one with access to this.
    – ryspbsk
    Jun 17, 2016 at 21:47
  • EDITED! Check main question please.
    – ryspbsk
    Jun 17, 2016 at 21:51

1 Answer 1

1

I was right, there is a bug with Google Blogger API when using the insert to add posts so this is how I fixed it:

  1. I started Apache using XAMP and apache was running on port 80 ( can be different for you so check it in XAMP control panel ).
  2. I created a Web Application here: https://console.developers.google.com/apis/credentials?
  3. When creating a new web application I made sure to set the redirect URL to http://localhost:80/oauth2callback ( My apache is running on port 80 that is why it is localhost:80 ) You must also add this redirect URL to python code.
  4. Create a new directory in XAMP C:\xampp\htdocs\ oauth2callback
  5. Create an empty index.php in C:\xampp\htdocs\oauth2callback
  6. Go to 192.168.1.1 and do port forwarding for port where apache is running BOTH TCP and UDP for port 80 ( since apache is running on this port for me )
  7. Now simply run your python code and when you get the auth URL then simply open it in your browser and you will be asked to confirm it then do it. You will be redirected to your C:\xampp\htdocs\oauth2callback\index.php and now ignore the blank white screen and simply look at your browser address bar, you will see code=CODEHERE. Now copy that code and simply give it as input for python and then you will be able to use insert
  8. Enjoy :)

I know this is pretty insane but this is how I was able to fix it. NOTE: MAXMIMUM UPLOAD RATE FOR POSTS IS 50 POSTS/DAY.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.