Response format – Google Commerce Search Deployment Guide User Manual
Page 21
 
Category breadcrumbs (parents of current category) can be returned by way of the category 
module. For more information, see:
Response format
The Shopping API returns results in XML (Atom) or JSON format. This is controlled with the 
alt
parameter (alt=atom or alt=json). Most of our example code uses XML because XML
makes for better human-readable examples, but the choice for your own implementation is up 
to you. JSON might provide a slight performance advantage because it is more compact and 
easier to parse.
 
Regardless of the response format, the content is the same. Each response contains some 
query-specific data (number of items returned, starting index, and so on), followed by a section 
for each of the content modules, followed by the list of items returned.
 
For detailed information and example responses, see “Reference - Response Format” at
Specifying fields to return
The default response contains a lot of data--probably more than is needed for simply presenting 
a search results page. For example, each item contains these attributes in the results:
 
<s:googleId>1575044745368379202</s:googleId> 
 <s:providedId>123</s:providedId> 
 <s:author> 
 <s:name>Example Company</s:name> 
 <s:accountId>12345</s:accountId> 
 </s:author> 
 <s:creationTime>2008-04-02T14:16:11.000Z</s:creationTime> 
 <s:modificationTime>2011-06-29T07:19:09.000Z</s:modificationTime>
 
This adds a lot of extra data to the result set, which is usually not needed for displaying search 
results. 
 
Best Practice: Limit the response to include only the fields and attributes you need. This 
improves performance by reducing the amount of data Google needs to process, as well as 
making the response payload smaller and easier to parse.
 
There are three parameters which control which are used to specify the data you wish to return: 
fields, productFields 
and attributeFilter.
 
Use the fields parameter to specify all the particular fields you need. The naming convention 
used for the fields parameter is slightly different for JSON vs. XML.
 
JSON:
&fields=spelling,promotions,redirects,selfLink,totalItems,startInd
ex,itemsPerPage,currentItemCount,categories,facets,items(product/
title,product/attributes,product/link,product/images,product/
inventories,product/categories)
 
21