google_books_api 1.0.1

SDKdartflutter
Platformandroidioswindowslinuxmacosweb

A library to help on the search for books on google books api

google_books_api

A dart package to search books with the Google Books Api.

Installing

Add google_books_api to your pubspec.yaml file:

dependencies:
  google_books_api: ^1.0.0

Import google_books_api in files that it will be used:

import 'package:google_books_api/google_books_api.dart';

Usage/Examples

Search books

To get a list of books corresponding to the query.

final List<Book> books = await GoogleBooksApi().searchBooks(
    'book',
    maxResults: 20,
    printType: PrintType.books,
    orderBy: OrderBy.relevance,
);

You can use this parameters to make the query more efficient.

ParameterDescription
queryTypeKeywords to search in particular fields
maxResultsThe maximum number of elements to return with this request.
startIndexThe position in the collection at which to start the list of results.
langRestrictRestrict 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".
orderByOrder of the volume search results.
printTypeRestrict to books or magazines.

Get book by ID

To get a book from his ID.

final Book book = await GoogleBooksApi().getBookById('H0taAAAAYAAJ');