@lap v0.3
# Machine-readable API spec. Each @endpoint block is one API call.
@api Books API
@base https://api.nytimes.com/svc/books/v3
@version 3.0.0
@auth ApiKey api-key in query
@endpoints 6
@toc lists(4), lists.{format}(1), reviews.{format}(1)

@group lists
@endpoint GET /lists/best-sellers/history.json
@desc Best Seller History List
@optional {age-group: any # The target age group for the best seller., author: any # The author of the best seller. The author field does not include additional contributors (see Data Structure for more details about the author and contributor fields).  When searching the author field, you can specify any combination of first, middle and last names.  When sort-by is set to author, the results will be sorted by author's first name., contributor: any # The author of the best seller, as well as other contributors such as the illustrator (to search or sort by author name only, use author instead).  When searching, you can specify any combination of first, middle and last names of any of the contributors.  When sort-by is set to contributor, the results will be sorted by the first name of the first contributor listed., isbn: any # International Standard Book Number, 10 or 13 digits  A best seller may have both 10-digit and 13-digit ISBNs, and may have multiple ISBNs of each type. To search on multiple ISBNs, separate the ISBNs with semicolons (example: 9780446579933;0061374229)., price: any # The publisher's list price of the best seller, including decimal point, publisher: any # The standardized name of the publisher, title: any # The title of the best seller  When searching, you can specify a portion of a title or a full title.}
@returns(200)

@endgroup

@group lists.{format}
@endpoint GET /lists.{format}
@desc Best Seller List
@optional {list: any # The name of the Times best-seller list. To get valid values, use a list names request.  Be sure to replace spaces with hyphens (e.g., e-book-fiction or hardcover-fiction, not E-Book Fiction or Hardcover Fiction). (The parameter is not case sensitive.), weeks-on-list: any # The number of weeks that the best seller has been on list-name, as of bestsellers-date, bestsellers-date: any # YYYY-MM-DD  The week-ending date for the sales reflected on list-name. Times best-seller lists are compiled using available book sale data. The bestsellers-date may be significantly earlier than published-date. For additional information, see the explanation at the bottom of any best-seller list page on NYTimes.com (example: Hardcover Fiction, published Dec. 5 but reflecting sales to Nov. 29)., date: any # YYYY-MM-DD  The date the best-seller list was published on NYTimes.com (compare bestsellers-date), isbn: any # International Standard Book Number, 10 or 13 digits, published-date: any # YYYY-MM-DD  The date the best-seller list was published on NYTimes.com (compare bestsellers-date), rank: any # The rank of the best seller on list-name as of bestsellers-date, rank-last-week: any # The rank of the best seller on list-name one week prior to bestsellers-date, offset: any # Sets the starting point of the result set, sort-order: any # Sets the sort order of the result set}
@returns(200)

@endgroup

@group lists
@endpoint GET /lists/{date}/{list}.json
@desc Best Seller List by Date
@optional {isbn: any # International Standard Book Number, 10 or 13 digits, list-name: any # The name of the Times best-seller list. To get valid values, use a list names request.  Be sure to replace spaces with hyphens (e.g., e-book-fiction or hardcover-fiction, not E-Book Fiction or Hardcover Fiction). (The parameter is not case sensitive.), published-date: any # YYYY-MM-DD  The date the best-seller list was published on NYTimes.com (compare bestsellers-date), bestsellers-date: any # YYYY-MM-DD  The week-ending date for the sales reflected on list-name. Times best-seller lists are compiled using available book sale data. The bestsellers-date may be significantly earlier than published-date. For additional information, see the explanation at the bottom of any best-seller list page on NYTimes.com (example: Hardcover Fiction, published Dec. 5 but reflecting sales to Nov. 29)., weeks-on-list: any # The number of weeks that the best seller has been on list-name, as of bestsellers-date, rank: any # The rank of the best seller on list-name as of bestsellers-date, rank-last-week: any # The rank of the best seller on list-name one week prior to bestsellers-date, offset: any # Sets the starting point of the result set, sort-order: any # The default is ASC (ascending). The sort-order parameter is used with the sort-by parameter — for details, see each request type.}
@returns(200)

@endpoint GET /lists/overview.{format}
@desc Best Seller List Overview
@optional {published_date: any # The best-seller list publication date. YYYY-MM-DD  You do not have to specify the exact date the list was published. The service will search forward (into the future) for the closest publication date to the date you specify. For example, a request for lists/overview/2013-05-22 will retrieve the list that was published on 05-26.  If you do not include a published_date, the current week's best-sellers lists will be returned., api-key: any}
@returns(200)

@endpoint GET /lists/names.{format}
@desc Best Seller List Names
@optional {api-key: any}
@returns(200)

@endgroup

@group reviews.{format}
@endpoint GET /reviews.{format}
@desc Reviews
@optional {isbn: any # Searching by ISBN is the recommended method. You can enter 10- or 13-digit ISBNs., title: any # You’ll need to enter the full title of the book. Spaces in the title will be converted into the characters %20., author: any # You’ll need to enter the author’s first and last name, separated by a space. This space will be converted into the characters %20., api-key: any}
@returns(200)

@endgroup

@end
