Google Books API

GET   /api/v1/search?engine=google_books

Google Books API allows for books, magazines, and newspaper searches based on title, author, subject, ISBN, and other criteria. It returns information such as title, author, publisher, publication date, and description. The API also provides links for viewing or previewing books. It supports various filters and parameters to refine search results.

API Parameters

Search Query

  • Name
    q
    Required
    Required
    Description

    This parameter is used for the terms you want to search on Google Books search. e.g. intitle:, inauthor:, inpublisher:, subject:, issn:, or isbn:. To exclude results, use the - character. For example: Harry -Potter.

Localization

  • Name
    google_domain
    Required
    Optional
    Description

    The default parameter google.com defines the Google domain of the search. Check the full list of supported Google google_domain domains.

  • Name
    gl
    Required
    Optional
    Description

    The default parameter us defines the country of the search. Check the full list of supported Google gl countries.

  • Name
    hl
    Required
    Optional
    Description

    The default parameter en defines the interface language of the search. Check the full list of supported Google hl languages.

Filters

  • Name
    safe
    Required
    Optional
    Description

    This parameter toggles the SafeSearch feature for the results. SafeSearch operates by filtering out adult content from your search results. Google's filters use proprietary technology to check keywords, phrases and URLs. While no filters are 100 percent accurate, SafeSearch will remove the overwhelming majority of adult content from your search results. Set the value to active to enable SafeSearch. To disable it, set the value to off. By default, SafeSearch is disabled.

  • Name
    document
    Required
    Optional
    Description

    This parameter filters results based on the type of document. Supported values are:

    • books - Books
    • magazines - Magazines
    • newspapers - Newspapers

  • Name
    view
    Required
    Optional
    Description

    This parameter filters results based on the view of the document. Supported values are:

    • any_view - Any View
    • preview_and_full_view - Preview and full view
    • full_view - Full view

  • Name
    time_period
    Required
    Optional
    Description

    This parameter restricts results to URLs based on date. Supported values are:

    • 21century - data from 2000 till 2099.
    • 20century - data form 1900 till 1999.
    • 19century - data form 1800 till 1899.
    • Using time_period_min or time_period_max parameters, you can specify a custom time period.
    Note: the time_period_min and time_period_max parameters could be used separately as well.

  • Name
    time_period_min
    Required
    Optional
    Description

    This parameter specifies the start of the time period. It could be used in combination with the time_period_max parameter. The value should be in the format MM/DD/YYYY.

  • Name
    time_period_max
    Required
    Optional
    Description

    This parameter specifies the end of the time period. It could be used in combination with the time_period_min parameter. The value should be in the format MM/DD/YYYY.

Pagination

  • Name
    num
    Required
    Optional
    Description

    This parameter specifies the number of results to display per page. By default, it is set to 10. Use in combination with the page parameter to implement pagination functionality. Max num per page is 100, min - 1.

  • Name
    page
    Required
    Optional
    Description

    This parameter indicates which page of results to return. By default, it is set to 1. Use in combination with the num parameter to implement pagination.

Engine

  • Name
    engine
    Required
    Required
    Description

    Parameter defines an engine that will be used to retrieve real-time data. It must be set to google_books.

API key

  • Name
    api_key
    Required
    Required
    Description

    The api_key authenticates your requests. Use it as a query parameter (https://www.searchapi.io/api/v1/search?api_key=YOUR_API_KEY) or in the Authorization header (Bearer YOUR_API_KEY).

API Examples

Books

Books
GET
https://www.searchapi.io/api/v1/search?engine=google_books&q=Python
Request
import requests

url = "https://www.searchapi.io/api/v1/search"
params = {
  "engine": "google_books",
  "q": "Python"
}

response = requests.get(url, params=params)
print(response.text)
Response
{
  "search_metadata": {
    "id": "search_xRvzEGkNolVqFOQpj4Q9WJbO",
    "status": "Success",
    "created_at": "2024-03-06T17:35:30Z",
    "request_time_taken": 1.99,
    "parsing_time_taken": 0.07,
    "total_time_taken": 2.06,
    "request_url": "https://www.google.com/search?q=Python&gl=us&hl=en&tbs=&tbm=bks",
    "html_url": "https://www.searchapi.io/api/v1/searches/search_xRvzEGkNolVqFOQpj4Q9WJbO.html",
    "json_url": "https://www.searchapi.io/api/v1/searches/search_xRvzEGkNolVqFOQpj4Q9WJbO"
  },
  "search_parameters": {
    "engine": "google_books",
    "q": "Python",
    "google_domain": "google.com",
    "hl": "en",
    "gl": "us"
  },
  "organic_results": [
    {
      "position": 1,
      "id": "RQ6xDwAAQBAJ",
      "title": "Automate the Boring Stuff with Python, 2nd Edition: ...",
      "link": "https://books.google.com/books?id=RQ6xDwAAQBAJ&printsec=frontcover&dq=Python&hl=en&newbks=1&newbks_redir=1&sa=X&ved=2ahUKEwjjo-GWluCEAxVoBUQIHdn6AMAQ6wF6BAgNEAE",
      "authors": [
        {
          "name": "Al Sweigart",
          "link": "https://www.google.com/search?sca_esv=5029e200667018e0&hl=en&gl=us&tbm=bks&tbm=bks&q=inauthor:%22Al+Sweigart%22&sa=X&ved=2ahUKEwjjo-GWluCEAxVoBUQIHdn6AMAQ9Ah6BAgNEAU"
        }
      ],
      "date": "2019",
      "extensions": ["Al Sweigart", "2019"],
      "snippet": "The second edition of this international fan favorite includes a brand-new chapter on input validation, Gmail and Google Sheets automations, tips for updating CSV files, and more.",
      "other_links": [
        {
          "title": "Preview",
          "link": "https://books.google.com/books?id=RQ6xDwAAQBAJ&printsec=frontcover&dq=Python&hl=en&newbks=1&newbks_redir=1&sa=X&ved=2ahUKEwjjo-GWluCEAxVoBUQIHdn6AMAQuwV6BAgNEAc"
        },
        {
          "title": "More editions",
          "link": "https://www.google.com/books/edition/Automate_the_Boring_Stuff_with_Python_2n/RQ6xDwAAQBAJ?hl=en&gl=us&kptab=editions&sa=X&ved=2ahUKEwjjo-GWluCEAxVoBUQIHdn6AMAQmBZ6BAgNEAg"
        }
      ],
      "thumbnail": "data:image/jpg;base64,/9j/..."
    },
    ...
  ],
  "pagination": {
    "current": 1,
    "next": "https://www.google.com/search?q=Python&sca_esv=5029e200667018e0&hl=en&gl=us&tbm=bks&ei=ZqnoZePYHuiKkPIP2fWDgAw&start=10&sa=N&ved=2ahUKEwjjo-GWluCEAxVoBUQIHdn6AMAQ8NMDegQIDhAW",
    "other_pages": {
      "2": "https://www.google.com/search?q=Python&sca_esv=5029e200667018e0&hl=en&gl=us&tbm=bks&ei=ZqnoZePYHuiKkPIP2fWDgAw&start=10&sa=N&ved=2ahUKEwjjo-GWluCEAxVoBUQIHdn6AMAQ8tMDegQIDhAE",
      ...
    }
  }
}

Magazine

Magazine
GET
https://www.searchapi.io/api/v1/search?document=magazines&engine=google_books&q=artificial+intelligence
Request
import requests

url = "https://www.searchapi.io/api/v1/search"
params = {
  "engine": "google_books",
  "q": "artificial intelligence",
  "document": "magazines"
}

response = requests.get(url, params=params)
print(response.text)
Response
{
  "organic_results": [
    {
      "position": 1,
      "id": "uF4EAAAAMBAJ",
      "title": "Black Enterprise - Jul 1988 - Page 36",
      "link": "https://books.google.com/books?id=uF4EAAAAMBAJ&pg=PA36&dq=artificial+intelligence&hl=en&sa=X&ved=2ahUKEwjCnqCuluCEAxVqmIkEHSCRBVAQ6wF6BAgEEAE",
      "volume": "Vol. 18, No. 12",
      "extensions": ["Vol. 18, No. 12", "Magazine"],
      "found_in": "Found inside – Page 36",
      "snippet": "TECH. WATCH. Though. Progress. Is. Slow,. Promise. Is. Great. For. Artificial. Intelligence. Power and performance are the key strengths of Q&A Version 3.0, one of the most popular file management and word processing packages currently ...",
      "other_links": [
        {
          "title": "Full view",
          "link": "https://books.google.com/books?id=uF4EAAAAMBAJ&pg=PA36&dq=artificial+intelligence&hl=en&sa=X&ved=2ahUKEwjCnqCuluCEAxVqmIkEHSCRBVAQuwV6BAgEEAY"
        }
      ],
      "thumbnail": "data:image/jpg;base64,/9j/..."
    },
    ...
  ],
  "pagination": {
    "current": 1,
    "next": "https://www.google.com/search?q=artificial+intelligence&sca_esv=5029e200667018e0&gl=us&hl=en&tbs=bkt:m&tbm=bks&ei=l6noZYL3LuqwptQPoKKWgAU&start=10&sa=N&ved=2ahUKEwjCnqCuluCEAxVqmIkEHSCRBVAQ8NMDegQIDhAW",
    "other_pages": {
      "2": "https://www.google.com/search?q=artificial+intelligence&sca_esv=5029e200667018e0&gl=us&hl=en&tbs=bkt:m&tbm=bks&ei=l6noZYL3LuqwptQPoKKWgAU&start=10&sa=N&ved=2ahUKEwjCnqCuluCEAxVqmIkEHSCRBVAQ8tMDegQIDhAE",
      ...
    }
  }
}

Newspaper

Newspaper
GET
https://www.searchapi.io/api/v1/search?document=newspapers&engine=google_books&q=Microsoft
Request
import requests

url = "https://www.searchapi.io/api/v1/search"
params = {
  "engine": "google_books",
  "q": "Microsoft",
  "document": "newspapers"
}

response = requests.get(url, params=params)
print(response.text)
Response
{
  "organic_results": [
    {
      "position": 1,
      "id": "JwgkAAAAIBAJ",
      "title": "New Straits Times - Page 4",
      "link": "https://books.google.com/books?id=JwgkAAAAIBAJ&pg=PA4&dq=Microsoft&article_id=2218,2702876&hl=en&sa=X&ved=2ahUKEwitnYy9luCEAxVyPEQIHadDAhkQ6wF6BAgJEAE",
      "authors": [
        {
          "name": "New Straits Times"
        }
      ],
      "date": "Feb 25, 2001",
      "extensions": ["New Straits Times", "Feb 25, 2001", "Newspaper"],
      "found_in": "Found inside – Page 4",
      "snippet": "... Microsoft Excel 2000 Microsoft PowerPoint S. Microsoft Access 2000 6. Microsoft Outlook 2000 7. Microsoft Publisher 2000 Microsoft FrontPage 2000 9. Microsoft Office 2000 Package 10 Microsoft Office 2000 Package II 11 Visual Basic 12 ...",
      "other_links": [
        {
          "title": "Full view",
          "link": "https://books.google.com/books?id=JwgkAAAAIBAJ&pg=PA4&dq=Microsoft&article_id=2218,2702876&hl=en&sa=X&ved=2ahUKEwitnYy9luCEAxVyPEQIHadDAhkQuwV6BAgJEAY"
        }
      ],
      "thumbnail": "data:image/jpg;base64,..."
    },
    ...
  ],
  "pagination": {
    "current": 1,
    "next": "https://www.google.com/search?q=Microsoft&sca_esv=5029e200667018e0&hl=en&gl=us&tbs=bkt:s&tbm=bks&ei=tqnoZa3qNvL4kPIPp4eJyAE&start=10&sa=N&ved=2ahUKEwitnYy9luCEAxVyPEQIHadDAhkQ8NMDegQIDhAW",
    "other_pages": {
      "2": "https://www.google.com/search?q=Microsoft&sca_esv=5029e200667018e0&hl=en&gl=us&tbs=bkt:s&tbm=bks&ei=tqnoZa3qNvL4kPIPp4eJyAE&start=10&sa=N&ved=2ahUKEwitnYy9luCEAxVyPEQIHadDAhkQ8tMDegQIDhAE",
      ...
    }
  }
}