Blogger API examples

API helps to automate.

If you have a blog with 10 posts then no problem to manage it but if you see your site growing. Then it can become a whole problem for management of 100 or 1000 pages. If many people are posting at the same time and you need to analyse content then you automate it with an API. Or you need to publish 100 or 1000 articles written in DOC files in a Blog post. Or delete certain posts that did not contain correct content.

Blogger API docs

Activate blogger API

Create key and login Credentials json file for blogger desktop api.

See examples for client and blogger

Then if you would like to insert something

Example to download posts from blogger and save this information in Django objects in the database.

Update Instance Method documentation

Example Update

service, flags = sample_tools.init(args, 'blogger', 'v3', __doc__, __file__,
posts = service.posts()
body = {}
body["content"] = job.raw_text
body["url"] = job.url
body["title"] = job.title
body["kind"] = "blogger#post"
body["blog"] = {"id": job.blogger_blog_id}
body["id"] = job.blogger_post_id
body["selfLink"] = job.blogger_selfLink
request = posts_service.update(blogId=job.blogger_blog_id, postId=job.blogger_post_id, body=body)

request.execute() # Build and execute HTTPS request


We had a problem with limits so set a timer sleep to slow down code a bit.

10,000 request (list/search/get) per day; with the limit of 100 request per 100 second for each unique IP address.

googleapiclient.errors.HttpError: <HttpError 429 when requesting returned "Quota exceeded for quota metric 'Queries' and limit 'Queries per minute per user' of service '' for consumer 'project_number:710892222816'.". Details: "[{'message': "Quota exceeded for quota metric 'Queries' and limit 'Queries per minute per user' of service '' for consumer 'project_number:710892222816'.", 'domain': 'global', 'reason': 'rateLimitExceeded'}]">