-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPixivPublicAPI.yaml
1293 lines (1220 loc) · 29.6 KB
/
PixivPublicAPI.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
swagger: "2.0"
info:
title: "Pixiv Public API"
description: "Unofficial API specification extracted from Pixiv Android App v4.8.2"
version: "1.0"
host: public-api.secure.pixiv.net
schemes:
- https
basePath: /v1
produces:
- application/json
consumes:
- application/x-www-form-urlencoded;charset=UTF-8
definitions:
GenericWrapper:
description: "All responses from all endpoints are wrapped with this generic object."
required:
- status
properties:
status:
type: string
enum: ["success", "failure"]
ResponseWrapper:
description: "Succsessfull response"
allOf:
- $ref: "#/definitions/GenericWrapper"
- properties:
count:
type: integer
pagination:
type: object
required:
- pages
- previous
- current
- per_page
- next
- total
properties:
pages:
type: integer
previous:
type: integer
current:
type: integer
per_page:
type: integer
next:
type: integer
total:
type: integer
required:
- count
Error:
description: "Generic error"
required:
- has_error
allOf:
- $ref: "#/definitions/GenericWrapper"
- properties:
has_error:
type: boolean
errors:
type: object
required:
- system
properties:
system:
type: object
required:
- message
properties:
message:
description: "Error message"
type: string
ImageUrls:
description: "Urls for the different sizes of picture"
properties:
large:
type: string
medium:
type: string
small:
type: string
max_240x240:
type: string
px_120x:
type: string
px_128x128:
type: string
px_16x16:
type: string
px_170x170:
type: string
px_480mw:
type: string
px_48x48:
type: string
px_50x50:
type: string
px_56x56:
type: string
px_64x64:
type: string
ugoira600x600:
type: string
ugoira1920x1080:
type: string
Emoji:
properties:
id:
type: integer
slug:
type: string
image_urls:
$ref: "#/definitions/ImageUrls"
EmojisResponseWrapper:
required:
- response
properties:
response:
type: array
items:
$ref: "#/definitions/Emoji"
UserStats:
description: "User statistics"
required:
- favorites
- following
- friends
- works
properties:
favorites:
description: "Number of bookmarks"
type: integer
following:
description: "Number of followed users"
type: integer
friends:
description: "Number of friends"
type: integer
works:
description: "Number of submitted works"
type: integer
Workspace:
description: "Workspaces"
required:
- chair
- computer
- image_url
- monitor
- mouse
- music
- on_table
- other
- printer
- scanner
- software
- table
- tablet
properties:
chair:
description: "Chair"
type: string
computer:
description: "Computer"
type: string
image_url:
description: "Full sized workspace photo"
type: string
image_urls:
$ref: "#/definitions/ImageUrls"
monitor:
description: "Monitor"
type: string
mouse:
description: "Mouse"
type: string
music:
description: "Drawing tunes"
type: string
on_table:
description: "On top of your desk"
type: string
other:
description: "Others"
type: string
printer:
description: "Printer"
type: string
scanner:
description: "Scanner"
type: string
software:
description: "Software used"
type: string
table:
description: "Table"
type: string
tablet:
description: "Graphic tablet"
type: string
Profile:
description: "Profile information"
required:
- birth_date
- blood_type
- contacts
- homepage
- introduction
- job
- location
- tags
properties:
birth_date:
format: date
type: string
blood_type:
type: string
contacts:
type: object
properties:
twitter:
type: string
homepage:
type: string
introduction:
type: string
job:
type: string
location:
type: string
tags:
type: string
workspace:
$ref: "#/definitions/Workspace"
User:
required:
- account
- id
- is_follower
- is_following
- is_friend
- is_premium
- name
- profile
- profile_image_urls
- stats
properties:
account:
description: "Pixiv ID"
type: string
id:
type: integer
is_follower:
type: boolean
is_following:
type: boolean
is_friend:
type: boolean
is_premium:
type: boolean
name:
type: string
profile:
$ref: "#/definitions/Profile"
profile_image_urls:
$ref: "#/definitions/ImageUrls"
stats:
$ref: "#/definitions/UserStats"
UsersResponseWrapper:
required:
- response
properties:
response:
type: array
items:
$ref: "#/definitions/User"
WorkStats:
description: "Work statistics"
required:
- views_count
- commented_count
- scored_count
- favorited_count
- score
properties:
views_count:
type: integer
commented_count:
type: integer
scored_count:
type: integer
favorited_count:
type: object
properties:
public:
type: number
private:
type: number
score:
type: integer
IllustMetadata:
description: "Illustration metadata"
required:
- pages
properties:
pages:
type: array
items:
$ref: "#/definitions/ImageUrls"
UgoiraMetadata:
description: "Ugoria metadata"
required:
- frames
- zip_urls
properties:
frames:
type: array
items:
type: object
properties:
delay_msec:
type: integer
zip_urls:
$ref: "#/definitions/ImageUrls"
Work:
description: "Illust, manga or ugoira"
required:
- id
- image_urls
properties:
id:
type: integer
type:
type: string
enum: ["illustration", "manga", "ugoira"]
age_limit:
type: string
enum: ["all-age", "r18", "r18g"]
is_manga:
type: boolean
is_liked:
type: boolean
created_time:
type: string
format: date-time
reuploaded_time:
type: string
format: date-time
favorite_id:
description: "Favorite id or 0"
type: integer
book_style:
type: string
enum: ["none", "left_to_right", "right_to_left"]
width:
type: integer
height:
type: integer
page_count:
type: integer
user:
$ref: "#/definitions/User"
stats:
$ref: "#/definitions/WorkStats"
metadata:
allOf:
- $ref: "#/definitions/IllustMetadata"
- $ref: "#/definitions/UgoiraMetadata"
image_urls:
$ref: "#/definitions/ImageUrls"
tools:
type: array
items:
type: string
tags:
type: array
items:
type: string
title:
type: string
caption:
description: "Description"
type: string
content_type:
description: "Unused"
type: integer
publicity:
description: "Unused"
type: integer
sanity_level:
description: "Found on spotlighted works"
type: string
enum: ["white", "black"]
Comment:
required:
- id
- text
- user
properties:
id:
description: "Comment id"
type: integer
parent_id:
description: "Parent comment id for this one"
type: integer
root_id:
description: "First comment id in the thread"
type: integer
illust_id:
description: "Illust id this comment for"
type: integer
novel_id:
description: "Novel id this comment for"
type: integer
commented_time:
description: "Comment date and time"
type: string
format: date-time
stamp:
description: "Unused"
type: string
text:
description: "Text"
type: string
user:
$ref: "#/definitions/User"
CommentsWrapper:
required:
- response
properties:
response:
type: array
items:
$ref: "#/definitions/Comment"
WorksResponseWrapper:
required:
- response
properties:
response:
type: array
items:
$ref: "#/definitions/Work"
SpotlightedWork:
required:
- description
- language
- work
properties:
description:
type: string
language:
type: string
work:
$ref: "#/definitions/Work"
Spotlight:
required:
- id
properties:
id:
type: integer
publish_date:
type: string
format: date-time
language:
type: string
title:
type: string
footer:
type: string
header:
type: string
image_urls:
$ref: "#/definitions/ImageUrls"
spotlighted_works:
type: array
items:
$ref: "#/definitions/SpotlightedWork"
SpotlightResponseWrapper:
required:
- response
properties:
response:
type: array
items:
$ref: "#/definitions/Spotlight"
RankedWork:
required:
- previous_rank
- rank
- work
properties:
previous_rank:
type: integer
rank:
type: integer
work:
$ref: "#/definitions/Work"
Ranking:
required:
- content
- date
- mode
- works
properties:
content:
type: string
date:
type: string
format: date
mode:
type: string
works:
type: array
items:
$ref: "#/definitions/RankedWork"
RankingResponseWrapper:
required:
- response
properties:
response:
type: array
items:
$ref: "#/definitions/Ranking"
Bookmark:
required:
- comment
- work
- publicity
- id
properties:
comment:
type: string
work:
type: object
required:
- id
properties:
id:
type: integer
publicity:
type: string
enum: ["public", "private"]
id:
description: "Bookmark ID"
type: integer
BookmarkResponseWrapper:
required:
- response
properties:
response:
type: array
items:
$ref: "#/definitions/Bookmark"
responses:
GenericError:
description: "Generic error"
schema:
$ref: "#/definitions/Error"
GenericResponse:
description: "Generic response"
schema:
$ref: "#/definitions/ResponseWrapper"
EmojisResponse:
description: OK
schema:
allOf:
- $ref: "#/definitions/ResponseWrapper"
- $ref: "#/definitions/EmojisResponseWrapper"
UsersResponse:
description: OK
schema:
allOf:
- $ref: "#/definitions/ResponseWrapper"
- $ref: "#/definitions/UsersResponseWrapper"
WorksResponse:
description: OK
schema:
allOf:
- $ref: "#/definitions/ResponseWrapper"
- $ref: "#/definitions/WorksResponseWrapper"
CommentsResponse:
description: OK
schema:
allOf:
- $ref: "#/definitions/ResponseWrapper"
- $ref: "#/definitions/CommentsWrapper"
SpotlightResponse:
description: OK
schema:
allOf:
- $ref: "#/definitions/ResponseWrapper"
- $ref: "#/definitions/SpotlightResponseWrapper"
RankingResponse:
description: OK
schema:
allOf:
- $ref: "#/definitions/ResponseWrapper"
- $ref: "#/definitions/RankingResponseWrapper"
BookmarkResponse:
description: OK
schema:
allOf:
- $ref: "#/definitions/ResponseWrapper"
- $ref: "#/definitions/BookmarkResponseWrapper"
parameters:
PixivID:
name: id
description: "Pixiv ID"
type: integer
in: path
required: true
IllustID:
name: id
description: "Illustration ID"
type: integer
in: path
required: true
NovelID:
name: id
description: "Novel ID"
type: integer
in: path
required: true
SpotlightID:
name: id
description: "Spotlight ID"
type: integer
in: path
required: true
Page:
name: page
description: "Page number (starting from 1)"
type: integer
in: query
PageSize:
name: per_page
description: "Number of results per page"
type: integer
in: query
IncludeUserStats:
name: include_stats
description: "Include user statistics"
type: integer
in: query
enum: [0, 1]
IncludeWorkStats:
name: include_stats
description: "Include work statistics (Score, number of views, etc..)"
type: string
in: query
enum: ["true", "false"]
IncludeWorkSanityLevel:
name: include_sanity_level
type: string
in: query
enum: ["true", "false"]
ProfileImageSizes:
name: profile_image_sizes
description: "Select only provided userpic sizes"
type: array
in: query
items:
type: string
collectionFormat: csv
enum: ["px_170x170", "px_50x50", "px_16x16"]
ImageSizes:
name: image_sizes
description: "Select only provided picture sizes"
type: array
in: query
items:
type: string
collectionFormat: csv
enum: ["px_128x128", "px_480mw", "large", "medium", "small"]
AcceptLanguage:
name: Accept-Language
description: "Display results in certain language"
type: string
in: header
enum: ["ja", "en"]
paths:
/emoji.json:
get:
description: "Returns list of available emojis"
responses:
400:
$ref: "#/responses/GenericError"
200:
$ref: "#/responses/EmojisResponse"
/ranking/{type}.json:
get:
description: "Return rankings"
parameters:
- name: type
type: string
in: path
description: "Type of works (only `all` supported now)"
enum: ["all", "illust", "manga"]
required: true
- $ref: "#/parameters/ImageSizes"
- $ref: "#/parameters/Page"
- $ref: "#/parameters/PageSize"
- name: date
type: string
in: query
description: "Ranking for a specific day"
pattern: "yyyy-MM-dd"
- name: mode
type: string
in: query
description: "Ranking type"
enum: ["daily", "weekly", "monthly", "daily_r18", "weekly_r18", "monthly_r18", "r18g", "original", "male", "female", "rookie", "male_r18", "female_r18"]
required: true
responses:
400:
$ref: "#/responses/GenericError"
200:
$ref: "#/responses/RankingResponse"
/users/{id}.json:
get:
description: "Returns user account data"
parameters:
- $ref: "#/parameters/PixivID"
- $ref: "#/parameters/IncludeUserStats"
- name: include_profile
description: "Include detailed profile (Homepage, introduction message, tags, etc..)"
type: integer
enum: [0, 1]
in: query
- name: include_contacts
description: "Include user contacts (Twitter, Skype, YahooID, etc..)"
type: integer
enum: [0, 1]
in: query
- name: include_workspace
description: "Include workspace info"
type: integer
enum: [0, 1]
in: query
- $ref: "#/parameters/ProfileImageSizes"
responses:
400:
$ref: "#/responses/GenericError"
200:
$ref: "#/responses/UsersResponse"
/users/{id}/works.json:
get:
description: "Returns list of user works (paginated)"
parameters:
- $ref: "#/parameters/PixivID"
- $ref: "#/parameters/ImageSizes"
- $ref: "#/parameters/Page"
- $ref: "#/parameters/PageSize"
responses:
400:
$ref: "#/responses/GenericError"
200:
$ref: "#/responses/WorksResponse"
/users/{id}/favorite_works.json:
get:
description: "Returns list of user favorited works (paginated)"
parameters:
- $ref: "#/parameters/PixivID"
- $ref: "#/parameters/ImageSizes"
- $ref: "#/parameters/Page"
- $ref: "#/parameters/PageSize"
responses:
400:
$ref: "#/responses/GenericError"
200:
$ref: "#/responses/WorksResponse"
/works.json:
get:
description: "Returns list of newly-added works"
parameters:
- $ref: "#/parameters/ImageSizes"
- $ref: "#/parameters/Page"
- $ref: "#/parameters/PageSize"
responses:
400:
$ref: "#/responses/GenericError"
200:
$ref: "#/responses/WorksResponse"
/works/{id}.json:
get:
description: "Returns a single work"
parameters:
- $ref: "#/parameters/IllustID"
- $ref: "#/parameters/ImageSizes"
- $ref: "#/parameters/IncludeWorkStats"
- $ref: "#/parameters/IncludeWorkSanityLevel"
- name: caption_format
type: string
in: query
enum: ["html"]
responses:
400:
$ref: "#/responses/GenericError"
200:
$ref: "#/responses/WorksResponse"
delete:
description: "Delete work"
parameters:
- $ref: "#/parameters/IllustID"
responses:
400:
$ref: "#/responses/GenericError"
200:
$ref: "#/responses/GenericResponse"
/me/favorite_works.json:
get:
description: "Returns current user favorited works (paginated)"
parameters:
- $ref: "#/parameters/ImageSizes"
- $ref: "#/parameters/Page"
- $ref: "#/parameters/PageSize"
- name: publicity
type: string
in: query
responses:
400:
$ref: "#/responses/GenericError"
200:
$ref: "#/responses/WorksResponse"
post:
description: "Add work to favorites"
parameters:
- name: work_id
type: integer
in: formData
- name: publicity
type: string
in: formData
responses:
400:
$ref: "#/responses/GenericError"
200:
$ref: "#/responses/BookmarkResponse"
delete:
description: "Remove work from favorites"
parameters:
- name: ids
description: "Bookmark IDs"
type: array
items:
type: string
collectionFormat: csv
in: formData
responses:
400:
$ref: "#/responses/GenericError"
200:
$ref: "#/responses/GenericResponse"
/me/following/works.json:
get:
description: "Return list of works submitted by users you following (paginated)"
parameters:
- $ref: "#/parameters/ImageSizes"
- $ref: "#/parameters/Page"
- $ref: "#/parameters/PageSize"
responses:
400:
$ref: "#/responses/GenericError"
200:
$ref: "#/responses/WorksResponse"
/me/friends/works.json:
get:
description: "Return list of works submitted by friends (paginated)"
parameters:
- $ref: "#/parameters/ImageSizes"
- $ref: "#/parameters/Page"
- $ref: "#/parameters/PageSize"
responses:
400:
$ref: "#/responses/GenericError"
200:
$ref: "#/responses/WorksResponse"
/me/viewed_works.json:
get:
parameters:
- $ref: "#/parameters/ImageSizes"
- $ref: "#/parameters/Page"
- $ref: "#/parameters/PageSize"
- $ref: "#/parameters/IncludeUserStats"
responses:
400:
$ref: "#/responses/GenericError"
200:
$ref: "#/responses/WorksResponse"
post:
parameters:
- name: ids
type: array
items:
type: string
collectionFormat: csv
in: formData
responses:
400:
$ref: "#/responses/GenericError"
200:
$ref: "#/responses/GenericResponse"
/me/viewed_novels.json:
get:
parameters:
- $ref: "#/parameters/Page"
- $ref: "#/parameters/PageSize"
- $ref: "#/parameters/IncludeUserStats"
- name: include_marker
type: integer
enum: [0, 1]
in: query
- name: include_series
type: integer
enum: [0, 1]
in: query
responses:
400:
$ref: "#/responses/GenericError"
200:
$ref: "#/responses/WorksResponse"
post:
parameters:
- name: ids
type: array
items:
type: string
collectionFormat: csv
in: formData
responses:
400:
$ref: "#/responses/GenericError"
200:
$ref: "#/responses/GenericResponse"
/me/works.json:
get:
description: "Return list of your works (paginated)"
parameters: