Google Base is a place where you can submit all kinds of content for Google to host and to make searchable online. You can describe any item you post with descriptive attributes, which can be labels or specific information about the good or service. The more attributes you associate with your items, the more different ways users can find them.
With the new Google Base data API, you can create specialized applications that handle such actions programmatically. Your application can upload new data, update or delete existing items, and execute specialized queries to find matches for complex attribute criteria.
The Google Base data API is compliant with the Google data API framework, which combines common XML-based syndication formats (Atom and RSS) with a feed-publishing system based on the Atom publishing protocol. The Google data API Developer's Guide has more information about the protocol. You can perform queries, inserts, updates, and deletes with the Google Base data API, all of which, except for queries, require authentication at this time.
This demo page provides you with a simple mechanism for using the API and learning how it works. Each Google Base data API operation has an equivalent HTTP method, so you can try out the HTTP GET, POST, PUT, and DELETE methods as you invoke the operations below. The page uses Javascript to execute, which may also be useful for you as you learn to build your own applications.
Google Base uses two feeds for data:
/feeds/snippets : for the general public and provides a slightly shortened description /feeds/items :
a private customer-specific feed for customers to insert, update, delete, and
query their own data. This feed requires authentication. A good way to start learning how to use the Google Base data API is to do a couple of sample inserts and queries. This document takes you through the minimal set of actions to insert a new data item and execute a simple query with HTTP.
The interactive demo explained in this page is written in JavaScript, which handles the HTTP requests for you.
The demo includes these sections:
For authentication to work, each user must have a valid Google account.
The Google data API supports two ways of authenticating users: for installed applications (Programmatic Login) and for web applications (AuthSub). This interactive demo uses the AuthSub authentication system whereby users authorize the web application to act on their behalf and gets redirected back to the application with a token that the application includes in the header of subsequent HTTP requests.
In order to use this interactive demo, you need to first get a new single-use AuthSub token. Once you have that, you can upgrade to a multi-use session token.
Get new single-use AuthSub token.
Current single-use token:
Note that you must be authenticated before you can use this demo.
Select an operation:
Query URI: /base/feeds/
Item ID:
Copy the item ID from an Insert response. The item ID is the 19-digit number
at the end of the URL in the Location response header.
Copy the item ID from an Insert response. The item ID is the 19-digit number
at the end of the URL in the Location response header.
Item ID:
A Google Base query is a specially encoded URL that contains your search parameters and uses an HTTP GET method to communicate with the server.
Queries in the Google Base data API are REST-style URIs that can perform a simple full text search or invoke a more complex structured query that limits the search to specific attributes or item types . The results are returned as an Atom feed, although you can specify RSS-formatted results. The Google Base data API Developer's Guide describes how to form these parameterized URIs and the Recommended Attributes list shows you which attributes you can query on. You also can query a metadata feed to get more information about popular attributes.
There are two feeds for querying items:
/base/feeds/snippets is a public feed that returns matching items
from all users /base/feeds/items is a private feed that returns
only items that belong to the authenticated user (customer). Here is a list of sample queries for the snippets feed. The parameter bq is used to specify a structured Google
Base query. You can copy and paste them directly into the query text box below in order to send the query to the
API server.
digital and camera: snippets?bq=digital+camera
digital camera [brand: canon] snippets?bq=digital+camera+%5Bbrand%3Acanon%5D
snippets?bq=digital+camera&max-results=5
snippets?bq=digital+camera&alt=rss
Products containing the terms digital and camera in the area of San Francisco: digital camera [item type: products] [location: @"San Francisco, CA" + 50mi] snippets/-/products?bq=digital+camera+%5blocation:@%22San+Francisco,CA%22%2b50mi%5d
The response is an Atom (or RSS) feed that contains a list of all data items that match the query string. Each item has a unique URL (in the <id> tag), so you can retrieve an individual item later by using its specific URL.
The release package provides a couple simple command-line tools that demonstrate how to interact with the API in Java as well as a simple web application implementing a frontend for finding and submitting recipes shows how to use Google Base data API feeds in web applications. These are described in the Google Base data API Developer's Guide.
Each data item in Google Base is an instance of an item type.
The item types promoted by Google come with a set of approved attributes. Such metadata can be queried with the API by
using the /base/feeds/itemtypes feed. Here are some sample queries. You can copy and paste them directly into
the query text box below in order to send the query to the
API server. Note that the query string you paste in has been URL encoded.
en_US with their
corresponding attributes. itemtypes/en_US
Recipes: itemtypes/en_US/recipes
You can find out which attributes and which attribute values are more commonly
used in Google Base item by querying the /base/feeds/attributes feed. Here are some sample queries:
digital and camera. attributes?bq=digital+camera
attributes?bq=digital+camera+%5Bbrand%3Acanon%5D&max-values=5
You can insert new items and update or delete your own items through the /base/feeds/items feed. The invoke section provides some sample data
for a new item entry. If you
want to update or delete, you need to use the correct item ID.
You can verify the results of your operations by going to the Google Base Frontend and looking at the list of your items.
Any data provided to Google Base can take up to 24 hours to become searchable. You can view your own items by using the items feed.
A few points to note about the code:
<g:label>Google </g:label>.
See the Attributes and Queries document for more information about attributes. feeds/items ).<title> element and the Google Base <g:item_type> attribute. Other attributes are optional.
If you omit one of the required attributes, you get an error. <id> tag. <id>http://www.google.com/base/feeds/items/1263232256914517833 </id>
This URL uniquely identifies the data item:
http://www.google.com/base/feeds/items1263232256914517833
Updated on