iDreamBooks' API is intended for developers to access information about a certain title including its aggregated critic rating, critic review count and critic review snippets. iDreamBooks aggregates editorial reviews from professional critics like NYTimes and WashingtonPost to generate a highly authentic book rating.
There are two ways to embed the rating and review data of a title on your site:
This method needs very little development work. We provide all the critic reviews in the form of an iframe.
This method needs some development work and we provide upto 5 critic reviews in JSON or XML format.
You can embed all the critic reviews of a title by copying and pasting the following code in your website's HTML.
<div id="idb_iframe_container">
</div>
<script type="text/javascript">
//REQUIRED INPUTS
var isbn = {ISBN}; // Replace with ISBN / EISBN / ASIN of the book
var api_key = {API_KEY}; //Replace with the developer key (Submit the form to get a key)
//Optional Settings
var smiley = 'true'; // Change to false if do not want to show smiley with each review
var width = 700; // Width of the reviews iframe
var height = 400; // Height of the reviews iframe
// For some titles we only have "unrated" critic reviews.
// Such reviews have not gone through a quality assurance step yet and don't have a
// positive or negative sentiment.
// If you want to include the reviews of such titles change the following to 'true'
var unrated = 'false';
// DO NOT EDIT
(function() {
var wf = document.createElement('script');
var host = "idreambooks.com";
wf.src = ('https:' == document.location.protocol ? 'https' : 'http') +
'://'+host+'/reviews_widget.js?api_key='+ api_key +'&isbn='+ isbn +
'&smiley='+ smiley +'&width='+width + '&height=' + height;
wf.type = 'text/javascript';
wf.async = 'true';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(wf, s);
})();
</script>
Two inputs are required: {API_KEY} is an alpha-numeric key that validates the request and {ISBN} is the 10 or 13 digit isbn or eisbn of the book. There are some optional parameters as well as explained in the above code snippet.
Request code snippet
<div id="idb_iframe_container">
</div>
<script type="text/javascript">
//REQUIRED INPUTS
var isbn = "9781410439154"; //ISBN / EISBN / ASIN of the book
var api_key = "example_key"; //Replace with the developer key (Submit the form to get a key)
//Optional Settings
var smiley = 'true'; // Change to false if do not want to show smiley with each review
var width = 700; // Width of the reviews iframe
var height = 400; // Height of the reviews iframe
var unrated = 'false';
// DO NOT EDIT
(function() {
var wf = document.createElement('script');
var host = "idreambooks.com";
wf.src = ('https:' == document.location.protocol ? 'https' : 'http') +
'://'+host+'/reviews_widget.js?api_key='+ api_key +'&isbn='+ isbn +
'&smiley='+ smiley +'&width='+width + '&height=' + height;
wf.type = 'text/javascript';
wf.async = 'true';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(wf, s);
})();
</script>
Response
The widget styling can be customized (requires Api Key)
You can also perform a title search by sending a HTTP GET request to the following URI:
http://idreambooks.com/newbooks/api.xml?q={keywords}&key={yourAPIkey}http://idreambooks.com/newbooks/api.json?q={keywords}&key={yourAPIkey}{keywords} in the above URI is the search query. It can be any of the following:
{yourAPIkey} is an alpha-numeric key that validates the request. The key can be obtained by filling out the API Key Form.
Request code snippet (click each request to see its response):
Understanding the JSON/XML Response
Data Format
The response is in XML or JSON (JavaScript Object Notation) format.
Key - Values
We return the information for a single title that matches the search query. The response has the title, author, rating overview and critic reviews for the book. Some of the information contained in the key-value pairs is explained below:
| Number of critic reviews | |
| % Rating based on the critic reviews. It is a weighted average | |
| Icon based on whether the book is recommended or not. We recommend a book if rating is >= 70% | |
| Smaller sized icon based on whether the book is recommended or not | |
| Link to detail page of the book on idreambooks.com | |
| Collection of upto 5 critic reviews. Each review has the following information | |
| One or two sentences expressing the opinion of the reviewer | |
| Positive or negative rating of the book based on the review | |
| Smiley or sad icon based on whether the review is positive or negative | |
| Smaller sized smiley or sad icon | |
| Name of the web property where the review was published | |
| Link to the full original review | |
| Date of review |
Note: A "rating" is not calculated if the "review-count" is less than 4. In such a case, all key-value pairs are returned except for "rating" and "to-read-or-not". For some books, that do not have critic reviews, we would provide "unrated" critic reviews. Unrated critic reviews are in the process of being rated and do not have a rating associated with them. They are yet to go through quality assurance. Some of the information contained in the key-value pairs returned in such a scenario is explained below:
| Number of unrated critic reviews | |
| Collection of upto 5 unrated critic reviews. Each review has the following information | |
| One or two sentences summary of the reviewer | |
| Name of the web property where the review was published | |
| Link to the full original review | |
| Date of review |
Please fill out the form below to obtain an API key.
When using our API, you agree to the following Terms & Conditions: