Sample Using Google Base API JSON Output

Stay organized with collections Save and categorize content based on your preferences.

Introduction

This example illustrates use of JSON output with the Google Base API. On this page, you can perform a base query against the snippets and attributes feeds. The same approach can be used to access other Google Base feeds. This query only returns the first 25 results but you can change this behavior by changing the query string. Read more about the Google Base query language and see what you can come up with!

To use the new JSON feed, create a script element whose src value is:

http://www.google.com/base/feeds/feed?bq=query&alt=json-in-script&callback=callBack

where feed is the Google Base feed you wish to query, query is the Google Base query, and callBack is the name of the callback function that is passed the JSON object. For more information, see the complete JSON documentation.