-
Notifications
You must be signed in to change notification settings - Fork 5
/
openapi.yaml
1008 lines (931 loc) · 31.9 KB
/
openapi.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
openapi: 3.0.0
info:
title: Books API
description: >
The Books API provides information about book reviews and The New York Times
Best Sellers lists.
## Best Sellers Lists Services
### List Names
The lists/names service returns a list of all the NYT Best Sellers Lists.
Some lists are published weekly and others monthly. The response includes
when each list was first published and last published.
```
/lists/names.json
```
### List Data
The lists/{date}/{name} service returns the books on the best sellers list
for the specified date and list name.
```
/lists/2019-01-20/hardcover-fiction.json
```
Use "current" for {date} to get the latest list.
```
/lists/current/hardcover-fiction.json
```
## Book Reviews Services
The book reviews service lets you get NYT book review by author, ISBN, or
title.
```
/reviews.json?author=Michelle+Obama
```
```
/reviews.json?isbn=9781524763138
```
```
/reviews.json?title=Becoming
```
## Example Calls
```
https://api.nytimes.com/svc/books/v3/lists/current/hardcover-fiction.json?api-key=yourkey
```
```
https://api.nytimes.com/svc/books/v3/reviews.json?author=Stephen+King&api-key=yourkey
```
version: 3.0.0
servers:
- url: https://api.nytimes.com/svc/books/v3
tags:
- name: List
- name: Review
paths:
/lists.json:
get:
tags:
- List
summary: Best Sellers List
operationId: List_getBestSellers
security:
- api-key: []
description: Get Best Sellers list. If no date is provided returns the latest list.
parameters:
- description: >-
The name of the Times best sellers list (hardcover-fiction,
paperback-nonfiction, ...).
The /lists/names service returns all the list names.
The encoded list names are lower case with hyphens instead of spaces
(e.g. e-book-fiction, instead of E-Book Fiction).
name: list
in: query
required: true
schema:
type: string
default: hardcover-fiction
- description: >-
YYYY-MM-DD
The week-ending date for the sales reflected on list-name. Times
best sellers 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).
name: bestsellers-date
in: query
schema:
type: string
pattern: ^\d{4}-\d{2}-\d{2}$
- description: >-
YYYY-MM-DD
The date the best sellers list was published on NYTimes.com
(different than bestsellers-date). Use "current" for latest list.
name: published-date
in: query
schema:
type: string
pattern: ^\d{4}-\d{2}-\d{2}$
- description: >-
Sets the starting point of the result set (0, 20, ...). Used to
paginate thru books if list has more than 20. Defaults to 0. The
num_results field indicates how many books are in the list.
name: offset
in: query
schema:
type: integer
multipleOf: 20
responses:
'200':
description: Best Sellers list books
content:
application/json:
schema:
$ref: '#/components/schemas/ListGetBestSellersResponse'
examples:
response:
value:
status: OK
copyright: >-
Copyright (c) 2019 The New York Times Company. All Rights
Reserved.
num_results: 1
last_modified: '2016-03-11T13:09:01-05:00'
results:
- list_name: Hardcover Fiction
display_name: Hardcover Fiction
bestsellers_date: '2016-03-05'
published_date: '2016-03-20'
rank: 5
rank_last_week: 2
weeks_on_list: 2
asterisk: 0
dagger: 0
amazon_product_url: >-
http://www.amazon.com/Girls-Guide-Moving-On-Novel-ebook/dp/B00ZNE17B4?tag=thenewyorktim-20
isbns:
- isbn10: 553391925
isbn13: '9780553391923'
book_details:
- title: A GIRL'S GUIDE TO MOVING ON
description: >-
A mother and her daughter-in-law both leave
unhappy marriages and take up with new men.
contributor: by Debbie Macomber
author: Debbie Macomber
contributor_note: ''
price: 0
age_group: ''
publisher: Ballantine
primary_isbn13: '9780553391923'
primary_isbn10: 553391925
reviews:
- book_review_link: ''
first_chapter_link: ''
sunday_review_link: ''
article_chapter_link: ''
/lists/{date}/{list}.json:
get:
tags:
- List
summary: Best Sellers List by Date
operationId: List_getByDate
security:
- api-key: []
description: Get Best Sellers list by date.
parameters:
- description: >-
YYYY-MM-DD or "current"
The date the best sellers list was published on NYTimes.com. Use
"current" to get latest list.
name: date
in: path
required: true
schema:
type: string
pattern: ^(\d{4}-\d{2}-\d{2}|current)$
- description: >-
Name of the Best Sellers List (e.g. hardcover-fiction). You can get
the full list of names from the /lists/names.json service.
name: list
in: path
required: true
schema:
type: string
- description: >-
Sets the starting point of the result set (0, 20, ...). Used to
paginate thru books if list has more than 20. Defaults to 0. The
num_results field indicates how many books are in the list.
name: offset
in: query
schema:
type: integer
multipleOf: 20
responses:
'200':
description: Best Sellers list books.
content:
application/json:
schema:
$ref: '#/components/schemas/ListGetByDateResponse'
examples:
response:
value:
status: OK
copyright: >-
Copyright (c) 2019 The New York Times Company. All Rights
Reserved.
num_results: 15
last_modified: '2015-12-25T13:05:20-05:00'
results:
list_name: Trade Fiction Paperback
bestsellers_date: '2015-12-19'
published_date: '2016-01-03'
display_name: Paperback Trade Fiction
normal_list_ends_at: 10
updated: WEEKLY
books:
- title: THE MARTIAN
description: >-
Separated from his crew, an astronaut embarks on a
quest to stay alive on Mars. The basis of the movie.
rank: 1
rank_last_week: 0
weeks_on_list: 60
asterisk: 0
dagger: 0
primary_isbn10: 553418025
primary_isbn13: '9780553418026'
publisher: Broadway
price: 0
author: Andy Weir
contributor: by Andy Weir
contributor_note: ''
book_image: >-
http://du.ec2.nytimes.com.s3.amazonaws.com/prd/books/9780804139038.jpg
amazon_product_url: >-
http://www.amazon.com/The-Martian-Novel-Andy-Weir-ebook/dp/B00EMXBDMA?tag=thenewyorktim-20
age_group: ''
book_review_link: ''
first_chapter_link: ''
sunday_review_link: ''
article_chapter_link: ''
isbns:
- isbn10: 804139024
isbn13: '9780804139021'
corrections: []
/lists/full-overview.json:
get:
tags:
- List
summary: Best Sellers List Full Overview
operationId: List_getAllBestSellers
security:
- api-key: []
description: Get all books for all the Best Sellers lists for specified date.
parameters:
- description: >-
YYYY-MM-DD
The best-seller list publication date.
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.
name: published_date
in: query
schema:
type: string
pattern: ^\d{4}-\d{2}-\d{2}$
responses:
'200':
description: Full overview of Best Sellers lists.
content:
application/json:
schema:
$ref: '#/components/schemas/OverviewResponse'
/lists/overview.json:
get:
tags:
- List
summary: Best Sellers List Overview
operationId: List_getBestSellersOverview
security:
- api-key: []
description: Get top 5 books for all the Best Sellers lists for specified date.
parameters:
- description: >-
YYYY-MM-DD
The best-seller list publication date.
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.
name: published_date
in: query
schema:
type: string
pattern: ^\d{4}-\d{2}-\d{2}$
responses:
'200':
description: Overview of Best Sellers lists.
content:
application/json:
schema:
$ref: '#/components/schemas/OverviewResponse'
examples:
response:
value:
status: OK
copyright: >-
Copyright (c) 2019 The New York Times Company. All Rights
Reserved.
num_results: 210
results:
bestsellers_date: '2016-03-05'
published_date: '2016-03-20'
lists:
- list_id: 704
list_name: Combined Print and E-Book Fiction
display_name: Combined Print & E-Book Fiction
updated: WEEKLY
list_image: >-
http://du.ec2.nytimes.com.s3.amazonaws.com/prd/books/9780399175954.jpg
books:
- title: THE GANGSTER
description: >-
In the ninth book in this series, set in 1906,
the New York detective Isaac Bell contends with
a crime boss passing as a respectable
businessman and a tycoon’s plot against
President Theodore Roosevelt.
age_group: ''
author: Clive Cussler and Justin Scott
contributor: by Clive Cussler and Justin Scott
contributor_note: ''
created_date: '2016-03-10 12:00:22'
price: 0
primary_isbn13: '9780698406421'
primary_isbn10: 698406427
publisher: Putnam
rank: 1
updated_date: '2016-03-10 17:00:21'
/lists/names.json:
get:
tags:
- List
summary: Best Sellers List Names
operationId: List_getNames
security:
- api-key: []
description: Get Best Sellers list names.
responses:
'200':
description: Get Best Sellers list names.
content:
application/json:
schema:
$ref: '#/components/schemas/ListGetNamesResponse'
examples:
response:
value:
status: OK
copyright: >-
Copyright (c) 2019 The New York Times Company. All Rights
Reserved.
num_results: 53
results:
- list_name: Combined Print and E-Book Fiction
display_name: Combined Print & E-Book Fiction
list_name_encoded: combined-print-and-e-book-fiction
oldest_published_date: '2011-02-13'
newest_published_date: '2016-03-20'
updated: WEEKLY
/lists/best-sellers/history.json:
get:
tags:
- List
summary: Best Sellers List History
operationId: List_getHistory
security:
- api-key: []
description: Get Best Sellers list history.
parameters:
- description: The target age group for the best seller.
name: age-group
in: query
schema:
type: string
- description: >-
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.
name: author
in: query
schema:
type: string
- description: >-
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.
name: contributor
in: query
schema:
type: string
- description: >-
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).
name: isbn
in: query
schema:
type: string
- description: >-
Sets the starting point of the result set (0, 20, ...). Used to
paginate thru results if there are more than 20. Defaults to 0. The
num_results field indicates how many results there are total.
name: offset
in: query
schema:
type: integer
multipleOf: 20
- description: >-
The publisher's list price of the best seller, including decimal
point.
name: price
in: query
schema:
type: string
- description: The standardized name of the publisher
name: publisher
in: query
schema:
type: string
- description: >-
The title of the best seller
When searching, you can specify a portion of a title or a full
title.
name: title
in: query
schema:
type: string
responses:
'200':
description: Best Sellers list history
content:
application/json:
schema:
$ref: '#/components/schemas/ListGetHistoryResponse'
examples:
response:
value:
status: OK
copyright: >-
Copyright (c) 2019 The New York Times Company. All Rights
Reserved.
num_results: 28970
results:
- title: '#GIRLBOSS'
description: An online fashion retailer traces her path to success.
contributor: by Sophia Amoruso
author: Sophia Amoruso
contributor_note: ''
price: 0
age_group: ''
publisher: Portfolio/Penguin/Putnam
isbns:
- isbn10: 039916927X
isbn13: '9780399169274'
ranks_history:
- primary_isbn10: '1591847931'
primary_isbn13: '9781591847939'
rank: 8
list_name: Business Books
display_name: Business
published_date: '2016-03-13'
bestsellers_date: '2016-02-27'
weeks_on_list: 0
ranks_last_week: null
asterisk: 0
dagger: 0
reviews:
- book_review_link: ''
first_chapter_link: ''
sunday_review_link: ''
article_chapter_link: ''
/reviews.json:
get:
tags:
- Review
summary: Reviews
operationId: Review_getBookReviews
security:
- api-key: []
description: Get book reviews.
parameters:
- description: >-
Searching by ISBN is the recommended method. You can enter 10- or
13-digit ISBNs.
name: isbn
in: query
schema:
type: integer
- description: >-
You’ll need to enter the full title of the book. Spaces in the title
will be converted into the characters %20.
name: title
in: query
schema:
type: string
- description: >-
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.
name: author
in: query
schema:
type: string
responses:
'200':
description: Book reviews.
content:
application/json:
schema:
$ref: '#/components/schemas/ReviewGetBookReviewsResponse'
examples:
response:
value:
status: OK
copyright: >-
Copyright (c) 2019 The New York Times Company. All Rights
Reserved.
num_results: 2
results:
- summary: >-
In “1Q84,” the Japanese novelist Haruki Murakami
writes about characters in a Tokyo with two moons.
url: >-
http://www.nytimes.com/2011/11/10/books/1q84-by-haruki-murakami-review.html
publication_dt: '2011-11-10'
byline: JANET MASLIN
book_title: 1Q84
book_author: Haruki Murakami
isbn13:
- '9780307476463'
components:
securitySchemes:
api-key:
name: api-key
type: apiKey
in: query
schemas:
OverviewResponse:
type: object
properties:
status:
type: string
copyright:
type: string
num_results:
type: integer
results:
type: object
properties:
bestsellers_date:
type: string
published_date:
type: string
lists:
type: array
items:
type: object
properties:
list_id:
type: integer
list_name:
type: string
display_name:
type: string
updated:
type: string
list_image:
type: string
books:
type: array
items:
type: object
properties:
title:
type: string
description:
type: string
age_group:
type: string
author:
type: string
contributor:
type: string
contributor_note:
type: string
created_date:
type: string
price:
type: integer
primary_isbn13:
type: string
primary_isbn10:
type: string
publisher:
type: string
rank:
type: integer
updated_date:
type: string
ListGetBestSellersResponse:
type: object
properties:
status:
type: string
copyright:
type: string
num_results:
type: integer
last_modified:
type: string
results:
type: array
items:
type: object
properties:
list_name:
type: string
display_name:
type: string
bestsellers_date:
type: string
published_date:
type: string
rank:
type: integer
rank_last_week:
type: integer
weeks_on_list:
type: integer
asterisk:
type: integer
dagger:
type: integer
amazon_product_url:
type: string
isbns:
type: array
items:
type: object
properties:
isbn10:
type: string
isbn13:
type: string
book_details:
type: array
items:
type: object
properties:
title:
type: string
description:
type: string
contributor:
type: string
author:
type: string
contributor_note:
type: string
price:
type: integer
age_group:
type: string
publisher:
type: string
primary_isbn13:
type: string
primary_isbn10:
type: string
reviews:
type: array
items:
type: object
properties:
book_review_link:
type: string
first_chapter_link:
type: string
sunday_review_link:
type: string
article_chapter_link:
type: string
ListGetByDateResponse:
type: object
properties:
status:
type: string
copyright:
type: string
num_results:
type: integer
last_modified:
type: string
results:
type: object
properties:
list_name:
type: string
bestsellers_date:
type: string
published_date:
type: string
display_name:
type: string
normal_list_ends_at:
type: integer
updated:
type: string
books:
type: array
items:
type: object
properties:
title:
type: string
description:
type: string
rank:
type: integer
rank_last_week:
type: integer
weeks_on_list:
type: integer
asterisk:
type: integer
dagger:
type: integer
primary_isbn10:
type: string
primary_isbn13:
type: string
publisher:
type: string
price:
type: integer
author:
type: string
contributor:
type: string
contributor_note:
type: string
book_image:
type: string
amazon_product_url:
type: string
age_group:
type: string
book_review_link:
type: string
first_chapter_link:
type: string
sunday_review_link:
type: string
article_chapter_link:
type: string
isbns:
type: array
items:
type: object
properties:
isbn10:
type: string
isbn13:
type: string
corrections:
type: array
items:
type: object
properties: {}
ListGetNamesResponse:
type: object
properties:
status:
type: string
copyright:
type: string
num_results:
type: integer
results:
type: array
items:
type: object
properties:
list_name:
type: string
display_name:
type: string
list_name_encoded:
type: string
oldest_published_date:
type: string
newest_published_date:
type: string
updated:
type: string
enum:
- WEEKLY
- MONTHLY
ListGetHistoryResponse:
type: object
properties:
status:
type: string
copyright:
type: string
num_results:
type: integer
results:
type: array
items:
type: object
properties:
title:
type: string
description:
type: string
contributor:
type: string
author:
type: string
contributor_note:
type: string
price:
type: integer
age_group:
type: string
publisher:
type: string
isbns:
type: array
items:
type: object
properties:
isbn10:
type: string
isbn13:
type: string
ranks_history:
type: array
items:
type: object
properties:
primary_isbn10:
type: string
primary_isbn13:
type: string
rank:
type: integer
list_name:
type: string
display_name:
type: string
published_date:
type: string
bestsellers_date:
type: string
weeks_on_list:
type: integer
ranks_last_week:
nullable: true
asterisk:
type: integer
dagger:
type: integer
reviews:
type: array
items:
type: object
properties:
book_review_link:
type: string
first_chapter_link:
type: string
sunday_review_link:
type: string
article_chapter_link:
type: string
ReviewGetBookReviewsResponse:
type: object
properties:
status:
type: string
copyright:
type: string
num_results:
type: integer
results:
type: array
items:
type: object
properties:
summary:
type: string
url:
type: string
publication_dt:
type: string
byline:
type: string