Package Exports
- pixiv-api-client
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (pixiv-api-client) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Pixiv API Client
Promise based Pixiv API client for node.js and react native
Install
$ npm install pixiv-api-client --save
Usage
const PixivApi = require('pixiv-api-client');
const pixiv = new PixivApi('username', 'password');
const word = 'ラブライブ';
//login and call api that require login
pixiv.login().then(() => {
pixiv.illustFollow().then(json => {
console.log(json);
return json;
});
});
//search illusts
pixiv.searchIllust(word).then(json => {
console.log(json);
return json;
});
API
PixivApi(username, password)
username and password is optional, able to access public api without login
username
- Pixiv usernamepassword
- Pixiv password
pixiv.login()
pixiv.searchIllust(word, query)
word
- word to search (required)query
- object (optional)search_target
:partial_match_for_tags
|exact_match_for_tags
|title_and_caption
sort
:date_desc
|date_asc
(default:date_desc
)duration
:within_last_day
|within_last_week
|within_last_month
pixiv.userDetail(userId, query)
userId
- Pixiv user idquery
- object (optional)
pixiv.userIllusts(id, query)
id
- Pixiv illust idquery
- object (optional)
pixiv.userBookmarksIllust(id, query)
id
- Pixiv illust idquery
- object (optional)restrict
- one ofpublic
|private
pixiv.illustBookmarkDetail(id, query)
require auth
id
- Pixiv illust idquery
- object (optional)
pixiv.illustComments(id, query)
id
- Pixiv illust idquery
- object (optional)
pixiv.illustRelated(id, query)
id
- Pixiv illust idquery
- object (optional)
pixiv.illustDetail(id, query)
id
- Pixiv illust idquery
- object (optional)
pixiv.illustFollow(query)
require auth
query
- object (optional)restrict
- one ofpublic
|private
pixiv.illustRecommended(query)
query
- object (optional)
pixiv.illustRanking(query)
mode day_r18
| day_male_r18
| day_female_r18
| week_r18
| week_r18g
require auth
query
- objectrestrict
: one ofpublic
|private
date
:2016-08-15
mode
:day
|week
|month
|day_male
|day_female
|week_original
|week_rookie
|day_mang
|day_r18
|day_male_r18
|day_female_r18
|week_r18
|week_r18g
(default:day
)
pixiv.illustRanking(query)
query
- object (optional)
pixiv.trendingTagsIllust(query)
query
- object (optional)
pixiv.bookmarkIllust(id)
require auth
id
- Pixiv illust id
pixiv.unbookmarkIllust(id)
require auth
id
- Pixiv illust id
pixiv.mangaRecommended(query)
query
- object (optional)
pixiv.novelRecommended(query)
require auth
query
- object (optional)
Tests
Export pixiv username and password before running Tests.
$ export USERNAME=Pixiv username
$ export PASSWORD=Pixiv password
$ npm test
License
MIT