You are on page 1of 22

1.

SIMPLE SEARCH QUERY


https://www.googleapis.com/books/v1/volumes?q=search+terms

2.ADD PARAMETER
https://www.googleapis.com/books/v1/volumes?
q=flowers+inauthor:keyes&key=yourAPIKey
q - Search for volumes that contain this text string. There are special
keywords you can specify in the search terms to search in particular fields,
such as:
intitle: Returns results where the text following this keyword is found in
the title.
inauthor: Returns results where the text following this keyword is
found in the author.
inpublisher: Returns results where the text following this keyword is
found in the publisher.
subject: Returns results where the text following this keyword is listed
in the category list of the volume.
isbn: Returns results where the text following this keyword is the ISBN
number.
lccn: Returns results where the text following this keyword is the Library
of Congress Control Number.
oclc: Returns results where the text following this keyword is the Online
Computer Library Center number.
2.1 Response
If the request succeeds, the server responds with a 200 OK HTTP status code
and the volume results:
200 OK
{
"kind": "books#volumes",

"items": [
{
"kind": "books#volume",
"id": "_ojXNuzgHRcC",
"etag": "OTD2tB19qn4",
"selfLink": "https://www.googleapis.com/books/v1/volumes/_ojXNuzgHRcC",
"volumeInfo": {
"title": "Flowers",
"authors": [
"Vijaya Khisty Bodach"
],
...
},
{
"kind": "books#volume",
"id": "RJxWIQOvoZUC",
"etag": "NsxMT6kCCVs",
"selfLink":
"https://www.googleapis.com/books/v1/volumes/RJxWIQOvoZUC",
"volumeInfo": {
"title": "Flowers",
"authors": [
"Gail Saunders-Smith"
],
...
},
{
"kind": "books#volume",
"id": "zaRoX10_UsMC",
"etag": "pm1sLMgKfMA",
"selfLink":
"https://www.googleapis.com/books/v1/volumes/zaRoX10_UsMC",
"volumeInfo": {
"title": "Flowers",
"authors": [
"Paul McEvoy"
],
...
},
"totalItems": 3

3.0 Download Format


You use the download parameter to restrict the returned results to volumes
that have an available download format of epub by setting the to the value
epub.
The following example searches for books with an epub download available:
https://www.googleapis.com/books/v1/volumes?
q=pride+prejudice&download=epub&key=yourAPIKey
4.0 Filtering
You can use the filter parameter to restrict the returned results further by
setting it the to one of the following values:

partial - Returns results where at least parts of the text are


previewable.

full - Only returns results where all of the text is viewable.

free-ebooks - Only returns results that are free Google eBooks.

paid-ebooks - Only returns results that are Google eBooks with a


price.

ebooks - Only returns results that are Google eBooks, paid or free.
Examples of non-eBooks would be publisher content that is available in
limited preview and not for sale, or magazines.

The following example restricts search results to those available as free


eBooks:
https://www.googleapis.com/books/v1/volumes?q=flowers&filter=freeebooks&key=yourAPIKey
5.0 Pagination
You can paginate the volumes list by specifying two values in the parameters
for the request:

startIndex - The position in the collection at which to start. The index


of the first item is 0.

maxResults - The maximum number of results to return. The default


is 10, and the maximum allowable value is 40.

6.0 Print Type


You can use the printType parameter to restrict the returned results to a
specific print or publication type by setting it to one of the following values:

all - Does not restrict by print type (default).

books - Returns only results that are books.

magazines - Returns results that are magazines.

The following example restricts search results to magazines:


GET https://www.googleapis.com/books/v1/volumes?
q=time&printType=magazines&key=yourAPIKey
7.0 Projection
You can use the projection parameter with one of the following values to
specify a predefined set of Volume fields to return:

full - Returns all Volume fields.

lite - Returns only certain fields. See field descriptions marked with
double asterisks in the Volume reference to find out which fields are
included.

The following example returns search results with limited volume


information:
GET https://www.googleapis.com/books/v1/volumes?
q=flowers&projection=lite&key=yourAPIKey
8.0 Sorting
By default, a volumes search request returns maxResults results,
where maxResults is the parameter used in pagination (above), ordered by
relevance to search terms.

You can change the ordering by setting the orderBy parameter to be one of
these values:

relevance - Returns results in order of the relevance of search terms


(this is the default).

newest - Returns results in order of most recently to least recently


published.

The following example lists results by published date, newest to oldest:


https://www.googleapis.com/books/v1/volumes?
q=flowers&orderBy=newest&key=yourAPIKey

9.0 Retrieving a specific volume


You can retrieve information for a specific volume by sending an HTTP GET
request to the Volume resource URI:
https://www.googleapis.com/books/v1/volumes/volumeId
Replace the volumeId path parameter with the ID of the volume to retrieve.
See the Google Books IDs section for more information on volume IDs.

Request

Here is an example of a GET request that gets a single volume:


GET https://www.googleapis.com/books/v1/volumes/zyTCAlFPjgYC?
key=yourAPIKey
Note: Retrieving volume information does not require authentication, so you
do not have to provide the Authorization HTTP header with the GET request.
However, if the call is made with authentication, the Volume will include userspecific information, such as purchased status.
Response

If the request succeeds, the server responds with the 200 OK HTTP status
code and the Volume resource requested:
200 OK

{
"kind": "books#volume",
"id": "zyTCAlFPjgYC",
"etag": "f0zKg75Mx/I",
"selfLink": "https://www.googleapis.com/books/v1/volumes/zyTCAlFPjgYC",
"volumeInfo": {
"title": "The Google story",
"authors": [
"David A. Vise",
"Mark Malseed"
],
"publisher": "Random House Digital, Inc.",
"publishedDate": "2005-11-15",
"description": "\"Here is the story behind one of the most remarkable
Internet
successes of our time. Based on scrupulous research and extraordinary
access
to Google, ...",
"industryIdentifiers": [
{
"type": "ISBN_10",
"identifier": "055380457X"
},
{
"type": "ISBN_13",
"identifier": "9780553804577"
}
],
"pageCount": 207,
"dimensions": {
"height": "24.00 cm",
"width": "16.03 cm",
"thickness": "2.74 cm"
},
"printType": "BOOK",
"mainCategory": "Business & Economics / Entrepreneurship",
"categories": [
"Browsers (Computer programs)",
...
],
"averageRating": 3.5,
"ratingsCount": 136,
"contentVersion": "1.1.0.0.preview.2",
"imageLinks": {

"smallThumbnail": "http://bks1.books.google.com/books?
id=zyTCAlFPjgYC&printsec=frontcover&img=1&zoom=5&edge=curl&source
=gbs_api",
"thumbnail": "http://bks1.books.google.com/books?
id=zyTCAlFPjgYC&printsec=frontcover&img=1&zoom=1&edge=curl&source
=gbs_api",
"small": "http://bks1.books.google.com/books?
id=zyTCAlFPjgYC&printsec=frontcover&img=1&zoom=2&edge=curl&source
=gbs_api",
"medium": "http://bks1.books.google.com/books?
id=zyTCAlFPjgYC&printsec=frontcover&img=1&zoom=3&edge=curl&source
=gbs_api",
"large": "http://bks1.books.google.com/books?
id=zyTCAlFPjgYC&printsec=frontcover&img=1&zoom=4&edge=curl&source
=gbs_api",
"extraLarge": "http://bks1.books.google.com/books?
id=zyTCAlFPjgYC&printsec=frontcover&img=1&zoom=6&edge=curl&source
=gbs_api"
},
"language": "en",
"infoLink": "http://books.google.com/books?id=zyTCAlFPjgYC&ie=ISO-88591&source=gbs_api",
"canonicalVolumeLink":
"http://books.google.com/books/about/The_Google_story.html?
id=zyTCAlFPjgYC"
},
"saleInfo": {
"country": "US",
"saleability": "FOR_SALE",
"isEbook": true,
"listPrice": {
"amount": 11.99,
"currencyCode": "USD"
},
"retailPrice": {
"amount": 11.99,
"currencyCode": "USD"
},
"buyLink": "http://books.google.com/books?id=zyTCAlFPjgYC&ie=ISO-88591&buy=&source=gbs_api"
},
"accessInfo": {
"country": "US",
"viewability": "PARTIAL",
"embeddable": true,
"publicDomain": false,

"textToSpeechPermission": "ALLOWED_FOR_ACCESSIBILITY",
"epub": {
"isAvailable": true,
"acsTokenLink":
"http://books.google.com/books/download/The_Google_story-sampleepub.acsm?
id=zyTCAlFPjgYC&format=epub&output=acs4_fulfillment_token&dl_type=sa
mple&source=gbs_api"
},
"pdf": {
"isAvailable": false
},
"accessViewStatus": "SAMPLE"
}
}
Access Info
The accessInfo section is of particular interest in determining what features
are available for an eBook. An epub is a flowing text format ebook, the epub
section will have an isAvailable property indicating if this type of ebook is
available. It will have a download link if there is a sample for the book or if
the user can read the book either due to having purchased it or due to it
being public domain in the user's location. A pdf for Google books indicates a
scanned pages version of the ebook with similar details such as if it is
available and a download link. Google recommends epub files for eReaders
and SmartPhones, as scanned pages may be hard to read on these devices.
If there is no accessInfo section, the volume is not available as a Google
eBook.

Optional query parameters

In addition to the standard query parameters, you can use the following
query parameter when retrieving a specific volume.
Projection
You can use the projection parameter with one of the following values to
specify a predefined set of Volume fields to return:

full - Returns all Volume fields.

lite - Returns only certain fields. See field descriptions marked with
double asterisks in the Volume reference to find out which fields are
included.

The following example returns limited volume information for a single


volume:
GET https://www.googleapis.com/books/v1/volumes/zyTCAlFPjgYC?
projection=lite&key=yourAPIKey

Retrieving a list of a user's public bookshelves


You can retrieve a list of a user's public bookshelves by sending an HTTP GET
request to the URI with the following format:
https://www.googleapis.com/books/v1/users/userId/bookshelves
Replace the userId path parameter with the ID of the user whose
bookshelves you would like to retrieve. See the Google Books IDs section for
more information on user IDs.
Request

Here is an example:
GET
https://www.googleapis.com/books/v1/users/1112223334445556677/books
helves&key=yourAPIKey
Since a user does not have to be authenticated to retrieve information
regarding public bookshelves, you do not have to provide the Authorization
HTTP header with the GET request.
Response

If the request succeeds, the server responds with the 200 OK HTTP status
code and the list of bookshelves:
200 OK
{
"kind": "books#bookshelves",
"items": [
{

...
},
{
"kind": "books#bookshelf",
"id": 3,
"selfLink":
"http://www.googleapis.com/books/v1/users/1112223334445556677/bookshe
lves/3",
"title": "Reading now",
"description": "",
"access": "PUBLIC",
"updated": "2011-02-02T20:34:20.146Z",
"created": "2011-02-02T20:34:20.146Z",
"volumeCount": 2,
"volumesLastUpdated": "2011-02-02T20:34:20.110Z"
},
...
]
}
Optional query parameters

You can use the standard query parameters when retrieving the list of a
user's public bookshelves.
Retrieving a specific public bookshelf
You can retrieve a specific public bookshelf by sending an HTTP GET request
to the URI with the following format:
https://www.googleapis.com/books/v1/users/userId/bookshelves/shelf
Replace the userId and shelf path parameters with the IDs that specify the
user and the bookshelf you want to retrieve. See the Google Books IDs
section for more information.
Request

Here is an example:
GET
https://www.googleapis.com/books/v1/users/1112223334445556677/books
helves/3?key=yourAPIKey
Since a user does not have to be authenticated to retrieve information
regarding public bookshelves, you do not have to provide the Authorization
HTTP header with the GET request.
Response

If the request succeeds, the server responds with the 200 OK HTTP status
code and the bookshelf resource:
200 OK
{
"kind": "books#bookshelf",
"id": 3,
"selfLink":
"http://www.googleapis.com/books/v1/users/1112223334445556677/bookshe
lves/3",
"title": "Reading now",
"description": "",
"access": "PUBLIC",
"updated": "2011-02-02T20:34:20.146Z",
"created": "2011-02-02T20:34:20.146Z",
"volumeCount": 2,
"volumesLastUpdated": "2011-02-02T20:34:20.110Z"
}
Optional query parameters

You can use the standard query parameters when retrieving a specific public
bookshelf.
Retrieving a list of volumes on a public bookshelf
You can retrieve a list of volumes on a user's public bookshelf by sending an
HTTP GET request the a URI with the following format:
https://www.googleapis.com/books/v1/user/userId/bookshelves/shelf/volumes
Request

Here is an example:
GET
https://www.googleapis.com/books/v1/users/1112223334445556677/books
helves/3/volumes?key=yourAPIKey
Replace the userId and shelf path parameters with the IDs that specify the
user and the bookshelf you want to retrieve. See the Google Books IDs
section for more information.
Since a user does not have to be authenticated to retrieve information
regarding public bookshelves, you do not have to provide the Authorization
HTTP header with the GET request.

Response

If the request succeeds, the server responds with a 200 OK HTTP status code
and the list of the user's bookshelves:
200 OK
{
"kind": "books#volumes",
"items": [
{
"kind": "books#volume",
"id": "AZ5J6B1-4BoC",
"etag": "kIzQA7IUObk",
"selfLink": "https://www.googleapis.com/books/v1/volumes/AZ5J6B1-4BoC",
"volumeInfo": {
"title": "The Girl Who Kicked the Hornet's Nest",
"authors": [
"Stieg Larsson"
],
"publisher": "Knopf",
"publishedDate": "2010-05-25",
...
},
{
"kind": "books#volume",
"id": "UvK1Slvkz3MC",
"etag": "otKmdbRgdFQ",
"selfLink": "https://www.googleapis.com/books/v1/volumes/UvK1Slvkz3MC",
"volumeInfo": {
"title": "The Girl who Played with Fire",
"authors": [
"Stieg Larsson"
],
"publisher": "Knopf",
"publishedDate": "2009-07-28",
...
},
{
"kind": "books#volume",
"id": "OBM3AAAAIAAJ",
"etag": "xb47kTr8HsQ",
"selfLink":
"https://www.googleapis.com/books/v1/volumes/OBM3AAAAIAAJ",
"volumeInfo": {
"title": "The Sign of Four",

"authors": [
"Sir Arthur Conan Doyle"
],
"publishedDate": "1890",
...
}
],
"totalItems": 3
}
Optional query parameters

In addition to the standard query parameters, you can use the following
query parameter when retrieving a list of volumes on a public bookshelf.
Pagination
You can paginate the volumes list by specifying two values in the parameters
for the request:

startIndex - The position in the collection at which to start. The index of


the first item is 0.

maxResults - The maximum number of results to return. The default is


10, and the maximum allowable value is 40.

Query parameter reference


The query parameters you can use with the Books API are summarized in this
section. All parameter values need to be URL encoded.
Standard query parameters

Query parameters that apply to all Books API operations are shown in the
table below.
Notes (on API keys and auth tokens):
1. The key parameter is required with every request, unless you provide an
OAuth 2.0 token with the request.

2. You must send an authorization token with every request that is marked
(AUTHENTICATED). OAuth 2.0 is the preferred authorization protocol.
3. You can provide an OAuth 2.0 token with any request in one of two ways:
o

Using the access_token query parameter like this: ?access_token=oauth2token

Using the HTTP Authorization header like this: Authorization: Bearer


oauth2-token

All parameters are optional except where noted.


Paramet
er

Meaning

access_tok OAuth 2.0 token for


en
the current user.

callback

fields

key

prettyPrint

Notes

One possible way to provide an OAuth 2.0


token.

Name of the JavaScript callback function that


handles the response.

Used in JavaScript JSON-P requests.

For more information, see the partial response


section in the Performance Tips document.

Use for better performance.

*Required unless you provide an OAuth 2.0


token.

Your API key identifies your project and


provides you with API access, quota, and
reports.

Obtain your project's API key from the APIs


Console.

Returns the response in a human-readable

Callback function.

Selector specifying
a subset of fields to
include in the
response.

API key.
(REQUIRED*)

Returns response
with indentations
and line breaks.

format if true.

quotaUser

userIp

Alternative to
userIp.

IP address of the
end user for whom
the API call is being
made.

Default value: true.

When this is false, it can reduce the response


payload size, which might lead to better
performance in some environments.

Lets you enforce per-user quotas from a


server-side application even in cases when the
user's IP address is unknown. This can occur,
for example, with applications that run cron
jobs on App Engine on a user's behalf.

You can choose any arbitrary string that


uniquely identifies a user, but it is limited to
40 characters.

Overrides userIp if both are provided.

Learn more about capping usage.

Lets you enforce per-user quotas when calling


the API from a server-side application.

Learn more about capping usage.

API-specific query parameters

Request parameters that apply only to specific operations in the Books API
are summarized in the following table.
Parame
Meaning
ter
Restrict to
volumes
by
download
download
availability
.

Notes

Currently, the only supported value


is epub.
Purchase may be required for
download access.

Applicability

Performing a
search

Parame
Meaning
ter

Notes

filter

Filter
search
results by
volume
type and
availability
.

Restricts
the
volumes
returned
langRestr to those
ict
that are
tagged
with the
specified
language.
maxResul The
ts
maximum

number of

Applicability

Supported filters are:


o

filter=partial - Restrict results

filter=full - Restrict results to

filter=free-ebooks - Restrict

to volumes where at least


part of the text are
previewable.
volumes where all of the text
is viewable.
results to free Google eBooks.

filter=paid-ebooks - Restrict

filter=ebooks - Restrict results

Performing a
search

Performing a
search

Performing a

results to Google eBooks with


a price for purchase.
to Google eBooks, paid or
free.Examples of non-eBooks
would be publisher content
that is available in limited
preview and not for sale, or
magazines.

Restrict the search results to those


with a certain language by
specifying langRestrict to a two-letter
ISO-639-1 code, such as "en" or "fr".

For any request for all items in a


collection, you can paginate results

Parame
Meaning
ter

Notes

Applicability

search

elements
to return
with this
request.

by specifying startIndex and


maxResults in the parameters for the
request.

Default: maxResults=10

Maximum allowable value:

List user
bookshelves

List user
bookshelf
volumes

List my
bookshelves

List my
bookshelf
volumes

Performing a
search

Performing a
search

maxResults=40.

orderBy

Order of
the
volume
search
results.

By default, a search request returns


maxResults results, where maxResults
is the parameter used in pagination,
ordered by most relevant first.

You can change the ordering by


setting the orderBy parameter to be
one of these values:
o

orderBy=relevance - Returns

search results in order of the


most relevant to least (this is
the default).

o orderBy=newest - Returns

search results in order of the


newest published date to the
oldest.

printType Restrict to

books or
magazines
.

Supported values are:


o

printType=all - Return all

volume content types (no


restriction). This is the

Parame
Meaning
ter

Notes

Applicability

default.
o

printType=books - Return just

books.

o printType=magazines - Return
just magazines.

Restrict
volume
informatio
projection n returned
to a
subset of
fields.

Full-text
query
string.

Supported projections are:


o

Performing a
search

Retrieving a
volume

List user
bookshelf
volumes

List my
bookshelf
volumes

Performing a
search

projection=full - Includes all

volume metadata (default).

o projection=lite - Includes only


a subject of volume and
access metadata.

When creating a query, list search


terms separated by a '+', in the
form q=term1+term2_term3.
(Alternatively, you can separate
them with a space, but as with all of
the query parameter values, the
spaces must then be URL encoded.)
The API returns all entries that
match all of the search terms (like
using AND between terms). Like
Google's web search, the API
searches on complete words (and
related words with the same stem),
not substrings.

To search for an exact phrase,


enclose the phrase in quotation
marks: q="exact phrase".

Parame
Meaning
ter

Notes

To exclude entries that match a


given term, use the form q=-term.

The search is case-insensitive.

Example: to search for all entries


that contain the exact phrase
"Elizabeth Bennet" and the word
"Darcy" but don't contain the word
"Austen", use the following query
parameter value:
q="Elizabeth+Bennet"+Darcy-Austen

There are special keywords you can


specify in the search terms to
search in particular fields, such as:
o

intitle: Returns results where

inauthor: Returns results

inpublisher: Returns results

subject: Returns results where

isbn: Returns results where

lccn: Returns results where

the text following this


keyword is found in the title.
where the text following this
keyword is found in the
author.
where the text following this
keyword is found in the
publisher.
the text following this
keyword is listed in the
category list of the volume.
the text following this
keyword is the ISBN number.
the text following this
keyword is the Library of

Applicability

Parame
Meaning
ter

Notes

Applicability

Congress Control Number.

o oclc: Returns results where


the text following this
keyword is the Online
Computer Library Center
number.

The
position in
the
startInde collection
x
at which
to start
the list of
results.

Identifies
a volume
volumeId associated
with the
request.

For any request for all items in a


collection, you can paginate results
by specifying startIndex and
maxResults in the parameters for the
request.
The index of the first item is 0.

Specifies the volume to add or


remove from a bookshelf.

Performing a
search

List user
bookshelves

List user
bookshelf
volumes

List my
bookshelves

List my
bookshelf
volumes

Adding a
volume to
my
bookshelf

Removing a
volume from
my
bookshelf

"kind": "books#volumes",
"totalItems": 118,
"items": [
"kind": "books#volume",
"id": "gK98gXR8onwC",
"etag": "CRegDMJVmqY",
"selfLink": "https://www.googleapis.com/books/v1/volumes/gK98gXR8onwC",
"volumeInfo": {
"title": "Flowers for Algernon",
"subtitle": "One Act",
"authors": "David Rogers","Daniel Keyes"
"publisher": "Dramatic Publishing",
"publishedDate": "1969",
"industryIdentifiers": [
"type": "ISBN_10",
"identifier": "0871293870"
"type": "ISBN_13",
"identifier": "9780871293879"
"readingModes": {
"text": false,
"image": true
"pageCount": 117,
"printType": "BOOK",
"categories": ["American drama"
"contentVersion": "0.0.1.0.preview.1",
"imageLinks": {
"smallThumbnail":
"thumbnail":
"language": "en",
"previewLink":
"infoLink":
"canonicalVolumeLink":
"saleInfo": {
"country": "IN",
"saleability": "NOT_FOR_SALE",
"isEbook": false
"accessInfo": {
"country": "IN",
"viewability": "PARTIAL",
"embeddable": true,
"publicDomain": false,
"textToSpeechPermission": "ALLOWED",
"epub": {
"isAvailable": false
"pdf": {
"isAvailable": false
"webReaderLink":
"accessViewStatus": "SAMPLE",
"quoteSharingAllowed": false
"searchInfo": {
"textSnippet": "\u003cb\u003eFLOWERS\u003c/b\u003e. FOR. ALGERNON. A Oneact Play For Four Men And One Woman* \u003cbr\u003e\nCHARACTERS DR. STRAUSS a

young neurosurgeon PROFESSOR NEMUR his \u003cbr\u003e\nolder colleague ALICE


KINNIAN a young, dedicated teacher BURT SELDON a ..."
}

JASON KEY INFO


Client ID: 1087519046599-5k2phmofor49deegrp07vl8ar08v7nfg.apps.googleusercontent.com
Email address:1087519046599-5k2phmofor49deegrp07vl8ar08v7nfg@developer.gserviceaccount.com
Client secret: 53-LbySuJjIzovDamjE8Mod1
Redirect URIs: http://localhost:4567/oauth2callback
Javascript Origins: http://localhost:4567

API KEY: AIzaSyBQxdNpTAf8ERKMUTyqaWygkRDMAUrxXKY

You might also like