ExIsbndb.Book (ExIsbndb v1.0.1)
The ExIsbndb.Book
module contains all the available endpoints for Books.
All functions need to receive a map with params, but only those needed for the endpoint will be taken.
Link to this section Summary
Functions
Returns an instance of Book
This returns a list of books that match the query. Only with the Premium and Pro plans and can only send up to 1,000 ISBN numbers per request.
Returns all the Books that match the given query.
Link to this section Functions
get(params)
@spec get(map()) :: {:ok, Finch.Response.t()} | {:error, Exception.t()}
Returns an instance of Book
Params required:
- isbn (string) - string representing the isbn to search
Params available:
- with_prices (integer): 1 being true or 0 being false
examples
Examples
iex> ExIsbndb.Book.get(%{isbn: "1234567789", with_prices: 0)
{:ok, %Finch.Response{body: "...", headers: [...], status: 200}}
get_by_isbns(isbns)
This returns a list of books that match the query. Only with the Premium and Pro plans and can only send up to 1,000 ISBN numbers per request.
examples
Examples
iex> ExIsbndb.Book.get_by_isbns(["123456789", "987654321"]) {:ok, %Finch.Response{body: "...", headers: [...], status: 200}}
search(params)
@spec search(map()) :: {:ok, Finch.Response.t()} | {:error, Exception.t()}
@spec search(list()) :: {:ok, Finch.Response.t()} | {:error, Exception.t()}
Returns all the Books that match the given query.
Params required:
- query (string) - string used to search
Params available:
- page (integer) - page number of the Books to be searched
- page_size (integer) - number of Books to be searched per page
- column(string) - Search limited to this column with values: ['', title, author, date_published]
Any other parameters will be ignored.
examples
Examples
iex> ExIsbndb.Book.search(%{query: "Stormlight", page: 1, page_size: 5, column: ""})
{:ok, %Finch.Response{body: "...", headers: [...], status: 200}}