# pixiv-api-client-zzh1234567

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

Latest version **0.16.0** (published 2017-10-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install pixiv-api-client-zzh1234567
pnpm add pixiv-api-client-zzh1234567
yarn add pixiv-api-client-zzh1234567
bun add pixiv-api-client-zzh1234567
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.16.0 |
| Published | 2017-10-27 |
| First published | 2017-10-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=4 |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+25 in 1 direct dependencies) |
| Install scripts | no |
| Author | alphasp |
| Maintainers | zzh1234567 |
| Keywords | pixiv, pixiv-api, pixiv-api-client-zzh1234567, api-client |

## Links

- npm: https://www.npmjs.com/package/pixiv-api-client-zzh1234567
- Repository: https://github.com/alphasp/pixiv-api-client-zzh1234567
- Homepage: https://github.com/alphasp/pixiv-api-client-zzh1234567#readme
- Issues: https://github.com/alphasp/pixiv-api-client-zzh1234567/issues
- npm.io page: https://npm.io/package/pixiv-api-client-zzh1234567

## Dependencies (2)

- [qs](https://npm.io/package/qs.md) ^6.2.1
- [axios](https://npm.io/package/axios.md) ^0.14.0

## Recent versions

- 0.16.0 (latest) — 2017-10-27

## README

# Pixiv API Client
[![Build Status](https://travis-ci.org/zzh1234567/pixiv-api-client-zzh1234567.svg?branch=master)](https://travis-ci.org/zzh1234567/pixiv-api-client-zzh1234567)
[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier)

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


## Install

```
$ npm install pixiv-api-client-zzh1234567 --save 
```

## Usage

```js
const PixivApi = require('pixiv-api-client-zzh1234567');
const pixiv = new PixivApi();

const word = 'ラブライブ';
pixiv.login('username', 'password').then(() => {
  return pixiv.searchIllust(word).then(json => {
	console.log(json);
	return pixiv.requestUrl(json.next_url);
  }).then(json => {
	console.log(json); //next results
  });
});
```

## API

### PixivApi()
<hr>

#### pixiv.login(username, password, rememberPassword)
Api client will try once to relogin again on error if rememberPassword is set to `true`

- `username` - Pixiv username
- `password` - Pixiv password
- `rememberPassword` - Boolean (default: `true`)

#### pixiv.logout()

#### pixiv.refreshAccessToken(refreshToken)
Refresh access token with refreshToken

- `refreshToken` - string (if not provided, will use refresh token that stored with api client after login)

#### pixiv.createProvisionalAccount(nickName)

- `nickName` - string

#### pixiv.userState()
require auth

#### pixiv.editUserAccount(fields)
require auth

- `fields` - object
  - pixivId
  - email
  - currentPassword
  - newPassword

#### pixiv.sendAccountVerificationEmail()  
require auth

#### pixiv.searchIllust(word, options)
require auth

- `word` - word to search (required)
- `options` - object (optional)
  - `search_target`: `partial_match_for_tags` | `exact_match_for_tags` | `title_and_caption` (default: `partial_match_for_tags`)
  - `sort`: `date_desc` | `date_asc` (default: `date_desc`)
  - `duration`: `within_last_day` | `within_last_week` | `within_last_month`

#### pixiv.searchUser(word)
require auth

- `word` - word to search (required)

#### pixiv.searchAutoComplete(word)
require auth

- `word` - word to search (required)

#### pixiv.userDetail(userId, options)
- `userId` - Pixiv user id
- `options` - object (optional)

#### pixiv.userIllusts(id, options) 
require auth

- `id` - Pixiv illust id
- `options` - object (optional)
  - `type` - one of `illust` | `manga`

#### pixiv.userBookmarksIllust(id, options)
require auth

- `id` - Pixiv illust id
- `options` - object (optional)
  - `restrict` - one of `public` | `private` (default: `public`)

#### pixiv.userBookmarkIllustTags(options)
require auth

- `options` - object (optional)
  - `restrict` - one of `public` | `private` (default: `public`)

#### pixiv.illustBookmarkDetail(id, options)
require auth

- `id` - Pixiv illust id
- `options` - object (optional)

#### pixiv.illustComments(id, options)
require auth

- `id` - Pixiv illust id
- `options` - object (optional)

#### pixiv.illustRelated(id, options)
require auth

- `id` - Pixiv illust id
- `options` - object (optional)

#### pixiv.illustDetail(id, options)
require auth

- `id` - Pixiv illust id
- `options` - object (optional)

#### pixiv.illustNew(options)
require auth

- `options` - object (optional)
 
#### pixiv.illustFollow(options)
require auth

- `options` - object (optional)
  - `restrict` - one of `all` | `public` | `private`  (default: `all`)

#### pixiv.illustRecommended(options)
require auth

- `options` - object (optional)

#### pixiv.illustRecommendedPublic(options)
- `options` - object (optional)

#### pixiv.illustRanking(options)
require auth

- `options` - object
  - `date`: Date
  - `mode`: `day` | `week` | `month` | `day_male` | `day_female` | `week_original` | `week_rookie` | `day_r18` | `day_male_r18` | `day_female_r18` | `week_r18` | `week_r18g`| `day_manga` | `week_manga` | `month_manga` | `week_rookie_manga` | `day_r18_manga` | `week_r18_manga` | `week_r18g_manga` (default: `day`)

#### pixiv.illustMyPixiv()
require auth

#### pixiv.illustAddComment(id, comment)
require auth

- `id` - Pixiv illust id
- `comment` - string

#### pixiv.ugoiraMetaData(id)
require auth

- `id` - Pixiv illust(ugoira) id

#### pixiv.trendingTagsIllust(options)
require auth

- `options` - object (optional)

#### pixiv.bookmarkIllust(id, restrict, tags)
require auth

- `id` - Pixiv illust id
- `restrict` - one of `public` | `private` (default: `public`)
- `tags` - array of string (optional)

#### pixiv.unbookmarkIllust(id)
require auth

- `id` - Pixiv illust id

#### pixiv.mangaRecommended(options)
require auth

- `options` - object (optional)

#### pixiv.mangaNew(options)
require auth

- `options` - object (optional)

#### pixiv.searchNovel(word, options)
require auth

- `word` - word to search (required)
- `options` - object (optional)
  - `search_target`: `partial_match_for_tags` | `exact_match_for_tags` | `title_and_caption` (default: `partial_match_for_tags`)
  - `sort`: `date_desc` | `date_asc` (default: `date_desc`)
  - `duration`: `within_last_day` | `within_last_week` | `within_last_month`
 
#### pixiv.novelRecommended(options)
require auth

- `options` - object (optional)

#### pixiv.novelRecommendedPublic(options)
- `options` - object (optional)

#### pixiv.novelNew(options)
require auth

- `options` - object (optional)

#### pixiv.userRecommended(options)
require auth

- `options` - object (optional)

#### pixiv.userFollowing(id, options)
require auth

- `id` - Pixiv user id
- `options` - object (optional)
  - `restrict`: `public` | `private` (default: `public`)

#### pixiv.userFollower(id, options)
require auth

- `id` - Pixiv user id
- `options` - object (optional)

#### pixiv.userMyPixiv(id)
require auth

- `id` - Pixiv user id

#### pixiv.followUser(id, restrict)
require auth

- `id` - Pixiv user id
- `restrict` - one of `public` | `private` (default: `public`)

#### pixiv.unfollowUser(id)
require auth

- `id` - Pixiv user id

#### pixiv.setLanguage(lang)
set HTTP header Accept-Language for pixiv api request
 
- `lang` - HTTP header Accept-Language

#### pixiv.requestUrl(url, options)
can be use to request pixiv endpoint or use for traversing results by passing next_url from result of other api such as `pixiv.searchIllust`

- `options` - object (optional)


## Tests

Export pixiv username and password before running Tests.

```
$ export USER_NAME=Pixiv username
$ export PASSWORD=Pixiv password
$ npm test
```

## Related projects
[PxView](https://github.com/alphasp/pxview) - Android/iOS client for Pixiv built in react-native

## License

MIT

---
_Source: https://npm.io/package/pixiv-api-client-zzh1234567 · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
