This document is intended as a "quick start" guide for developers who want to integrate the CNET API into their websites. It assumes you are familiar with the basic concepts of APIs, XML, HTTP request methods, and the REST style of software architecture. If you require further information after reading this document, please refer to the developer's guide and the reference guide.
To get up and running quickly with the CNET API, perform the following steps:
The CNET API service provides quick and convenient access to CNET's full catalog of technology products and software titles. This extensive catalog powers sites like CNET Reviews, CNET Shopper and CNET Downloads. The API provides basic product information, including product categories and pricing information, as well as product images, review URLs, editors' ratings, and more.
Using the CNET API, you can access data to create pages such as the following:
To use the CNET API Dashboard, you must have a CNET.com membership. A CNET membership is free and provides you with a unique developer key that allows access to the CNET API Dashboard.
All valid CNET API request URLs contain partKey=[yourDeveloperKey].
The CNET API Dashboard allows you to dynamically construct API requests using a standard web form. After you select which data to include, the dashboard provides you with the query URL that will return the desired results, as well as the actual results themselves.
You can choose to return results in XML, in JSON, or in "browsable HTML" (the latter formats a JSON result in a collapsible hierarchy and displays product images). Viewing results before coding can greatly reduce time otherwise spent debugging.
Experiment on the dashboard, ensure the results are the ones you desire, and implement the resulting request URL on your site.
Below are example request URLs and responses, in both XML and JSON formats. Each displays one product by ID, with no optional parameters submitted.
http://api.cnet.com/restApi/v1.0/techProduct?productId=31518214&iod=none&partKey=[yourDeveloperKey]
<CNETResponse version="1.0">
<TechProduct id="31518214"
xlink:href="http://api.cnet.com/restApi/v1.0/techProduct?productId=31518214&iod=offers">
<Name>Garmin Nuvi 350</Name>
<ImageURL width="60">
http://i.i.com.com/cnwk.1d/sc/31518214-2-60-0.gif
</ImageURL>
<ImageURL width="120">
http://i.i.com.com/cnwk.1d/sc/31518214-2-120-0.gif
</ImageURL>
<PriceURL>
http://shopper.cnet.com/4014-3430_9-31518214.html?ttag=api
</PriceURL>
<ReviewURL>
http://reviews.cnet.com/4505-3430_7-31518214.html
</ReviewURL>
<Manufacturer id="208333">
<Name>Garmin International Inc.</Name>
</Manufacturer>
<SKU>010-00455-00</SKU>
<EditorsChoice>false</EditorsChoice>
<EditorsRating outOf="10">8.3</EditorsRating>
<PreferredNode id="3430"/>
<Category id="3430"
xlink:href="http://api.cnet.com/restApi/v1.0/category?categoryId=3430"/>
</TechProduct>
</CNETResponse>
http://api.cnet.com/restApi/v1.0/techProduct?productId=31518214&iod=none &viewType=json&partKey=[yourDeveloperKey]
{"CNETResponse":{
"@version":"1.0",
"TechProduct":{
"@id":"31518214",
"@xlink:href":"http:\/\/api.cnet.com\/restApi\/v1.0\/techProduct?productId=31518214
&iod=offers",
"Name":{"$":"Garmin Nuvi 350"},
"ImageURL":[
{"@width":"60",
"$":"http:\/\/i.i.com.com\/cnwk.1d\/sc\/31518214-2-60-0.gif"},
{"@width":"120",
"$":"http:\/\/i.i.com.com\/cnwk.1d\/sc\/31518214-2-120-0.gif"}],
"PriceURL":{"$":"http:\/\/shopper.cnet.com\/4014-3430_9-31518214.html?ttag=api"},
"ReviewURL":{"$":"http:\/\/reviews.cnet.com\/4505-3430_7-31518214.html"},
"Manufacturer":{"@id":"208333","Name":{"$":"Garmin International Inc."}},
"SKU":{"$":"010-00455-00"},
"EditorsChoice":{"$":"false"},
"EditorsRating":{"@outOf":"10","$":"8.3"},
"PreferredNode":{"@id":"3430"},
"Category":{
"@id":"3430",
"@xlink:href":"http:\/\/api.cnet.com\/restApi\/v1.0\/category?categoryId=3430"}
}
}
}