Google

About Google Blog Search Pinging Service API

Google Blog Search

About Google Blog Search

Google Blog Search
Pinging Service


Pinging Service API


The Google Blog Search Pinging Service API allows users who frequently update their blog to programmatically inform Google Blog Search about changes to their blogs. Blogging provider admins can also use this API to notify Google of changes to blogs on their platform(s). To set up automated pinging of Google Blog Search, create either an XML-RPC Client or a REST Client which sends requests as noted below. It doesn't matter which method you choose for notification; both are handled in the same way.


Setting up an XML-RPC Client

An XML-RPC client should construct requests with the following elements:

RPC endpoint: http://blogsearch.google.com/ping/RPC2
Method name: weblogUpdates.extendedPing
Parameters: (should be sent in the same order as listed below)

  • Name of site
  • URL of site
  • URL of the page to be checked for changes
  • URL of RSS, RDF, or Atom feed
  • Optional a name (or "tag") categorizing your site content. You may delimit multiple values by using the '|' character.

The XML-RPC response will contain a <struct> with two members:

  • flerror (Boolean) set to true/1 if an error occurred
  • message (string) containing either "Thanks for the ping." (if successful) or an error message (if unsuccesful).

Example request:


POST /RPC2 HTTP/1.0
User-Agent: request
Host: blogsearch.google.com
Content-Type: text/xml
Content-length: 447

<?xml version="1.0"?>
<methodCall>
  <methodName>weblogUpdates.extendedPing</methodName>
  <params>
    <param>
      <value>Official Google Blog</value>
    </param>
    <param>
      <value>http://googleblog.blogspot.com/</value>
    </param>
    <param>
      <value>http://googleblog.blogspot.com/</value>
    </param>
    <param>
      <value>http://googleblog.blogspot.com/atom.xml</value>
    </param>
  </params>
</methodCall>
  

Example Response


HTTP/1.1 200 OK
Connection: close
Content-Length: 451
Content-Type: text/xml
Date: Sun, 30 Sep 2001 20:02:30 GMT
Server: Apache

<?xml version="1.0"?>
<methodResponse>
  <params>
    <param>
      <value>
        <struct>
          <member>
            <name>flerror</name>
            <value>
              <boolean>0</boolean>
            </value>
          </member>
          <member>
            <name>message</name>
              <value>Thanks for the ping.</value>
          </member>
        </struct>
      </value>
    </param>
  </params>
</methodResponse>

  

Setting up a REST Client

A REST client should construct requests with the following elements:

URL: http://blogsearch.google.com/ping

Parameters:

  • name = name of blog
  • url = URL of blog
  • changesURL = URL of RSS, RDF, or Atom feed (optional)
The response will be plain-text content of either "Thanks for the ping.", if successful, or an error message.

Example:



changes.xml format

Google publishes Blog Search ping activity as an XML file to http://blogsearch.google.com/changes.xml. The changes.xml file format consists of a root <weblogUpdates> element and one or more <weblog> elements.

<weblogUpdates version="2" updated="Wed, 30 May 2006 14:10:00 GMT" count="1384779">
  <weblog name="Some Blog"
          url="http://googleblog.blogspot.com" 
          rssUrl="http://googleblog.blogspot.com/atom.xml"
          when="1"/>
  ...
</weblogUpdates>
  

<weblogUpdates> element

  • version: used to signal a major format change. Current version is 2.
  • updated: datetime in HTTP 1.0 format. This indicates when the file was last updated.
  • count: an increasing number representing the version of changes.xml. Newer versions of changes.xml always have a larger value of count.

<weblog> element

  • name: the name of the blog.
  • url: the url of the blog.
  • rssUrl: the url of the feed, rss, Atom, or otherwise.
  • when: number of seconds to subtract from the updated attribute of the weblogUpdate element in order to determine the time of the ping.