Hide

Blogger API: Using the API

The Blogger API enables you to integrate Blogger content with your application by using the REST APIs. Before you begin, you will need to set up authorization.

Contents

Introduction

This document is intended for developers who want to write applications that can interact with the Blogger API. Blogger is a tool for creating websites that allow people to publish their thoughts on an ongoing basis.

If you're unfamiliar with Blogger concepts, you should read Getting Started before starting to code.

Authorizing requests and identifying your application

Every request your application sends to the Blogger API must identify your application to Google. You can identify your application by using an OAuth 2.0 token, which also authorizes the request, or using the application's API key. Here's how to determine which of those options to use:

  • If the request requires authorization, such as a request for an individual's private data, the application must provide an OAuth 2.0 token with the request.
  • If the request doesn't require authorization, such as a request for public data, then the application must provide either the API key or an OAuth 2.0 token.

Authorization protocols

Your application must use OAuth 2.0 to authorize requests. No other authorization protocols are supported.

Authorizing requests with OAuth 2.0

Requests to the Blogger API for non-public user data must be authorized by an authenticated user.

The details of the authorization process, or "flow," for OAuth 2.0 vary depending on the type of application you are developing. The following general process applies to all application types:

  1. When you create your application, you register it with Google. Google then provides information you'll need later, including a client ID and a client secret.
  2. Activate the Blogger API in the Services pane of the Google APIs Console.
  3. When your application needs access to user data, it asks Google for a particular scope of access.
  4. Google displays an OAuth dialog to the user, asking them to authorize your application to request some of their data.
  5. If the user approves, then Google gives your application a short-lived access token.
  6. Your application requests user data, attaching the access token to the request.
  7. If Google determines that your request and the token are valid, it returns the requested data.

Some flows include additional steps, such as using refresh tokens to acquire new access tokens. For detailed information about flows for various types of applications, see Google's OAuth 2.0 documentation.

Here's the OAuth 2.0 scope information for the Blogger API:

https://www.googleapis.com/auth/blogger

To request access using OAuth 2.0, your application needs the scope information, as well as information that Google supplies during application registration (such as the client ID and/or the client secret).

Tip: The Google APIs client libraries can handle some of the authorization process for you. They are available for a variety of programming languages; check the Libraries and Samples page for more details.

Acquiring and using an API key

  1. Go to the Google Developers Console.
  2. Select a project, or create a new one.
  3. In the sidebar on the left, expand APIs & auth. Next, click APIs. Select the Enabled APIs link in the API section to see a list of all your enabled APIs. Make sure that the Blogger APIs is on the list of enabled APIs. If you have not enabled it, select the API from the list of APIs, then select the Enable API button for the API.
  4. In the sidebar on the left, select Credentials.
  5. This API supports two types of credentials. Create whichever credentials are appropriate for your project:
    • OAuth: Your application must send an OAuth 2.0 token with any request that accesses private user data. Your application sends a client ID and, possibly, a client secret to obtain a token. You can generate OAuth 2.0 credentials for web applications, service accounts, or installed applications.

      To create an OAuth 2.0 token, click Create new Client ID, provide the required information where requested, and click Create Client ID.

      You can generate OAuth 2.0 credentials for web applications, service accounts, or installed applications.

      Web applications

      A web application is accessed by web browsers over a network.

      • Applications that use JavaScript to access the Blogger APIs must specify authorized JavaScript origins. The origins identify the domains from which your application can send API requests.
      • Applications that use languages and frameworks like PHP, Java, Python, Ruby, and .NET must specify authorized redirect URIs. The redirect URIs are the endpoints to which the OAuth 2.0 server can send responses.

      Service accounts

      A service account is used in an application that calls APIs on behalf of an application that does not access user information. This type of application needs to prove its own identity, but it does not need a user to authorize requests. The Google Accounts documentation contains more details about service accounts.

      Installed applications

      An installed application runs on a desktop computer or handheld device. You can create OAuth 2.0 credentials for Android, Chrome, iOS, and other installed applications.

      Android

      You need to specify your Android app's package name and SHA1 fingerprint.

      1. In the Package name field, enter your Android app's package name.
      2. In a terminal, run the Keytool utility to get the SHA1 fingerprint for your digitally signed .apk file's public certificate.
        keytool -exportcert -alias androiddebugkey -keystore path-to-debug-or-production-keystore -list -v

        The Keytool prints the fingerprint to the shell. For example:

        $ keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore -list -v
        Enter keystore password: Type "android" if using debug.keystore
        Alias name: androiddebugkey
        Creation date: Aug 27, 2012
        Entry type: PrivateKeyEntry
        Certificate chain length: 1
        Certificate[1]:
        Owner: CN=Android Debug, O=Android, C=US
        Issuer: CN=Android Debug, O=Android, C=US
        Serial number: 503bd581
        Valid from: Mon Aug 27 13:16:01 PDT 2012 until: Wed Aug 20 13:16:01 PDT 2042
        Certificate fingerprints:
           MD5:  1B:2B:2D:37:E1:CE:06:8B:A0:F0:73:05:3C:A3:63:DD
           SHA1: D8:AA:43:97:59:EE:C5:95:26:6A:07:EE:1C:37:8E:F4:F0:C8:05:C8
           SHA256: F3:6F:98:51:9A:DF:C3:15:4E:48:4B:0F:91:E3:3C:6A:A0:97:DC:0A:3F:B2:D2:E1:FE:23:57:F5:EB:AC:13:30
           Signature algorithm name: SHA1withRSA
           Version: 3

        Copy the SHA1 fingerprint, which is highlighted in the example above.

      3. Paste the SHA1 fingerprint into the form where requested.
      4. Click Create Client ID.

      Chrome application

      You need to specify the Application ID for your Chrome app or extension. Use the Google Chrome Identity API to obtain that ID.

    • iOS

      You need to specify the app's Bundle ID and App Store ID.

      • The application's Bundle ID is the bundle identifier as listed in the app's .plist file. For example: com.example.myapp.
      • The application's App Store ID is in the app's iTunes URL so long as the app was published in the Apple iTunes App Store. For example, in the app URL http://itunes.apple.com/us/app/google+/id447119634, the App Store ID is 447119634.

      Other

      The Developers Console does not require any additional information to create OAuth 2.0 credentials for other types of installed applications.

    • Public API access: A request that does not provide an OAuth 2.0 token must send an API key. The key identifies your project and provides API access, quota, and reports.

      The API supports several types of API keys. If the key type that you need does not already exist, create an API key by selecting Create New Key and then selecting the appropriate key type. Then enter the additional data for that key type and click Create.

      Server keys

      Create and use a server key if your application runs on a server. Do not use this key outside of your server code. For example, do not embed it in a web page. To prevent quota theft, restrict your key so that requests are only allowed from your servers' source IP addresses.

      Browser keys

      Create and use a browser key if your application runs on a client, such as a web browser. To prevent your key from being used on unauthorized sites, only allow referrals from domains you administer.

      iOS keys

      Create and use an iOS key if your application runs on iOS devices. Google verifies that each request originates from an iOS application that matches one of the bundle identifiers you specify. An app's .plist file contains its bundle identifier. Example: com.example.MyApp

      Android keys

      Create and use an Android key if your application runs on Android devices. To do so, you need to specify the SHA1 fingerprints and package names of the application using that key.

      1. In a terminal, run the Keytool utility to get the SHA1 fingerprint for your digitally signed .apk file's public certificate.
        keytool -exportcert -alias androiddebugkey -keystore path-to-debug-or-production-keystore -list -v

        The Keytool prints the fingerprint to the shell. For example:

        $ keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore -list -v
        Enter keystore password: Type "android" if using debug.keystore
        Alias name: androiddebugkey
        Creation date: Aug 27, 2012
        Entry type: PrivateKeyEntry
        Certificate chain length: 1
        Certificate[1]:
        Owner: CN=Android Debug, O=Android, C=US
        Issuer: CN=Android Debug, O=Android, C=US
        Serial number: 503bd581
        Valid from: Mon Aug 27 13:16:01 PDT 2012 until: Wed Aug 20 13:16:01 PDT 2042
        Certificate fingerprints:
           MD5:  1B:2B:2D:37:E1:CE:06:8B:A0:F0:73:05:3C:A3:63:DD
           SHA1: D8:AA:43:97:59:EE:C5:95:26:6A:07:EE:1C:37:8E:F4:F0:C8:05:C8
           SHA256: F3:6F:98:51:9A:DF:C3:15:4E:48:4B:0F:91:E3:3C:6A:A0:97:DC:0A:3F:B2:D2:E1:FE:23:57:F5:EB:AC:13:30
           Signature algorithm name: SHA1withRSA
           Version: 3

        Copy the SHA1 fingerprint, which is highlighted in the example above.

      2. Paste the SHA1 fingerprint into the form where requested.
      3. After the fingerprint, type a semicolon and then enter your Android app's package name.
      4. Click Create.

To keep your API keys secure, follow the best practices for securely using API keys.

Working with blogs

Retrieving a blog

You can retrieve information for a particular blog by sending an HTTP GET request to the blog's URI. The URI for a blog has the following format:

https://www.googleapis.com/blogger/v3/blogs/blogId

Request

GET https://www.googleapis.com/blogger/v3/blogs/2399953?key=YOUR-API-KEY

A user does not need to be authenticated to retrieve a public blog. The application does not need to include Authorization HTTP header for a public blog request; however, you do need to provide the API key.

Blogger also has private blogs, which require authentication.

Response

If the request succeeds, the server responds with an HTTP 200 OK status code and the blog data:

{
  "kind": "blogger#blog",
  "id": "2399953",
  "name": "Blogger Buzz",
  "description": "The Official Buzz from Blogger at Google",
  "published": "2007-04-23T22:17:29.261Z",
  "updated": "2011-08-02T06:01:15.941Z",
  "url": "http://buzz.blogger.com/",
  "selfLink": "https://www.googleapis.com/blogger/v3/blogs/2399953",
  "posts": {
    "totalItems": 494,
    "selfLink": "https://www.googleapis.com/blogger/v3/blogs/2399953/posts"
  },
  "pages": {
    "totalItems": 2,
    "selfLink": "https://www.googleapis.com/blogger/v3/blogs/2399953/pages"
  },
  "locale": {
    "language": "en",
    "country": "",
    "variant": ""
  }
}

Retrieving a blog by its URL

You can retrieve a blog using its URL by sending an HTTP GET request to the following URI with a url parameter:

https://www.googleapis.com/blogger/v3/blogs/byurl?url=blog-url

Request

https://www.googleapis.com/blogger/v3/blogs/byurl?url=http://code.blogger.com/

Response

If the request succeeds, the server responds with an HTTP 200 OK status code and the full representation of the identified blog:

{
 "kind": "blogger#blog",
 "id": "3213900",
 "name": "Blogger Developers Network",
 "description": "The official Blogger Developers Network weblog.",
 "published": "2007-02-09T10:13:10-08:00",
 "updated": "2012-04-15T19:38:01-07:00",
 "url": "http://code.blogger.com/",
 "selfLink": "https://www.googleapis.com/blogger/v3/blogs/3213900",
 "posts": {
  "totalItems": 55,
  "selfLink": "https://www.googleapis.com/blogger/v3/blogs/3213900/posts"
 },
 "pages": {
  "totalItems": 1,
  "selfLink": "https://www.googleapis.com/blogger/v3/blogs/3213900/pages"
 },
 "locale": {
  "language": "en",
  "country": "US",
  "variant": ""
 }
}

Retrieving a user's blogs

You can retrieve a list of a user's blogs by sending an HTTP GET request to the blogs collection URI:

https://www.googleapis.com/blogger/v3/users/userId/blogs

Request

GET https://www.googleapis.com/blogger/v3/users/self/blogs
Authorization: /* OAuth 2.0 token here */

Note: The user must be authenticated to list their own blogs, so you must provide the Authorization HTTP header with the GET request.

Response

If the request succeeds, the server responds with an HTTP 200 OK status code and the full representation of the list of the user's blogs:

{
  "kind": "blogger#blogList",
  "items": [
    {
      "kind": "blogger#blog",
      "id": "4967929378133675647",
      "name": "Brett's Test Blawg",
      "description": "",
      "published": "2010-10-06T23:33:31.662Z",
      "updated": "2011-08-08T06:50:02.005Z",
      "url": "http://brettmorgan-test-blawg.blogspot.com/",
      "selfLink": "https://www.googleapis.com/blogger/v3/blogs/4967929378133675647",
      "posts": {
        "totalItems": 13,
        "selfLink": "https://www.googleapis.com/blogger/v3/blogs/4967929378133675647/posts"
      },
      "pages": {
        "totalItems": 1,
        "selfLink": "https://www.googleapis.com/blogger/v3/blogs/4967929378133675647/pages"
      },
      "locale": {
        "language": "en",
        "country": "",
        "variant": ""
      }
    }
  ]
}

Working with posts

Retrieving posts from a blog

You can retrieve a list of posts from a given blog by sending a GET request to the posts collection URI. The URI for a posts collection has the following format:

https://www.googleapis.com/blogger/v3/blogs/blogId/posts

Request

Here is an example:

GET https://www.googleapis.com/blogger/v3/blogs/2399953/posts?key=YOUR-API-KEY

A user does not need to be authenticated to retrieve a public blog. The application does not need to include Authorization HTTP header for a public blog request; however, you do need to provide the API key.

Blogger also has private blogs, which require authentication.

Response

If the request succeeds, the server responds with an HTTP 200 OK status code and the list of posts:

{
  "kind": "blogger#postList",
  "nextPageToken": "CgkIChiAkceVjiYQ0b2SAQ",
  "prevPageToken": "CgkIChDBwrK3mCYQ0b2SAQ",
  "items": [
    {
      "kind": "blogger#post",
      "id": "7706273476706534553",
      "blog": {
        "id": "2399953"
      },
      "published": "2011-08-01T19:58:00.000Z",
      "updated": "2011-08-01T19:58:51.947Z",
      "url": "http://buzz.blogger.com/2011/08/latest-updates-august-1st.html",
      "selfLink": "https://www.googleapis.com/blogger/v3/blogs/2399953/posts/7706273476706534553",
      "title": "Latest updates, August 1st",
      "content": "elided for readability",
      "author": {
        "id": "401465483996",
        "displayName": "Brett Wiltshire",
        "url": "http://www.blogger.com/profile/01430672582309320414",
        "image": {
          "url": "http://4.bp.blogspot.com/_YA50adQ-7vQ/S1gfR_6ufpI/AAAAAAAAAAk/1ErJGgRWZDg/S45/brett.png"
         }
      },
      "replies": {
        "totalItems": "0",
        "selfLink": "https://www.googleapis.com/blogger/v3/blogs/2399953/posts/7706273476706534553/comments"
      }
    },
    {
      "kind": "blogger#post",
      "id": "6069922188027612413",
      elided for readability
    }
  ]
}

Retrieving a specific post

You can retrieve a specific post from a blog by sending a GET request to the posts resource URI. The URI for a posts resource has the following format:

https://www.googleapis.com/blogger/v3/blogs/blogId/posts/postId

Request

GET https://www.googleapis.com/blogger/v3/blogs/2399953/posts/7706273476706534553?key=YOUR-API-KEY

A user does not need to be authenticated to retrieve a public blog. The application does not need to include Authorization HTTP header for a public blog request; however, you do need to provide the API key.

Blogger also has private blogs, which require authentication.

Response

If the request succeeds, the server responds with an HTTP 200 OK status code and the contents of the post:

{
  "kind": "blogger#post",
  "id": "7706273476706534553",
  "blog": {
    "id": "2399953"
  },
  "published": "2011-08-01T19:58:00.000Z",
  "updated": "2011-08-01T19:58:51.947Z",
  "url": "http://buzz.blogger.com/2011/08/latest-updates-august-1st.html",
  "selfLink": "https://www.googleapis.com/blogger/v3/blogs/2399953/posts/7706273476706534553",
  "title": "Latest updates, August 1st",
  "content": "elided for readability",
  "author": {
    "id": "401465483996",
    "displayName": "Brett Wiltshire",
    "url": "http://www.blogger.com/profile/01430672582309320414",
    "image": {
      "url": "http://4.bp.blogspot.com/_YA50adQ-7vQ/S1gfR_6ufpI/AAAAAAAAAAk/1ErJGgRWZDg/S45/brett.png"
    }
  },
  "replies": {
    "totalItems": "0",
    "selfLink": "https://www.googleapis.com/blogger/v3/blogs/2399953/posts/7706273476706534553/comments"
  }
}

Searching for a post

You can search for posts from a blog by sending a GET request to the post search URI with the q search query parameter:

https://www.googleapis.com/blogger/v3/blogs/blogId/posts/search?q=query terms

Request

GET https://www.googleapis.com/blogger/v3/blogs/3213900/posts/search?q=documentation&key=YOUR-API-KEY

A user does not need to be authenticated to retrieve a public blog. The application does not need to include Authorization HTTP header for a public blog request; however, you do need to provide the API key.

Blogger also has private blogs, which require authentication.

Response

If the request succeeds, the server responds with an HTTP 200 OK status code and the contents of the post:

{
  "kind": "blogger#postList",
  "nextPageToken": "CgkIChiAj86CpB8QzJTEAQ",
  "prevPageToken": "CgkIChDBq5v24yYQzJTEAQ",
  "items": [
  {
    "kind": "blogger#post",
    "id": "1387873546480002228",
    "blog": {
      "id": "3213900"
    },
    "published": "2012-03-23T01:58:00-07:00",
    "updated": "2012-03-23T01:58:12-07:00",
    "url": "http://code.blogger.com/2012/03/blogger-documentation-has-moved-to.html",
    "selfLink": "https://www.googleapis.com/blogger/v3/blogs/3213900/posts/1387873546480002228",
    "title": "Blogger Documentation has moved to developers.google.com",
    "content": "content elided for readability",
    "author": {
      "id": "16258312240222542576",
      "displayName": "Brett Morgan",
      "url": "http://www.blogger.com/profile/16258312240222542576",
      "image": {
        "url": "http://img2.blogblog.com/img/b16-rounded.gif"
      }
    },
    "replies": {
      "totalItems": "0",
      "selfLink": "https://www.googleapis.com/blogger/v3/blogs/3213900/posts/1387873546480002228/comments"
    }
  },
  ...
  ]
}

Adding a post

You can add a post for a blog by sending a POST request to the post collection URI with a post JSON body:

https://www.googleapis.com/blogger/v3/blogs/blogId/posts/

Request

POST https://www.googleapis.com/blogger/v3/blogs/8070105920543249955/posts/
Authorization: /* OAuth 2.0 token here */
Content-Type: application/json

{
  "kind": "blogger#post",
  "blog": {
    "id": "8070105920543249955"
  },
  "title": "A new post",
  "content": "With <b>exciting</b> content..."
}

You must be authenticated to create a post.

Response

If the request succeeds, the server responds with an HTTP 200 OK status code and the contents of the post:

{
 "kind": "blogger#post",
 "id": "6819100329896798058",
 "blog": {
  "id": "8070105920543249955"
 },
 "published": "2012-05-20T20:08:00-07:00",
 "updated": "2012-05-20T20:08:35-07:00",
 "url": "http://brettmorgan-test2.blogspot.com/2012/05/new-post.html",
 "selfLink": "https://www.googleapis.com/blogger/v3/blogs/8070105920543249955/posts/6819100329896798058",
 "title": "A new post",
 "content": "With <b>exciting</b> content...",
 "author": {
  "id": "16258312240222542576",
  "displayName": "Brett Morgan",
  "url": "http://www.blogger.com/profile/16258312240222542576",
  "image": {
   "url": "http://img2.blogblog.com/img/b16-rounded.gif"
  }
 },
 "replies": {
  "totalItems": "0",
  "selfLink": "https://www.googleapis.com/blogger/v3/blogs/8070105920543249955/posts/6819100329896798058/comments"
 }
}

Deleting a post

You can delete a post for a blog by sending a DELETE request to the post resource URI:

https://www.googleapis.com/blogger/v3/blogs/blogId/posts/postId

Request

Here is an example:

DELETE https://www.googleapis.com/blogger/v3/blogs/8070105920543249955/posts/6819100329896798058
Authorization: /* OAuth 2.0 token here */

You must be authenticated to delete a post.

Response

If the request succeeds, the server responds with an HTTP 200 OK status code.

Retrieving a post by its path

You can retrieve a post from a blog by sending a GET request to the posts bypath URI with a path parameter. The URI for a posts by path request has the following format:

https://www.googleapis.com/blogger/v3/blogs/blogId/posts/bypath?path=post-path

Request

https://www.googleapis.com/blogger/v3/blogs/2399953/posts/bypath?path=/2011/08/latest-updates-august-1st.html&key=YOUR-API-KEY

A user does not need to be authenticated to retrieve a public blog. The application does not need to include Authorization HTTP header for a public blog request; however, you do need to provide the API key.

Blogger also has private blogs, which require authentication.

Response

If the request succeeds, the server responds with an HTTP 200 OK status code and the contents of the post:

{
  "kind": "blogger#post",
  "id": "7706273476706534553",
  "blog": {
    "id": "2399953"
  },
  "published": "2011-08-01T19:58:00.000Z",
  "updated": "2011-08-01T19:58:51.947Z",
  "url": "http://buzz.blogger.com/2011/08/latest-updates-august-1st.html",
  "selfLink": "https://www.googleapis.com/blogger/v3/blogs/2399953/posts/7706273476706534553",
  "title": "Latest updates, August 1st",
  "content": "elided for readability",
  "author": {
    "id": "401465483996",
    "displayName": "Brett Wiltshire",
    "url": "http://www.blogger.com/profile/01430672582309320414",
    "image": {
      "url": "http://4.bp.blogspot.com/_YA50adQ-7vQ/S1gfR_6ufpI/AAAAAAAAAAk/1ErJGgRWZDg/S45/brett.png"
    }
  },
  "replies": {
    "totalItems": "0",
    "selfLink": "https://www.googleapis.com/blogger/v3/blogs/2399953/posts/7706273476706534553/comments"
  }
}

Updating a post

You can update a post for a blog by sending a PUT request to the post resource URI with a post JSON body:

https://www.googleapis.com/blogger/v3/blogs/blogId/posts/postId

Request

PUT https://www.googleapis.com/blogger/v3/blogs/8070105920543249955/posts/3445355871727114160
Authorization: /* OAuth 2.0 token here */
Content-Type: application/json

{
 "kind": "blogger#post",
 "id": "3445355871727114160",
 "blog": {
  "id": "8070105920543249955"
 },
 "url": "http://brettmorgan-test2.blogspot.com/2012/05/new-post_20.html",
 "selfLink": "https://www.googleapis.com/blogger/v3/blogs/8070105920543249955/posts/3445355871727114160",
 "title": "An updated post",
 "content": "With really <b>exciting</b> content..."
}

You must be authenticated to update a post.

Response

If the request succeeds, the server responds with an HTTP 200 OK status code and the contents of the post:

{
 "kind": "blogger#post",
 "id": "6819100329896798058",
 "blog": {
  "id": "8070105920543249955"
 },
 "published": "2012-05-20T20:08:00-07:00",
 "updated": "2012-05-20T20:08:35-07:00",
 "url": "http://brettmorgan-test2.blogspot.com/2012/05/new-post.html",
 "selfLink": "https://www.googleapis.com/blogger/v3/blogs/8070105920543249955/posts/6819100329896798058",
 "title": "An updated post",
 "content": "With really <b>exciting</b> content...",
 "author": {
  "id": "16258312240222542576",
  "displayName": "Brett Morgan",
  "url": "http://www.blogger.com/profile/16258312240222542576",
  "image": {
   "url": "http://img2.blogblog.com/img/b16-rounded.gif"
  }
 },
 "replies": {
  "totalItems": "0",
  "selfLink": "https://www.googleapis.com/blogger/v3/blogs/8070105920543249955/posts/6819100329896798058/comments"
 }
}

Updating A post with patch semantics

You can update a post with patch semantics by sending a PATCH request to the post resource URI with a post JSON body:

https://www.googleapis.com/blogger/v3/blogs/blogId/posts/postId

Request

Here is an example:

PATCH https://www.googleapis.com/blogger/v3/blogs/8070105920543249955/posts/3445355871727114160
Authorization: /* OAuth 2.0 token here */
Content-Type: application/json

{
 "content": "With absolutely <b>fabulous</b> content..."
}

You must be authenticated to update a post.

Response

If the request succeeds, the server responds with an HTTP 200 OK status code and the contents of the post:

{
 "kind": "blogger#post",
 "id": "6819100329896798058",
 "blog": {
  "id": "8070105920543249955"
 },
 "published": "2012-05-20T20:08:00-07:00",
 "updated": "2012-05-20T20:08:35-07:00",
 "url": "http://brettmorgan-test2.blogspot.com/2012/05/new-post.html",
 "selfLink": "https://www.googleapis.com/blogger/v3/blogs/8070105920543249955/posts/6819100329896798058",
 "title": "An updated post",
 "content": "With absolutely <b>fabulous</b> content...",
 "author": {
  "id": "16258312240222542576",
  "displayName": "Brett Morgan",
  "url": "http://www.blogger.com/profile/16258312240222542576",
  "image": {
   "url": "http://img2.blogblog.com/img/b16-rounded.gif"
  }
 },
 "replies": {
  "totalItems": "0",
  "selfLink": "https://www.googleapis.com/blogger/v3/blogs/8070105920543249955/posts/6819100329896798058/comments"
 }
}

Working with comments

Retrieving comments for a post

You can retrieve a list of comments for a post by sending a GET request to the comments collection URI. The URI for a comments collection has the following format:

https://www.googleapis.com/blogger/v3/blogs/blogId/posts/postId/comments

Request

GET https://www.googleapis.com/blogger/v3/blogs/2399953/posts/6069922188027612413/comments?key=YOUR-API-KEY

"A user does not need to be authenticated to retrieve a public blog. The application does not need to include Authorization HTTP header for a public blog request; however, you do need to provide the API key.

Blogger also has private blogs, which require authentication.

Response

If the request succeeds, the server responds with an HTTP 200 OK status code and the list of comments:

{
  "kind": "blogger#commentList",
  "nextPageToken": "CgkIFBDwjvDXlyYQ0b2SARj9mZe9n8KsnlQ",
  "prevPageToken": "CgkIFBisvMGRlyYQ0b2SARj9mZe9n8KsnlQ",
  "items": [
    {
       "kind": "blogger#comment",
       "id": "9200761938824362519",
       "post": {
         "id": "6069922188027612413"
       },
       "blog": {
         "id": "2399953"
       },
       "published": "2011-07-28T19:19:57.740Z",
       "updated": "2011-07-28T21:29:42.015Z",
       "selfLink": "https://www.googleapis.com/blogger/v3/blogs/2399953/posts/6069922188027612413/comments/9200761938824362519",
       "content": "elided",
       "author": {
         "id": "530579030283",
         "displayName": "elided",
         "url": "elided",
         "image": {
           "url": "elided"
         }
       }
    },
    {
      "kind": "blogger#comment",
      "id": "400101178920857170",
      elided for readability
    }
  ]
}

Retrieving a specific comment

You can retrieve a specific comment from a post by sending a GET request to the comments resource URI. The URI for a comments resource has the following format:

https://www.googleapis.com/blogger/v3/blogs/blogId/posts/postId/comments/commentId

Request

GET https://www.googleapis.com/blogger/v3/blogs/2399953/posts/6069922188027612413/comments/9200761938824362519?key=YOUR-API-KEY

"A user does not need to be authenticated to retrieve a public blog. The application does not need to include Authorization HTTP header for a public blog request; however, you do need to provide the API key.

Blogger also has private blogs, which require authentication.

Response

If the request succeeds, the server responds with an HTTP 200 OK status code and the comment data:

{
  "kind": "blogger#comment",
  "id": "9200761938824362519",
  "post": {
    "id": "6069922188027612413"
  },
  "blog": {
    "id": "2399953"
  },
  "published": "2011-07-28T19:19:57.740Z",
  "updated": "2011-07-28T21:29:42.015Z",
  "selfLink": "https://www.googleapis.com/blogger/v3/blogs/2399953/posts/6069922188027612413/comments/9200761938824362519",
  "content": "elided",
  "author": {
    "id": "530579030283",
    "displayName": "elided",
    "url": "elided",
    "image": {
      "url": "elided"
    }
  }
}

Working with pages

Retrieving pages for a blog

You can retrieve a list of pages for a blog by sending a GET request to the pages collection URI. The URI for a pages collection has the following format:

https://www.googleapis.com/blogger/v3/blogs/blogId/pages

Request

GET https://www.googleapis.com/blogger/v3/blogs/4967929378133675647/pages?key=YOUR-API-KEY

"A user does not need to be authenticated to retrieve a public blog. The application does not need to include Authorization HTTP header for a public blog request; however, you do need to provide the API key.

Blogger also has private blogs, which require authentication.

Response

If the request succeeds, the server responds with an HTTP 200 OK status code and the list of pages:

{
  "kind": "blogger#pageList",
  "items": [
    {
      "kind": "blogger#page",
      "id": "273541696466681878",
      "blog": {
        "id": "4967929378133675647"
      },
      "published": "2011-07-14T16:16:00.000Z",
      "updated": "2011-07-14T16:16:23.602Z",
      "url": "http://brettmorgan-test-blawg.blogspot.com/p/static-content.html",
      "selfLink": "https://www.googleapis.com/blogger/v3/blogs/4967929378133675647/pages/273541696466681878",
      "title": "Static Content",
      "content": "elided for readability",
      "author": {
        "id": "901569848744",
        "displayName": "brett",
        "url": "http://www.blogger.com/profile/16258312240222542576",
        "image": {
          "url": "http://img2.blogblog.com/img/b16-rounded.gif"
        }
      }
    }
  ]
}

Retrieving a specific page

You can retrieve a specific page from a blog by sending a GET request to the pages resource URI. The URI for a pages Resource has the following format:

https://www.googleapis.com/blogger/v3/blogs/blogId/pages/pageId

Request

GET https://www.googleapis.com/blogger/v3/blogs/4967929378133675647/pages/273541696466681878?key=YOUR-API-KEY

"A user does not need to be authenticated to retrieve a public blog. The application does not need to include Authorization HTTP header for a public blog request; however, you do need to provide the API key.

Blogger also has private blogs, which require authentication.

Response

If the request succeeds, the server responds with an HTTP 200 OK status code and the page data:

{
  "kind": "blogger#page",
  "id": "273541696466681878",
  "blog": {
    "id": "4967929378133675647"
  },
  "published": "2011-07-14T16:16:00.000Z",
  "updated": "2011-07-14T16:16:23.602Z",
  "url": "http://brettmorgan-test-blawg.blogspot.com/p/static-content.html",
  "selfLink": "https://www.googleapis.com/blogger/v3/blogs/4967929378133675647/pages/273541696466681878",
  "title": "Static Content",
  "content": "elided for readability",
  "author": {
    "id": "901569848744",
    "displayName": "brett",
    "url": "http://www.blogger.com/profile/16258312240222542576",
    "image": {
      "url": "http://img2.blogblog.com/img/b16-rounded.gif"
    }
  }
}

Working with users

Retrieving a user

You can retrieve a user's information by sending an HTTP GET request to the users resource URI:

https://www.googleapis.com/blogger/v3/users/userId

Request

GET https://www.googleapis.com/blogger/v3/users/self
Authorization: /* OAuth 2.0 token here */

Note: The user must be authenticated to list their own information, so you must provide the Authorization HTTP header with the GET request.

Response

If the request succeeds, the server responds with an HTTP 200 OK status code and a link to a list of the user's blogs:

{
  "kind": "blogger#user",
  "id": "901569848744",
  "selfLink": "https://www.googleapis.com/blogger/v3/users/901569848744",
  "blogs": {
    "selfLink": "https://www.googleapis.com/blogger/v3/users/901569848744/blogs"
  }
}

Standard query parameters

The following query parameters can be used with all methods and all resources in the Blogger APIs.

Query parameters that apply to all Blogger APIs operations are shown in the table below.

Notes (on API keys and auth tokens):

  1. The key parameter is required with every request, unless you provide an OAuth 2.0 token with the request.
  2. You must send an authorization token with every request that is marked (AUTHENTICATED). OAuth 2.0 is the preferred authorization protocol.
  3. You can provide an OAuth 2.0 token with any request in one of two ways:
    • Using the access_token query parameter like this: ?access_token=oauth2-token
    • Using the HTTP Authorization header like this: Authorization: Bearer oauth2-token

All parameters are optional except where noted.

Parameter Meaning Notes
access_token OAuth 2.0 token for the current user.
callback Callback function.
  • Name of the JavaScript callback function that handles the response.
  • Used in JavaScript JSON-P requests.
fields Selector specifying a subset of fields to include in the response.
  • For more information, see the partial response section in the Performance Tips document.
  • Use for better performance.
key API key. (REQUIRED*)
  • *Required unless you provide an OAuth 2.0 token.
  • Your API key identifies your project and provides you with API access, quota, and reports.
  • Obtain your project's API key from the Google Developers Console.
prettyPrint

Returns response with indentations and line breaks.

  • Returns the response in a human-readable format if true.
  • Default value: true.
  • When this is false, it can reduce the response payload size, which might lead to better performance in some environments.
quotaUser Alternative to userIp.
  • Lets you enforce per-user quotas from a server-side application even in cases when the user's IP address is unknown. This can occur, for example, with applications that run cron jobs on App Engine on a user's behalf.
  • You can choose any arbitrary string that uniquely identifies a user, but it is limited to 40 characters.
  • Overrides userIp if both are provided.
  • Learn more about capping usage.
userIp IP address of the end user for whom the API call is being made.
  • Lets you enforce per-user quotas when calling the API from a server-side application.
  • Learn more about capping usage.