This repository has been archived by the owner on Mar 3, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
New API List
Chun-Hao Lien edited this page Sep 30, 2018
·
17 revisions
Welcome to use these API in your script or help me to enhance and complete this wiki
- Pre-define Struct
- getUserData
- getUserIllustsData
- getUserProfileData
- getUserBookmarkTagsData
- getUserBookmarkData
- getIllustBookmarkData
- getIllustData
- getIllustUgoiraMeta
- postIllustLike
- postAddBookmark
- postRPCDeleteBookmark / postRPCAddBookmark
// return status code: 2xx
{
error: false,
message: "",
body: null || [] || {...}
}
// Be careful, even error is false but body is null or empty array...
// We call this situation following: NullBodyResponse
// return status code: 4xx
{
error: true,
message: String, // non-empty string
body: []
}
Return a script string that will call document.write
Return a string that is integer number greater than 0
Return a string that contains no space
{
id: IdString,
title: String,
illustType: Number, // One of [0 ⇒ illust, 1 ⇒ manga, 2 ⇒ ugoira]
xRestrict: Number, // One of [0 ⇒ General, 1 ⇒ R-18, 2 ⇒ R-18G]
url: URLString,
tags: TagString[],
userId: IdString,
width: Number,
height: Number,
pageCount: Number,
isBookmarkable: Boolean,
bookmarkData: null || {
id: IdString,
private: Boolean,
},
}
{
tag: TagString,
locked: Boolean,
deletable: Boolean,
userId: IdString,
romaji: String,
translation?: {
en: String,
},
userName: String,
}
{
type: String, // One of ['fanbox', 'comikeWebCatalog', ???]
title: String,
url: URLString,
description: String,
imageUrl: URLString,
}
- url:
/ajax/user/:user_id
- method:
GET
{
error: Boolean,
message: String,
body: {
userId: IdString,
name: String,
image: URLString,
imageBig: URLString,
premium: Boolean,
isFollowed: Boolean,
background: null || {
repeat: String, // One of ["repeat-y", "repeat", "no-repeat"]
color: null || ColorHexString, // [A-Z0-9]{6}
url: URLString,
},
partial: Number,
},
}
- url:
/ajax/user/:user_id/illusts
- method:
GET
- param:
?ids[]={{illust_id[0]}}&ids[]={{illust_id[1]}}&...
- limit≧65
- Has NullBodyResponse:
[]
{
error: Boolean,
message: String,
body: {
...
[illustId]: { isMuted: Boolean } extends BasicIllustData,
},
}
- url:
/ajax/user/:user_id/profile/all
- method:
GET
- Has NullBodyResponse:
null
{
error: Boolean,
message: String,
body: {
illusts: {
...
[illustId]: BasicIllustData,
}
manga: {
...
[illustId]: BasicIllustData,
},
novels: [], // ???
mangaSeries: [] || {
...
[mangaSeriesId]: {
id: IdString,
title: String,
total: String, // but String of Number. why... pixiv why...
url: URLString,
updateDate: DateString, // format: "yyyy-mm-dd HH:MM:SS"
},
}
pickup: PickupableData[],
bookmarkCount: {
public: {
illust: Number,
novel: Number
},
private: {
illust: Number,
novel: Number
}
},
zoneConfig: {
header: DynamicHTMLScriptURL,
footer: DynamicHTMLScriptURL,
logo: DynamicHTMLScriptURL,
},
},
}
- url:
/ajax/user/:user_id/illusts/bookmark/tags
- method:
GET
{
error: Boolean,
message: String,
body: {
public: ({
tag: String,
cnt: String, // String of Number... why........
})[],
private: ({
tag: String,
cnt: String,
})[],
tooManyBookmark: Boolean, // ???
},
}
- url:
/ajax/user/:user_id/illusts/bookmarks
- method:
GET
- param:
?limit=&offset=&rest=&tag=
- offset, limit: fetch count of
limit
data fromoffset
- rest:
show
as public,hide
as private - tag: TagString join with
,
- offset, limit: fetch count of
- Has NullBodyResponse:
null
{
error: Boolean,
message: String,
body: {
works: ({ profileImgUrl: URLString } extends BasicIllustData)[],
total: Number,
},
}
- url:
/ajax/illust/:illust_id/bookmarkData
- method:
GET
{
error: Boolean,
message: String,
body: {
illustId: IdString,
isBookmarkable: Boolean,
bookmarkData: null || {
id: IdString,
private: Boolean,
},
},
}
- url:
/ajax/illust/:illust_id
- method:
GET
{
error: Boolean,
message: String,
body: {
illustId: IdString,
illustTitle: String,
illustComment: String,
id: IdString, // the same as illustId
title: String, // the same as illustTitle
description: String, // the same as illustComment
illustType: Number, // One of [0 ⇒ illust, 1 ⇒ manga, 2 ⇒ ugoira]
createDate: DateString, // format: "yyyy-mm-ddTHH:MM:SS+00:00" (like Date.prototypr.toISOString but no Z)
uploadDate: DateString,
restrict: Number, // ???
xRestrict: Number, // One of [0 ⇒ General, 1 ⇒ R-18, 2 ⇒ R-18G]
urls: {
mini: URLString,
thumb: URLString,
small: URLString,
regular: URLString,
original: URLString,
},
tags: {
authorId: IdString,
isLocked: Boolean,
tags: TagDetailData[],
writable: Boolean
},
storableTags: HashString[],
userId: IdString,
userName: String,
userAccount: String,
userIllusts: {
...
[illustId]: null || BasicIllustData,
},
likeData: Boolean, // Do you like this illust today
likeCount: Number,
width: Number,
height: Number,
pageCount: Number,
bookmarkCount: Number,
commentCount: Number,
responseCount: Number,
viewCount: Number,
isHowto: Boolean,
isOriginal: Boolean,
imageResponseOutData: [],
imageResponseData: [],
imageResponseCount: Number,
pollData: null, // ???
seriesNavData: null || {
seriesType: String, // One of ["manga", ???]
seriesId: IdString,
title: String,
order: Number,
prev: {
id: IdString,
title: String,
order: Number,
},
next: {
id: IdString,
title: String,
order: Number,
},
},
descriptionBoothId: null, // ???
comicPromotion: null, // ???
contestBanners: [], // ???
factoryGoods: {
integratable: Boolean,
integrated: Boolean,
},
isBookmarkable: Boolean,
bookmarkData: {
id: IdString,
private: Boolean,
},
zoneConfig: {
responsive: {
url: DynamicHTMLScriptURL
},
"300x250": {
url: DynamicHTMLScriptURL
},
"500x500": {
url: DynamicHTMLScriptURL
},
header: {
url: DynamicHTMLScriptURL
},
footer: {
url: DynamicHTMLScriptURL
},
logo: {
url: DynamicHTMLScriptURL
},
},
},
}
- url:
/ajax/illust/:illust_id/ugoira_meta
- method:
GET
{
error: Boolean,
message: String,
body: {
src: URLString,
originalSrc: URLString,
mime_type: MIMEString, // One of ["image/jpeg", ???]
frames: ({ file: ImageFileString, delay: Number })[],
},
}
ref: Pixiv Auto Like
-
url:
/ajax/illusts/like
-
method:
POST
-
headers:
- Content-Type: application/json
- x-csrf-token: globalInitData.token
-
credentials: same-origin // with cookie
-
body:
JSON.stringify
following object{ "illust_id": IdString, }
{
error: Boolean,
message: String,
body: {
is_liked: Boolean,
},
}
-
url:
/ajax/illusts/bookmarks/add
-
method:
POST
-
headers:
- Content-Type: application/json
- x-csrf-token: globalInitData.token
-
credentials: same-origin // with cookie
-
body:
JSON.stringify
following object{ "comment": String, "illust_id": IdString, "restrict": Number, // 0 ⇒ public, 1 ⇒ private "tags": TagString[], }
{
error: Boolean,
message: String,
body: {
last_bookmark_id: IdString,
stacc_status_id: IdString,
},
}
These are NOT new API but used in Patchouli.
ref: Pixiv 一鍵收藏 EX
-
url:
/rpc/index.php
-
method:
POST
-
headers:
- Content-Type: application/x-www-form-urlencoded
-
credentials: same-origin // with cookie
-
body:
- delete: following parameter concat as
application/x-www-form-urlencoded
format
parameter value mode "delete_illust_bookmark" bookmark_id IdString - add: following parameter concat as
application/x-www-form-urlencoded
format
parameter value mode "save_illust_bookmark" illust_id IdString restrict 0 (public) or 1 (private) comment String tags TagString[].join(',') tt login token - delete: following parameter concat as
{
error: Boolean,
message: String,
body: [],
}