https://github.com/maple3142/pixiv-client
Pixiv api client for node.js written in typescript.
https://github.com/maple3142/pixiv-client
api client pixiv
Last synced: 11 months ago
JSON representation
Pixiv api client for node.js written in typescript.
- Host: GitHub
- URL: https://github.com/maple3142/pixiv-client
- Owner: maple3142
- License: mit
- Created: 2018-11-14T14:37:33.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2020-02-22T10:41:18.000Z (about 6 years ago)
- Last Synced: 2025-06-06T23:08:14.005Z (11 months ago)
- Topics: api, client, pixiv
- Language: TypeScript
- Homepage:
- Size: 48.8 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pixiv-client
> Pixiv api client for node.js written in typescript.
## Example
```js
// ES6:
import { PixivDesktopApi, PixivMobileApi, downloadAsStream } from 'pixiv-client'
// Commomjs:
const { PixivDesktopApi, PixivMobileApi, downloadAsStream } = require('pixiv-client')
;(async () => {
// Desktop api examples
const dc = await PixivDesktopApi.create() // no after-login function in PixivDesktopApi
const r = await dc.getIllustData(70337017)
downloadAsStream(r.urls.original).pipe(fs.createWriteStream(__dirname + '/test.png')) // or `await downloadToLocal(r.urls.original, __dirname + '/test.png')`
console.log(await dc.getUserProfileData(5323203))
// Mobile api examples
const mc = await PixivMobileApi.login({
username: 'USERNAME',
password: 'PASSWORD'
})
console.log(await mc.getRanking('day'))
console.log((await mc.getUserBookmarks(mc.oauth.info.user.id)).illusts)
// Working with async iterator
const ar = []
const result = await c.searchIllusts('ノゾミ(プリコネ)', {
searchTarget: 'exact_match_for_tags'
})
for await (const r of c.makeIterable(result)){
ar.push(...r.illusts)
}
console.log(ar.length)
})()
```
## Documentation
* [index](src/index.ts)
* [desktop api](src/desktop/index.ts)
* [mobile api](src/mobile/index.ts)