# pixiv.js

> pixiv API Client, Support public-api && app-api

Latest version **0.18.0** (published 2016-09-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install pixiv.js
pnpm add pixiv.js
yarn add pixiv.js
bun add pixiv.js
```

## 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.18.0 |
| Published | 2016-09-03 |
| First published | 2016-03-31 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 8 |
| Author | akameco |
| Maintainers | akameco |
| Keywords | pixiv, download, image, client, illust |

## Links

- npm: https://www.npmjs.com/package/pixiv.js
- Repository: https://github.com/akameco/pixiv.js
- Homepage: https://github.com/akameco/pixiv.js#readme
- Issues: https://github.com/akameco/pixiv.js/issues
- npm.io page: https://npm.io/package/pixiv.js

## Dependencies (2)

- [got](https://npm.io/package/got.md) ^6.2.0
- [pixiv-auth-got](https://npm.io/package/pixiv-auth-got.md) ^0.1.0

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 0.18.0 (latest) — 2016-09-03
- 0.17.2 — 2016-08-09
- 0.17.1 — 2016-08-09
- 0.17.0 — 2016-08-08
- 0.16.0 — 2016-08-06
- 0.15.0 — 2016-08-05
- 0.14.0 — 2016-08-05
- 0.13.0 — 2016-07-18
- 0.12.0 — 2016-07-08
- 0.11.0 — 2016-04-05
- 0.10.0 — 2016-04-03
- 0.9.0 — 2016-04-03
- 0.8.0 — 2016-04-03
- 0.7.0 — 2016-04-03
- 0.6.1 — 2016-04-02
- … 12 more at https://npm.io/package/pixiv.js/versions

## README

# pixiv.js [![Build Status](https://travis-ci.org/akameco/pixiv.svg?branch=master)](https://travis-ci.org/akameco/pixiv)

> pixiv API client

Support Public API.

**This module is deprecated, use [pixiv-app-api](https://github.com/akameco/pixiv-app-api).**

## Install

```
$ npm install --save pixiv.js
```

## Usage

```js
pixiv.users(471355).then(res => {
	console.log(res.response[0].name);
	// => 嵐月
});
```

If you want to downloading image, you can use with [pixiv-img](https://github.com/akameco/pixiv-img).

```
$ npm install --save pixiv-img
```

```js
const Pixiv = require('pixiv.js');
const pixivImg = require('pixiv-img');

const pixiv = new Pixiv('your username...', 'your password...');

pixiv.search('艦これ10000users入り', {mode: 'tag'})
	.then(json => {
		const work = json.response[0];
		console.log(`downloading... ${work.title} by ${work.user.name} `);
		return pixivImg(work.image_urls.large);
	}).then(() => console.log('finish!'))
	.catch(console.log);

// => downloading... 鹿島風さん by ぺこ
// => finish!
```

See examples.

## API

*public api*

### Pixiv(username, password)

#### username

*Required*<br>
Type: `string`

your pixiv username.

#### password

*Required*<br>
Type: `string`

your pixiv password.

### `pixiv.works(illustId)`
### `pixiv.users(userId)`
### `pixiv.feeds([options])`
### `pixiv.favoriteWorks([options])`
### `pixiv.addFavoriteWorks(illustId, [options])`
### `pixiv.removeFavoriteWorks(illustIds, [options])`
### `pixiv.followingWorks([options])`
### `pixiv.following([options])`
### `pixiv.follow(userId, [options])`
### `pixiv.unfollow(userIds, [options])`
### `pixiv.usersWorks(userId, [options])`
### `pixiv.usersFavoriteWorks(userid, [options])`
### `pixiv.usersFeeds(userid, [options])`
### `pixiv.usersFollowing(userid, [options])`
### `pixiv.ranking(rankingType, [options])`
### `pixiv.search(searchWord, [options])`
### `pixiv.latestWorks([options])`

#### userId
Type: `string`, `number`

#### illustId
Type: `string`, `number`

#### illustIds
Type: `Array<number>`

#### searchWord
Type: `string`<br>
query word

#### rankingType
Type: `string`<br>
Default: `all`<br>
Values: `all` `illust` `manga` `ugoira`

## Usage

### users

```js
pixiv.users(471355).then(res => {
	console.log(JSON.stringify(res.response[0], null, 2));
});
```

```json
{
  "id": 471355,
  "account": "creayus",
  "name": "嵐月",
  "is_following": true,
  "is_follower": null,
  "is_friend": null,
  "is_premium": false,
  "profile_image_urls": {
    "px_16x16": "http://i3.pixiv.net/img23/profile/creayus/7393018_ss.jpg",
    "px_50x50": "http://i3.pixiv.net/img23/profile/creayus/7393018_s.jpg"
  },
  "stats": null,
  "profile": null
}
```

### works

```js
pixiv.works(56099861).then(res => {
	console.log(JSON.stringify(res.response[0], null, 2));
});
```

```json
{
  "id": 56099861,
  "title": "春の到来",
  "caption": "🌸･ﾟ･:｡(*＞ω＜*)｡:*･ﾟ🌸",
  "tags": [
    "VOCALOID",
    "初音ミク",
    "ふつくしい",
    "春は來る",
    "VOCALOID1000users入り"
  ],
  "tools": [],
  "image_urls": {
    "px_128x128": "http://i2.pixiv.net/c/128x128/img-master/img/2016/03/31/00/15/16/56099861_p0_square1200.jpg",
    "px_480mw": "http://i2.pixiv.net/c/480x960/img-master/img/2016/03/31/00/15/16/56099861_p0_master1200.jpg",
    "small": "http://i2.pixiv.net/c/150x150/img-master/img/2016/03/31/00/15/16/56099861_p0_master1200.jpg",
    "medium": "http://i2.pixiv.net/c/600x600/img-master/img/2016/03/31/00/15/16/56099861_p0_master1200.jpg",
    "large": "http://i2.pixiv.net/img-original/img/2016/03/31/00/15/16/56099861_p0.png"
  },
  "width": 582,
  "height": 800,
  "stats": null,
  "publicity": 0,
  "age_limit": "all-age",
  "created_time": "2016-03-31 00:15:16",
  "reuploaded_time": "2016-03-31 00:15:16",
  "user": {
    "id": 1023317,
    "account": "taeyeop",
    "name": "gomzi",
    "is_following": false,
    "is_follower": false,
    "is_friend": false,
    "is_premium": null,
    "profile_image_urls": {
      "px_50x50": "http://i1.pixiv.net/img35/profile/taeyeop/9847127.png"
    },
    "stats": null,
    "profile": null
  },
  "is_manga": false,
  "is_liked": false,
  "favorite_id": 0,
  "page_count": 1,
  "book_style": "right_to_left",
  "type": "illustration",
  "metadata": null,
  "content_type": null
}
```


### search

```js
pixiv.search('艦これ1000users入り', {mode: 'tag'}).then(res => {
	console.log(JSON.stringify(res, null, 2));
});
```

## Tests

Export your pixiv username & password before running Tests.

```
export USERNAME=your pixiv username...
export PASSWORD=your pixiv password...
```

```
$ npm test
```


## Related

- [pixiv-app-api](https://github.com/akameco/pixiv-app-api) - save the image of pixiv
- [pixiv-img](https://github.com/akameco/pixiv-img) - save the image of pixiv
- [PixivDeck](https://github.com/akameco/PixivDeck) - pixiv client for Desktop like TweetDeck

## License

MIT

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