Sign in

Google Base Help



RSS 2.0 specification

Print

This document provides guidelines for the creation of a Google Base XML data feed in the RSS 2.0 format. We've linked standard attributes to their respective sections in the official RSS 2.0 specification to assist you in finding additional information about the components from our examples. Although we provide examples of RSS 2.0 files, we provide minimal details about RSS 2.0 itself. If you are interested in learning more about this standard, we suggest looking over this specification at http://blogs.law.harvard.edu/tech/rss.


Section 1: RSS 2.0

Below is an example of a basic RSS 2.0 document containing a single item. Based on the RSS 2.0 specification, there are three pre-defined elements at the item level - title, link, and description. Although these elements are optional in the RSS 2.0 standard, Google Base requires them.

<?xml version="1.0"?>
<rss version="2.0">
<channel>
<title>Google Jobs</title>
<link>http://www.google.com/support/jobs/</link>
<description>Information about job openings at Google Inc.</description>
<item>
<title>HR Analyst - Mountain View</title> <link>http://www.google.com/support/jobs/bin/topic.py?dep_id=1077&amp;loc_id=1116</link> <description>We have an immediate need for an experienced analytical HR professional. The ideal candidate has a proven record of developing analytical frameworks to make fact-based decisions.</description>
</item> </channel> </rss>


Section 2: Extending RSS 2.0

As we can see, the pre-defined attributes only allow for limited details about an item. To include more detailed information about an item, we've extended RSS 2.0 by adding the Google Base namespace. Defining the Google Base namespace allows you to use additional elements, called "attributes" in Google Base, and increases the amount of information you can provide about each item in a feed.

In this next example, we've taken the sample item introduced above and included additional attributes defined in the Google Base namespace:

<?xml version="1.0"?>
<rss version="2.0"
xmlns:g="http://base.google.com/ns/1.0">
<channel>
<title>Google Jobs</title> <link>http://www.google.com/support/jobs/</link> <description>Information about job openings at Google Inc.</description> <item> <title>HR Analyst - Mountain View</title> <link> http://www.google.com/support/jobs/bin/topic.py?dep_id=1077&amp;loc_id=1116</link> <description>We have an immediate need for an experienced analytical HR professional. The ideal candidate has a proven record of developing analytical frameworks to make fact-based decisions.</description>
<g:image_link>http://www.google.com/images/google_sm.gif</g:image_link> <g:expiration_date>2005-11-15</g:expiration_date> <g:job_function>Analyst</g:job_function> <g:location>1600 Amphitheatre Parkway, Mountain View, CA, 94043, USA</g:location>
</item> </channel> </rss>

The two major additions in this example are the addition of the namespace declaration (xmlns:g="http://base.google.com/ns/1.0") and the inclusion of four Google Base attributes (image_link, expiration_date, job_function, and location).

Google Base Namespace Declaration

The following namespace declaration is required in order to use attributes defined only in the Google Base namespace.

xmlns:g="http://base.google.com/ns/1.0"

In addition to declaring the Google Base namespace, you must also include a prefix within every attribute tag. We add this prefix to Google Base attributes to distinguish attributes defined in our namespace from elements defined in RSS 2.0. The prefix selected for this namespace declaration is "g":

<g:image_link>http://www.google.com/images/google_sm.gif</g:image_link>

Attributes in the Google Base namespace must include this prefix or the attributes, and any values they contain, will be ignored.

Google Base Attributes

The attributes defined in the Google Base namespace are designed to correspond with a specific feed item type. The term "item type" classifies a feed based on the type of information it includes. View a complete list of our item types.

You are required to use as many relevant attributes as are specific to your item type. Supplying additional information about your items by using these attributes will greatly increase your items' chances of showing up in search results. In addition, many attributes defined in the Google Base namespace can be used more than once within a single item. This enables you to add more available information about an item in your feed.



Section 3: Creating Custom Attributes

For cases where attributes defined in the Google Base namespace are not appropriate or don't quite match up with the information you'd like to include, simply create your own. The custom attributes you define can be used in addition to the attributes and elements defined in the Google Base and RSS 2.0 namespaces.

In the following example, we've taken the sample we extended earlier and added a few custom attributes:

<?xml version="1.0"?>
<rss version="2.0" 
xmlns:g="http://base.google.com/ns/1.0" 
xmlns:c="http://base.google.com/cns/1.0">
<channel><title>Google Jobs</title> <link>http://www.google.com/support/jobs/</link> <description>Information about job openings at Google Inc.</description> <item> <title>HR Analyst - Mountain View</title> <link> http://www.google.com/support/jobs/bin/topic.py?dep_id=1077&amp;loc_id=1116</link> <description>We have an immediate need for an experienced analytical HR professional. The ideal candidate has a proven record of developing analytical frameworks to make fact-based decisions.</description> <g:image_link>http://www.google.com/images/google_sm.gif</g:image_link> <g:expiration_date>2005-11-15</g:expiration_date> <g:job_function>Analyst</g:job_function> <g:location>1600 Amphitheatre Parkway, Mountain View, CA, 94043, USA</g:location>
<c:language_skills type="string">Fluent in English and German</c:language_skills> <c:prior_experience_years type="int">5</c:prior_experience_years> <c:start_date type="date">2005-11-15</c:start_date>
</item> </channel> </rss>

The major additions in this example are the addition of a second namespace declaration (xmlns:c="http://base.google.com/cns/1.0") and the special formatting of the custom attribute tags (language_skills, prior_experience_years, and start_date).

Custom Namespace Declaration

The following namespace declaration is required in order to use custom attributes not already defined in the RSS 2.0 or the Google Base namespaces:

xmlns:c="http://base.google.com/cns/1.0"

In addition to declaring the Google Base custom namespace, you must also include a prefix in both of the attribute tags. In this case we selected "c" as the prefix for our custom attributes. It is important to remember that the prefix selected in the namespace declaration must always match the prefix in your custom attribute tags.

<c:language_skills type="string">Fluent in English and German</c:language_skills>

Attributes in the Google Base custom namespace must include this prefix or the attributes, and any values they contain, will be ignored.

Formatting Custom Attributes

Custom attributes also need to be formatted in a certain way to allow us to recognize them. The format of a custom attribute can be broken down into the following values:

<[prefix]:[attribute_name] type="[content_type]">[value]</[prefix]:[attribute_name]>

To illustrate how this format should be used, please view the example below:

<c:language_skills type="string">Fluent in English and German</c:language_skills>

For more details about the values and examples of formatting custom attributes, please visit the Custom Attributes XML Namespace Module.



Section 4: Important Checklist

Before you submit your feed, we highly recommend running through the following list to help ensure your file is properly formatted:

  1. Your filename must end with the .xml extension.
  2. The feed filename you register in your Google Base account must match the name you assign to your file.
  3. Remember to include namespace declarations. These values should match exactly as shown: xmlns:g="http://base.google.com/ns/1.0" and xmlns:c="http://base.google.com/cns/1.0"
  4. Verify the prefix included in the Google Base and Custom Google Base attribute tags matches the prefix defined in the namespace declaration.
  5. Remove attributes that do not contain any values.


Section 5: Final Note

The sample entry included in this document was simplified to allow for clearer focus on the basics of constructing a Google Base XML data feed. While we accept feeds containing other elements defined in the RSS 2.0 standard or in your own namespace, any information these elements contain will be ignored during processing and will not appear in your listings. At this time we will only process data contained in the default RSS 2.0 elements and in attributes within the Google Base and Custom Google Base namespaces.

Was this information helpful?