-
Notifications
You must be signed in to change notification settings - Fork 40
/
Copy pathcommunity.yaml
873 lines (843 loc) · 34 KB
/
community.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
swagger: '2.0'
basePath: /svc/community/v3
host: api.nytimes.com
schemes:
- http
info:
version: 3.0.0
title: Community API
description: |
Get access to comments from registered users on New York Times articles. NOTE: This API is deprecated.
The Community API v3
====================
NOTE: The Community API is deprecated. We are currently working on a new API to replace it. With the Community API, you can get user-generated NYTimes.com content. The current release includes article comments and readers' reviews of movies. (Other types of user-generated content will be available in a later version.)
**The Community API at a Glance**
**Base URI**
`http://api.nytimes.com/svc/community/v3/user-content/{resource-type}`
**Scope**
NYTimes.com user-generated content, currently comments on
articles.<http://dotearth.blogs.nytimes.com/> For movies, "comments" are
readers' reviews.
**HTTP method**
GET
**Response formats**
JSON
To use the Community API, you must [sign up for an API key](</signup>). Usage is limited to 5000 requests per day (rate limits are subject to change). Please read and agree to the [API Terms of Use](</tau>) and the [Attribution Guidelines](</attribution>) before you proceed.
### Pagination
Use the offset query parameter to paginate thru the results, 25 comments at a time. Use offset=0 to get the first 25 comments, offset=25 to get the next 25 comments
Responses
---------
An HTTP response code of 200 (OK) is returned for all requests that are
successfully understood and processed. See the [Errors](<http://developer.nytimes.com/docs/community_api/The_Community_API_v3/#h2-errors>) section
for additional response codes.
### DATA RETURNED
- All comment records include the URL to the Times article on which the
comments were made.
- For movie overview URLs, the "comments" returned are readers' reviews of the movie.
- Date fields are in [Unix/UTC format](<http://en.wikipedia.org/wiki/Unix_time>).
paths:
/user-content/recent.json:
parameters: []
get:
summary: Recent User Comments
description: |
To retrieve the most recent user comments, use the following URI structure:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
http://api.nytimes.com/svc/community/v3/user-content/recent.json?api-key={your-API-key}[&optional-param1=value1][...]
operationId: GET_user-content-recent-json
consumes:
- application/json
produces:
- application/json
parameters: []
responses:
'200':
description: ''
schema:
type: object
properties:
debug:
type: object
properties:
version:
type: number
status:
type: string
copyright:
type: string
results:
type: object
properties:
comments:
type: array
items:
type: object
properties:
assetID:
type: integer
commentID:
type: integer
parentID:
type: 'null'
statusID:
type: integer
commentSequence:
type: integer
commentBody:
type: string
commentTitle:
type: string
createDate:
type: string
updateDate:
type: string
approveDate:
type: string
userID:
type: integer
userDisplayName:
type: string
userTitle:
type: string
userURL:
type: string
userLocation:
type: string
editorsSelection:
type: integer
recommendationCount:
type: integer
commentType:
type: string
status:
type: string
asset:
type: object
properties:
assetURL:
type: string
vendorID:
type: string
source:
type: string
assetID:
type: integer
createDate:
type: string
updateDate:
type: string
taxonomy:
type: string
labels:
type: array
items:
type: object
text:
type: array
items:
type: object
properties:
type: object
properties:
comment-list-sort-editors:
type: object
properties:
groupID:
type: integer
taxonomyID:
type: integer
automoderation-on:
type: object
properties:
groupID:
type: integer
taxonomyID:
type: integer
reached-max-com-off:
type: object
properties:
groupID:
type: integer
taxonomyID:
type: integer
all-properties:
type: array
items:
type: object
properties:
name:
type: string
description:
type: string
properties:
type: array
items:
type: object
assetTitle:
type: string
replies:
type: array
items:
type: object
display_name:
type: string
location:
type: string
totalCommentsReturned:
type: integer
api_timestamp:
type: string
examples:
application/json:
debug:
version: 3.1
status: OK
copyright: Copyright (c) 2016 The New York Times Company. All Rights Reserved.
results:
comments:
- assetID: 3449092
commentID: 17912830
parentID: null
statusID: 2
commentSequence: 17912830
commentBody: 'Two things to know about our Governor Kasich. First, he was one of the few Republican governors to accept Obamacare and Medicaid expansion in Ohio, despite the efforts of legislators from his party. Second, as Gail Collins pointed out, he has done everything in his power to eliminate access to safe abortion in Ohio. This will soon include a bill he is expected to sign that will make it illegal for women to have an abortion after learning their fetus has Down''s syndrome. Like most candidates these days, we have to take the good with the bad.'
commentTitle: <br/>
createDate: '1458149421'
updateDate: '1458149469'
approveDate: '1458149469'
userID: 64507566
userDisplayName: DD
userTitle: 'NULL'
userURL: 'NULL'
userLocation: 'Cincinnati, OH'
editorsSelection: 0
recommendationCount: 0
commentType: comment
status: approved
asset:
assetURL: 'http://www.nytimes.com/2016/03/16/opinion/campaign-stops/kasich-the-boulder-between-the-gop.html'
vendorID: MQdKLYFNCfZ7XvixkGz2rw==
source: url
assetID: 3449092
createDate: '1458096538'
updateDate: '1458149477'
taxonomies:
- - taxonomyID: 9188
name: opinion
taxonomy: 'opinion/Kasich, the Boulder Between the G.O.P. and Trump (16collins)'
labels: []
text: []
properties:
comment-list-sort-editors:
groupID: 1
taxonomyID: 364114
automoderation-on:
groupID: 2
taxonomyID: 364114
reached-max-com-off:
groupID: 3
taxonomyID: 9188
all-properties:
- name: no-group
description: Not in a group
properties: []
assetTitle: 'Kasich, the Boulder Between the G.O.P. and Trump (16collins)'
replies: []
display_name: DD
location: 'Cincinnati, OH'
totalCommentsReturned: 25
api_timestamp: '1458149501'
security:
- api-key: []
/user-content/url.json:
parameters: []
get:
summary: Comments by URL
description: |
The comments associated with a specific NYTimes.com URL, use the
following URI structure:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
http://api.nytimes.com/svc/community/v3/user-content/url.json?api-key={your-API-key}&url={url}[&offset=int]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You can specify whether to retrieve exact matches or closest stem matches. URL matching is attempted at each segment of the path, as illustrated by the following example:
First match attempt:
http://www.nytimes.com/2008/10/23/section/article*
Second match attempt:
http://www.nytimes.com/2008/10/23/section/*
Third match attempt:
http://www.nytimes.com/2008/10/23/*
In result sets, matching URLs are sorted alphabetically.
operationId: GET_user-content-url-json
consumes:
- application/json
produces:
- application/json
parameters:
- name: url
in: query
type: string
- name: offset
in: query
type: string
responses:
'200':
description: ''
schema:
type: object
properties:
debug:
type: object
properties:
version:
type: number
status:
type: string
copyright:
type: string
results:
type: object
properties:
comments:
type: array
items:
type: object
properties:
commentID:
type: integer
status:
type: string
commentSequence:
type: integer
userID:
type: integer
userDisplayName:
type: string
userLocation:
type: string
userTitle:
type: 'null'
userURL:
type: 'null'
commentTitle:
type: string
commentBody:
type: string
createDate:
type: string
updateDate:
type: string
approveDate:
type: string
recommendations:
type: integer
replyCount:
type: integer
replies:
type: array
items: {}
editorsSelection:
type: boolean
parentID:
type: 'null'
parentUserDisplayName:
type: 'null'
depth:
type: integer
commentType:
type: string
trusted:
type: integer
recommendedFlag:
type: 'null'
reportAbuseFlag:
type: 'null'
permID:
type: string
picURL:
type: string
timespeople:
type: integer
sharing:
type: integer
page:
type: integer
totalCommentsReturned:
type: integer
totalCommentsFound:
type: integer
totalParentCommentsFound:
type: integer
totalParentCommentsReturned:
type: integer
totalReplyCommentsFound:
type: integer
totalReplyCommentsReturned:
type: integer
totalReporterReplyCommentsFound:
type: integer
totalReporterReplyCommentsReturned:
type: integer
totalEditorsSelectionFound:
type: integer
totalEditorsSelectionReturned:
type: integer
totalRecommendationsFound:
type: integer
totalRecommendationsReturned:
type: integer
replyLimit:
type: integer
depthLimit:
type: integer
sort:
type: string
filter:
type: string
callerID:
type: 'null'
api_timestamp:
type: string
examples:
application/json:
debug:
version: 3.1
status: OK
copyright: Copyright (c) 2016 The New York Times Company. All Rights Reserved.
results:
comments:
- commentID: 20831
status: approved
commentSequence: 138
userID: 44150303
userDisplayName: byakushi
userLocation: US
userTitle: null
userURL: null
commentTitle: ''
commentBody: 'I have always wondered how much energy US would save if it shut down Vegas? Can you imagine the amount of electricity consumed on the strip, the ice melted for its water supply - all in the name of gambling? That''s the kind of consumerism I would like to see halted. Same goes for all the downtown skylines which cause so much light pollution. Even a simple thing like having an "off" switch in the homes rather than just power outlets would save a lot of energy and hopefully make a huge difference in the "consumption footprint." Can American live with that?<br/><br/>As for the growing economies of China & India: the increased industrialization has also increased environmental pollution in those countries. West has conveniently handed down it''s dirty work to them. And at the same time we have Americans screaming about lost jobs. When will they realize that they can''t have it both ways?<br/><br/>All in all they are acting like spoilt brats who have realized that they are no longer the teacher''s favorite. Is it surprising that other folks hate you for your spoilt ways, at the same time envying how you have it so easy?<br/><br/>'
createDate: '1199309173'
updateDate: '1199322293'
approveDate: '1199322293'
recommendations: 5
replyCount: 0
replies: []
editorsSelection: false
parentID: null
parentUserDisplayName: null
depth: 1
commentType: comment
trusted: 0
recommendedFlag: null
reportAbuseFlag: null
permID: '138'
picURL: 'http://graphics8.nytimes.com/images/apps/timespeople/none.png'
timespeople: 1
sharing: 0
page: 1
totalCommentsReturned: 25
totalCommentsFound: 138
totalParentCommentsFound: 138
totalParentCommentsReturned: 25
totalReplyCommentsFound: 0
totalReplyCommentsReturned: 0
totalReporterReplyCommentsFound: 0
totalReporterReplyCommentsReturned: 0
totalEditorsSelectionFound: 13
totalEditorsSelectionReturned: 1
totalRecommendationsFound: 118
totalRecommendationsReturned: 23
replyLimit: 3
depthLimit: 0
sort: oldest
filter: ''
callerID: null
api_timestamp: '1455718117'
security:
- api-key: []
/user-content/by-date.json:
parameters: []
get:
summary: Comments by Date
description: |
To retrieve comments posted on a specific date, use the following URI structure:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
http://api.nytimes.com/svc/community/v3/user-content/by-date.json?api-key={your-API-key}&date={YYYY-MM-DD}[&offset=int]
operationId: GET_user-content-by-date-json
consumes:
- application/json
produces:
- application/json
parameters:
- name: date
in: query
type: string
- name: offset
in: query
type: string
responses:
'200':
description: ''
schema:
type: object
properties:
debug:
type: object
properties:
version:
type: number
status:
type: string
copyright:
type: string
results:
type: object
properties:
comments:
type: array
items:
type: object
properties:
commentID:
type: integer
parentID:
type: 'null'
statusID:
type: integer
lft:
type: integer
rgt:
type: integer
commentSequence:
type: integer
commentBody:
type: string
commentTitle:
type: string
createDate:
type: string
updateDate:
type: string
approveDate:
type: string
userID:
type: integer
userDisplayName:
type: string
userTitle:
type: string
userURL:
type: integer
userLocation:
type: string
editorsSelection:
type: integer
recommendationCount:
type: integer
replyCount:
type: integer
assetID:
type: integer
assetURL:
type: string
status:
type: string
commentType:
type: string
replies:
type: array
items:
type: object
properties: {}
totalCommentsReturned:
type: integer
totalCommentsFound:
type: integer
api_timestamp:
type: string
examples:
application/json:
debug:
version: 3.1
status: OK
copyright: Copyright (c) 2016 The New York Times Company. All Rights Reserved.
results:
comments:
- commentID: 17096625
parentID: null
statusID: 2
lft: 42
rgt: 43
commentSequence: 17096625
commentBody: 'We used black eyed peas and kale (couldn't find mustard greens), and this recipe is fantastic! With cornbread it was perfect!'
commentTitle: <br/>
createDate: '1451710797'
updateDate: '1451710808'
approveDate: '1451710808'
userID: 72856041
userDisplayName: Sharon
userTitle: 'NULL'
userURL: 72856041
userLocation: <br/>
editorsSelection: 0
recommendationCount: 0
replyCount: 0
assetID: 3444599
assetURL: 'http://cooking.nytimes.com/recipes/1017904'
status: approved
commentType: comment
replies: []
totalCommentsReturned: 25
totalCommentsFound: 4121
api_timestamp: '1458149967'
security:
- api-key: []
/user-content/user.json:
parameters: []
get:
summary: Comments by User
description: |
To retrieve comments by a specific NYTimes.com user, use the following URI
structure:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
http://api.nytimes.com/svc/community/v3/user-content/user.json?api-key={your-API-key}&userID={<int>}[&offset=<int>][&url={url-to-match}]
operationId: GET_user-content-user-json
consumes:
- application/json
produces:
- application/json
parameters:
- name: userID
in: query
type: integer
- name: offset
in: query
type: integer
responses:
'200':
description: ''
schema:
type: object
properties:
debug:
type: object
properties:
version:
type: number
status:
type: string
copyright:
type: string
results:
type: object
properties:
comments:
type: array
items:
type: object
properties:
commentID:
type: integer
status:
type: string
commentSequence:
type: integer
userID:
type: integer
userSubmittedDisplayName:
type: string
userSubmittedTitle:
type: 'null'
userSubmittedURL:
type: 'null'
userSubmittedLocation:
type: string
commentTitle:
type: string
commentBody:
type: string
createDate:
type: string
updateDate:
type: string
approveDate:
type: string
recommendations:
type: integer
replyCount:
type: integer
replies:
type: array
items:
type: object
editorsSelection:
type: boolean
parentID:
type: 'null'
commentType:
type: string
asset:
type: object
properties:
assetURL:
type: string
vendorID:
type: string
source:
type: string
assetID:
type: integer
createDate:
type: string
updateDate:
type: string
taxonomy:
type: string
labels:
type: array
items:
type: object
properties:
labelName:
type: string
labelID:
type: integer
text:
type: array
items:
type: object
properties:
type: object
properties:
comment-list-sort-approvedate-desc:
type: object
properties:
groupID:
type: integer
taxonomyID:
type: integer
automoderation-off:
type: object
properties:
groupID:
type: integer
taxonomyID:
type: integer
reached-max-com-on:
type: object
properties:
groupID:
type: integer
taxonomyID:
type: integer
all-properties:
type: array
items:
type: object
properties:
name:
type: string
description:
type: string
properties:
type: array
items:
type: object
assetTitle:
type: string
labels:
type: array
items:
type: object
permid:
type: integer
userDisplayName:
type: 'null'
userTitle:
type: 'null'
userURL:
type: 'null'
userLocation:
type: 'null'
picURL:
type: string
totalCommentsReturned:
type: integer
totalCommentsFound:
type: integer
api_timestamp:
type: string
examples:
application/json:
debug:
version: 3.1
status: OK
copyright: Copyright (c) 2016 The New York Times Company. All Rights Reserved.
results:
comments:
- commentID: 4570862
status: approved
commentSequence: 10
userID: 2364811
userSubmittedDisplayName: Jim
userSubmittedTitle: null
userSubmittedURL: null
userSubmittedLocation: NYC
commentTitle: hardcoded comment title
commentBody: time to Google for "cell phone signal blocker"...
createDate: '1316723787'
updateDate: '1316728099'
approveDate: '1316728099'
recommendations: 11
replyCount: 0
replies: []
editorsSelection: false
parentID: null
commentType: comment
asset:
assetURL: 'http://cityroom.blogs.nytimes.com/2011/09/22/cell-phone-service-on-some-subway-platforms-starts-next-week/'
vendorID: P12Rq7kT2AvJyomlFgcylQ==
source: url
assetID: 3267087
createDate: '1316722025'
updateDate: '1319743568'
taxonomies:
- - taxonomyID: 70457
name: blogs
taxonomy: blogs/cityroom/Cellphone Service Coming to the Subway
labels:
- labelName: NYT_Blogs
labelID: 54906
text: []
properties:
comment-list-sort-approvedate-desc:
groupID: 1
taxonomyID: 199832
automoderation-off:
groupID: 2
taxonomyID: 199832
reached-max-com-on:
groupID: 3
taxonomyID: 199832
all-properties:
- name: no-group
description: Not in a group
properties: []
assetTitle: Cellphone Service Coming to the Subway
labels: []
permid: 10
userDisplayName: null
userTitle: null
userURL: null
userLocation: null
picURL: 'http://pimage.timespeople.nytimes.com/2364/811/cropped-2364811.jpg?0.8428952772024576'
totalCommentsReturned: 2
totalCommentsFound: 2
api_timestamp: '1458150045'
security:
- api-key: []
definitions: {}
securityDefinitions:
api-key:
name: api-key
type: apiKey
in: query