swagger: "2.0"
schemes:
  - https
host: api.isbndb.com
info:
  description: Definition of ISBNdb.com API
  title: ISBNdb API
  version: 1.0.1
  x-apisguru-categories:
    - open_data
  x-logo:
    url: https://isbndb.com/sites/default/files/ISBN-295x62_0.jpg
  x-origin:
    - format: swagger
      url: https://isbndb.com/modules/isbndb_api_docs/swagger.json
      version: "2.0"
  x-providerName: isbndb.com
securityDefinitions:
  api_key:
    in: header
    name: x-api-key
    type: apiKey
paths:
  "/author/{name}":
    get:
      consumes:
        - application/json
      description: Returns the name and a list of books by the author.
      parameters:
        - description: The name of an author in the Author's database
          in: path
          name: name
          required: true
          type: string
        - description: The number of page to retrieve, please note the API will not return more than 10,000 results no matter how you paginate them
          in: query
          name: page
          required: false
          type: string
        - description: How many items should be returned per page, maximum of 1,000
          in: query
          name: pageSize
          required: false
          type: string
      produces:
        - application/json
      responses:
        "200":
          description: The author name was found in the database
          headers:
            Access-Control-Allow-Origin:
              description: CORS Header to allow different origin responses
              type: string
          schema:
            $ref: "#/definitions/Author"
        "404":
          description: Author not found
      security:
        - api_key: []
      summary: Gets author details
      tags:
        - Author
  "/authors/{query}":
    get:
      consumes:
        - application/json
      description: This returns a list of authors whos name matches the given query
      parameters:
        - description: How many items should be returned per page, maximum of 1,000
          in: query
          name: pageSize
          required: false
          type: string
        - description: A string to search for in the Author’s database
          in: path
          name: query
          required: true
          type: string
        - description: The number of page to retrieve, please note the API will not return more than 10,000 results no matter how you paginate them
          in: query
          name: page
          required: false
          type: string
      produces:
        - application/json
      responses:
        "200":
          description: The query string found results in the author's database
          headers:
            Access-Control-Allow-Origin:
              description: CORS Header to allow different origin responses
              type: string
          schema:
            $ref: "#/definitions/AuthorQueryResults"
        "404":
          description: There are no results in the author's database for the given query
      security:
        - api_key: []
      summary: Search authors
      tags:
        - Author
  "/book/{isbn}":
    get:
      consumes:
        - application/json
      description: Returns the book details
      parameters:
        - description: an ISBN 10 or ISBN 13 in the Books database
          in: path
          name: isbn
          required: true
          type: string
      produces:
        - application/json
      responses:
        "200":
          description: The book ISBN was found in the database
          headers:
            Access-Control-Allow-Origin:
              description: CORS Header to allow different origin responses
              type: string
          schema:
            $ref: "#/definitions/Book"
        "404":
          description: Book not found
      security:
        - api_key: []
      summary: Gets book details
      tags:
        - Book
  "/books/{query}":
    get:
      consumes:
        - application/json
      description: This returns a list of books that match the query
      parameters:
        - description: A string to search for in the Book’s database
          in: path
          name: query
          required: true
          type: string
        - description: The number of page to retrieve, please note the API will not return more than 10,000 results no matter how you paginate them
          in: query
          name: page
          required: false
          type: string
        - description: Filters the query results by author
          in: query
          name: author
          required: false
          type: string
        - description: How many items should be returned per page, maximum of 1,000
          in: query
          name: pageSize
          required: false
          type: string
      produces:
        - application/json
      responses:
        "200":
          description: The query string found results in the books's database
          headers:
            Access-Control-Allow-Origin:
              description: CORS Header to allow different origin responses
              type: string
        "404":
          description: There are no results in the book's database for the given query
      security:
        - api_key: []
      summary: Search books
      tags:
        - Book
  "/publisher/{name}":
    get:
      consumes:
        - application/json
      description: Returns details and a list of books by the publisher.
      parameters:
        - description: The name of a publisher in the Publisher's database
          in: path
          name: name
          required: true
          type: string
        - description: The number of page to retrieve, please note the API will not return more than 10,000 results no matter how you paginate them
          in: query
          name: page
          required: false
          type: string
        - description: How many items should be returned per page, maximum of 1,000
          in: query
          name: pageSize
          required: false
          type: string
      produces:
        - application/json
      responses:
        "200":
          description: The publisher name was found in the database
          headers:
            Access-Control-Allow-Origin:
              description: CORS Header to allow different origin responses
              type: string
          schema:
            $ref: "#/definitions/Publisher"
        "404":
          description: Publisher not found
      security:
        - api_key: []
      summary: Gets publisher details
      tags:
        - Publisher
  "/publishers/{query}":
    get:
      consumes:
        - application/json
      description: This returns a list of publishers that match the given query
      parameters:
        - description: How many items should be returned per page, maximum of 1,000
          in: query
          name: pageSize
          required: false
          type: string
        - description: A string to search for in the Publisher’s database
          in: path
          name: query
          required: true
          type: string
        - description: The number of page to retrieve, please note the API will not return more than 10,000 results no matter how you paginate them
          in: query
          name: page
          required: false
          type: string
      produces:
        - application/json
      responses:
        "200":
          description: The query string found results in the publisher's database
          headers:
            Access-Control-Allow-Origin:
              description: CORS Header to allow different origin responses
              type: string
        "404":
          description: There are no results in the publisher's database for the given query
      security:
        - api_key: []
      summary: Search publishers
      tags:
        - Publisher
  /search:
    get:
      consumes:
        - application/json
      description: Uses a free query string compatible with ElasticSearch 6 to search in any of the ISBNDB's databases
      parameters:
        - description: A query string compatible with ElasticSearch 6
          in: query
          name: q
          required: false
          type: string
      produces:
        - application/json
      responses:
        "200":
          description: Results were found in the requested database
          headers:
            Access-Control-Allow-Origin:
              description: CORS Header to allow different origin responses
              type: string
        "404":
          description: No results found in the requested database
      security:
        - api_key: []
      summary: Search all ISBNDB databases
      tags:
        - Search
  /stats:
    get:
      description: Returns a status object about the ISBNDB database.
      produces:
        - application/json
      responses:
        "200":
          description: Stats on the ISBNDB sucessfully retrieved
          headers:
            Access-Control-Allow-Origin:
              description: CORS Header to allow different origin responses
              type: string
      security:
        - api_key: []
      summary: Gets status on the ISBNDB Database
      tags:
        - Stats
  "/subject/{name}":
    get:
      consumes:
        - application/json
      description: Returns details and a list of books with subject.
      parameters:
        - description: A subject in the Subject's database
          in: path
          name: name
          required: true
          type: string
      produces:
        - application/json
      responses:
        "200":
          description: The subject was found in the database
          headers:
            Access-Control-Allow-Origin:
              description: CORS Header to allow different origin responses
              type: string
          schema:
            $ref: "#/definitions/Subject"
        "404":
          description: Subject not found
      security:
        - api_key: []
      summary: Gets subject details
      tags:
        - Subject
  "/subjects/{query}":
    get:
      consumes:
        - application/json
      description: This returns a list of subjects that match the given query
      parameters:
        - description: How many items should be returned per page, maximum of 1,000
          in: query
          name: pageSize
          required: false
          type: string
        - description: A string to search for in the Subject’s database
          in: path
          name: query
          required: true
          type: string
        - description: The number of page to retrieve, please note the API will not return more than 10,000 results no matter how you paginate them
          in: query
          name: page
          required: false
          type: string
      produces:
        - application/json
      responses:
        "200":
          description: The query string found results in the subject's database
          headers:
            Access-Control-Allow-Origin:
              description: CORS Header to allow different origin responses
              type: string
        "404":
          description: There are no results in the subject's database for the given query
      security:
        - api_key: []
      summary: Search subjects
      tags:
        - Subject
definitions:
  Author:
    description: Describes the name of an author and the books written by that author in the database
    properties:
      author:
        type: string
      books:
        items:
          $ref: "#/definitions/Book"
        type: array
    type: object
  AuthorQueryResults:
    description: Describes the results of a query in the author's database
    properties:
      authors:
        items:
          type: string
        type: array
      total:
        type: integer
    type: object
  Book:
    description: Describes a book in the book's database
    properties:
      authors:
        items:
          type: string
        type: array
      date_published:
        format: date-time
        type: string
      dewey_decimal:
        type: string
      dimensions:
        type: string
      edition:
        type: string
      excerpt:
        type: string
      format:
        type: string
      isbn:
        type: string
      isbn13:
        type: string
      language:
        type: string
      overview:
        type: string
      pages:
        type: integer
      publisher:
        type: string
      reviews:
        items:
          type: string
        type: array
      subjects:
        items:
          type: string
        type: array
      synopsys:
        type: string
      title:
        type: string
      title_long:
        type: string
    type: object
  Publisher:
    properties:
      books:
        items:
          properties:
            isbn:
              type: string
          type: object
        type: array
      name:
        type: string
    type: object
  Subject:
    properties:
      parent:
        type: string
      subject:
        type: string
    type: object
