JSPM

  • Created
  • Published
  • Downloads 106
  • Score
    100M100P100Q91832F
  • License MIT

Promise based Pixiv API client for browser, react native and node.js

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

Build Status

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 username
  • password - 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 id
  • query - object (optional)

pixiv.userIllusts(id, query)

  • id - Pixiv illust id
  • query - object (optional)

pixiv.userBookmarksIllust(id, query)

  • id - Pixiv illust id
  • query - object (optional)
    • restrict - one of public | private

pixiv.illustBookmarkDetail(id, query)

require auth

  • id - Pixiv illust id
  • query - object (optional)

pixiv.illustComments(id, query)

  • id - Pixiv illust id
  • query - object (optional)

pixiv.illustRelated(id, query)

  • id - Pixiv illust id
  • query - object (optional)

pixiv.illustDetail(id, query)

  • id - Pixiv illust id
  • query - object (optional)

pixiv.illustFollow(query)

require auth

  • query - object (optional)
    • restrict - one of public | 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 - object
    • restrict: one of public | 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