• Stars
    star
    218
  • Rank 181,805 (Top 4 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created over 8 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Promise base pixiv API client

pixiv-app-api

styled with prettier All Contributors

Promise based pixiv API client

Inspired by upbit/pixivpy: Pixiv API for Python.

Features

  • Promise based
  • Converts the output json keys to camelCase
  • Converts the parameters to snakeCase
  • Supports API without login

Install

$ npm install --save pixiv-app-api

Usage

import PixivAppApi from 'pixiv-app-api' //const PixivAppApi = require("pixiv-app-api")
import pixivImg from 'pixiv-img' //const pixivImg = require("pixiv-img")
const pixiv = new PixivAppApi(process.env.NAME, process.env.PASSWORD, {
  camelcaseKeys: true,
})

;(async () => {
  await pixiv.login()
  const json = await pixiv.searchIllust('่‰ฆใ“ใ‚Œ10000usersๅ…ฅใ‚Š')
  await pixivImg(json.illusts[0].imageUrls.large)
  console.log('finish')
})()

Typescript

All functions will return either a camelCaseType or a snake_case_type depending on the value of camelcaseKeys. For example:

//const pixiv = new PixivAppApi(process.env.NAME, process.env.PASSWORD, {camelcaseKeys: true})
interface PixivClient = {
  accessToken: string
  expiresIn: number
  tokenType: string
  scope: string
  refreshToken: string
  user: PixivClientUser
  deviceToken: string
}

//const pixiv = new PixivAppApi(process.env.NAME, process.env.PASSWORD, {camelcaseKeys: false})
interface Pixiv_Client = {
  access_token: string
  expires_in: number
  token_type: string
  scope: string
  refresh_token: string
  user: Pixiv_Client_User
  device_token: string
}

API

constructor(username?: string, password?: string, options? {camelcaseKeys?: boolean})

Creates a new PixivAppApi object. camelcaseKeys defaults to true if it is omitted.

login(username?: string, password?: string): Promise<PixivClient>

Logs into the API.

{
  "accessToken": "abcdefgabcdefgabcdefgabcdefg",
  "expiresIn": 3600,
  "tokenType": "bearer",
  "scope": "unlimited",
  "refreshToken": "abcdefgabcdefgabcdefgabcdefg",
  "user": {
    "profileImageUrls": {
      "px16x16": "https://i.pximg.net/user-profile/img/2016/12/07/18/45/34/11842543_d51209fed2b2566336b1296e07f49b81_16.png",
      "px50x50": "https://i.pximg.net/user-profile/img/2016/12/07/18/45/34/11842543_d51209fed2b2566336b1296e07f49b81_50.png",
      "px170x170": "https://i.pximg.net/user-profile/img/2016/12/07/18/45/34/11842543_d51209fed2b2566336b1296e07f49b81_170.png"
    },
    "id": "19785907",
    "name": "akameco",
    "account": "akameco",
    "mailAddress": "abcdefgabcdefgabcdefgabcdefg",
    "isPremium": true,
    "xRestrict": 2,
    "isMailAuthorized": true
  }
}

authInfo(): PixivClient

Gets your authInfo.

interface PixivClient {
  accessToken: string
  expiresIn: number
  tokenType: string
  scope: string
  refreshToken: string
  user: PixivClientUser
  deviceToken: string
}

makeIterable(resp: Object): AsyncIterable<Object>

const json = await pixiv.searchIllust('่‰ฆใ“ใ‚Œ10000usersๅ…ฅใ‚Š')
let ar = []
for await (const r of pixiv.makeIterable(json)) {
  ar = ar.concat(r.illusts)
  await sleep(1000) // if the request rate is too high, pixiv might ban you
}
console.log(ar.length)

userDetail(id: ID, params?: PixivParams): Promise<PixivUserDetail>.

Get a user's profile.

export interface PixivUserDetail {
  user: PixivUser
  profile: {
    webpage: string
    gender: string
    birth: string
    birthDay: string
    birthYear: number
    region: string
    addressId: number
    countryCode: string
    job: string
    jobId: number
    totalFollowUsers: number
    totalMypixivUsers: number
    totalIllusts: number
    totalManga: number
    totalNovels: number
    totalIllustBookmarksPublic: number
    totalIllustSeries: number
    backgroundImageUrl: string
    twitterAccount: string
    twitterUrl: string
    pawooUrl: string
    isPremium: boolean
    isUsingCustomProfileImage: boolean
  }
  profilePublicity: {
    gender: string
    region: string
    birthDay: string
    birthYear: string
    job: string
    pawoo: boolean
  }
  workspace: {
    pc: string
    monitor: string
    tool: string
    scanner: string
    tablet: string
    mouse: string
    printer: string
    desktop: string
    music: string
    desk: string
    chair: string
    comment: string
    workspaceImageUrl: string | null
  }
}

The type PixivParams is defined as follows:

export interface PixivParams {
  userId?: number
  type?: string
  filter?: string
  restrict?: 'public' | 'private'
  illustId?: number
  contentType?: string
  includeTotalComments?: boolean
  includeRankingLabel?: boolean
  includeRankingIllusts?: boolean
  includeRankingNovels?: boolean
  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'
  word?: string
  searchTarget?:
    | 'partial_match_for_tags'
    | 'exact_match_for_tags'
    | 'title_and_caption'
  sort?: 'date_desc' | 'date_asc' | 'popular_desc'
  startDate?: string
  endDate?: string
  offset?: number
}

userIllusts(id: ID, params?: PixivParams): Promise<PixivIllustSearch>

Retrieves all of a users illusts.

export interface PixivIllustSearch {
  illusts: PixivIllust[]
  nextUrl: string | null
  searchSpanLimit?: number
}
{
  "illusts": [
    {
      "id": 64124918,
      "title": "Noise Pollution Vol.3",
      "type": "illust",
      "imageUrls": {
        "squareMedium": "https://i.pximg.net/c/360x360_70/img-master/img/2017/07/30/12/20/55/64124918_p0_square1200.jpg",
        "medium": "https://i.pximg.net/c/540x540_70/img-master/img/2017/07/30/12/20/55/64124918_p0_master1200.jpg",
        "large": "https://i.pximg.net/c/600x1200_90/img-master/img/2017/07/30/12/20/55/64124918_p0_master1200.jpg"
      },
      "caption": "ๅคใ‚ณใƒŸๆ–ฐๅˆŠใฎโ‘ก<br /><br />ๆฑใƒฌ54b-CREAYUS<br />Noise Pollution Vol.3ใซใฏไผšๅ ด้™ๅฎšA5ใ‚ตใ‚คใ‚บใฎใ‚ฏใƒชใ‚ขใƒ•ใ‚กใ‚คใƒซใŒใคใใพใ™ใ€‚๏ผ‘ๅ†Šใซใคใ๏ผ‘ๆžš๏ผˆๅ…ˆ็€๏ผ‰ใ€ใชใใชใ‚Šๆฌก็ฌฌ็ต‚ไบ†ใงใ™ใ€‚<br /><br />ใจใ‚‰ใฎใ‚ใชไบˆ็ด„(ใƒ•ใƒซใ‚ซใƒฉใƒผๅ…จๅนด้ฝข)<br /><a href=\"http://www.toranoana.jp/mailorder/article/04/0030/54/88/040030548805.html?rec=circle\" target=\"_blank\">http://www.toranoana.jp/mailorder/article/04/0030/54/88/040030548805.html?rec=circle</a>",
      "restrict": 0,
      "user": {
        "id": 471355,
        "name": "ๅตๆœˆ",
        "account": "creayus",
        "profileImageUrls": {
          "medium": "https://i3.pixiv.net/user-profile/img/2014/02/02/00/05/39/7393018_f1ce44676a8c0d902cc49aad2828e510_170.jpg"
        },
        "isFollowed": true
      },
      "tags": [
        {
          "name": "C.C."
        },
        {
          "name": "ใƒซใƒซใƒผใ‚ทใƒฅ"
        },
        {
          "name": "ใƒซใƒซC"
        },
        {
          "name": "ใ‚ณใƒผใƒ‰ใ‚ฎใ‚ขใ‚น"
        },
        {
          "name": "ใ‚ณใƒผใƒ‰ใ‚ฎใ‚ขใ‚น1000usersๅ…ฅใ‚Š"
        },
        {
          "name": "ใƒซใƒซใƒผใ‚ทใƒฅใƒปใƒฉใƒณใƒšใƒซใƒผใ‚ธ"
        }
      ],
      "tools": ["Photoshop", "SAI"],
      "createDate": "2017-07-30T12:20:55+09:00",
      "pageCount": 5,
      "width": 900,
      "height": 633,
      "sanityLevel": 4,
      "metaSinglePage": {},
      "metaPages": [
        {
          "imageUrls": {
            "squareMedium": "https://i.pximg.net/c/360x360_70/img-master/img/2017/07/30/12/20/55/64124918_p0_square1200.jpg",
            "medium": "https://i.pximg.net/c/540x540_70/img-master/img/2017/07/30/12/20/55/64124918_p0_master1200.jpg",
            "large": "https://i.pximg.net/c/600x1200_90/img-master/img/2017/07/30/12/20/55/64124918_p0_master1200.jpg",
            "original": "https://i.pximg.net/img-original/img/2017/07/30/12/20/55/64124918_p0.png"
          }
        },
        {
          "imageUrls": {
            "squareMedium": "https://i.pximg.net/c/360x360_70/img-master/img/2017/07/30/12/20/55/64124918_p1_square1200.jpg",
            "medium": "https://i.pximg.net/c/540x540_70/img-master/img/2017/07/30/12/20/55/64124918_p1_master1200.jpg",
            "large": "https://i.pximg.net/c/600x1200_90/img-master/img/2017/07/30/12/20/55/64124918_p1_master1200.jpg",
            "original": "https://i.pximg.net/img-original/img/2017/07/30/12/20/55/64124918_p1.png"
          }
        },
        {
          "imageUrls": {
            "squareMedium": "https://i.pximg.net/c/360x360_70/img-master/img/2017/07/30/12/20/55/64124918_p2_square1200.jpg",
            "medium": "https://i.pximg.net/c/540x540_70/img-master/img/2017/07/30/12/20/55/64124918_p2_master1200.jpg",
            "large": "https://i.pximg.net/c/600x1200_90/img-master/img/2017/07/30/12/20/55/64124918_p2_master1200.jpg",
            "original": "https://i.pximg.net/img-original/img/2017/07/30/12/20/55/64124918_p2.png"
          }
        },
        {
          "imageUrls": {
            "squareMedium": "https://i.pximg.net/c/360x360_70/img-master/img/2017/07/30/12/20/55/64124918_p3_square1200.jpg",
            "medium": "https://i.pximg.net/c/540x540_70/img-master/img/2017/07/30/12/20/55/64124918_p3_master1200.jpg",
            "large": "https://i.pximg.net/c/600x1200_90/img-master/img/2017/07/30/12/20/55/64124918_p3_master1200.jpg",
            "original": "https://i.pximg.net/img-original/img/2017/07/30/12/20/55/64124918_p3.png"
          }
        },
        {
          "imageUrls": {
            "squareMedium": "https://i.pximg.net/c/360x360_70/img-master/img/2017/07/30/12/20/55/64124918_p4_square1200.jpg",
            "medium": "https://i.pximg.net/c/540x540_70/img-master/img/2017/07/30/12/20/55/64124918_p4_master1200.jpg",
            "large": "https://i.pximg.net/c/600x1200_90/img-master/img/2017/07/30/12/20/55/64124918_p4_master1200.jpg",
            "original": "https://i.pximg.net/img-original/img/2017/07/30/12/20/55/64124918_p4.png"
          }
        }
      ],
      "totalView": 45180,
      "totalBookmarks": 2358,
      "isBookmarked": false,
      "visible": true,
      "isMuted": false,
      "totalComments": 33
    }
  ],
  "nextUrl": "https://app-api.pixiv.net/v1/user/illusts?user_id=471355&type=illust&filter=for_ios&offset=40"
}

userFollowAdd(id: ID, data?: Object): Promise<unknown>

Follows a user.

userFollowDelete(id: ID, data?: Object): Promise<unknown>

Unfollows a user.

userBookmarksIllust(id: ID, params?: PixivParams): Promise<PixivIllustSearch>

Gets a user's bookmarked illusts.

userFollowing(id: ID, params?: PixivParams): Promise<PixivUserSearch>

Gets the users that a user is following.

export interface PixivUserSearch {
  userPreviews: {
    user: PixivUser
    illusts: PixivIllust[]
    novels: PixivNovel[]
    isMuted: boolean
  }[]
  nextUrl: string | null
}

userFollower(id: ID, params?: PixivParams): Promise<PixivUserSearch>

Gets the users who follow a user.

userMypixiv(id: ID, params?: PixivParams): Promise<PixivUserSearch>

Gets your friends on Mypixiv.

userList(id: ID, params?: PixivParams): Promise<unknown>

Gets a user list.

illustDetail(id: ID, params?: PixivParams): Promise<PixivIllustDetail>

Returns detailed info for a pixiv illust.

export interface PixivIllustDetail {
  illust: PixivIllust
}

export interface PixivIllust {
  id: number
  title: string
  interface: string
  imageUrls: {
    squareMedium: string
    medium: string
    large?: string
  }
  caption: string
  restrict: number
  user: PixivUser
  tags: PixivTag[]
  tools: string[]
  createDate: string
  pageCount: number
  width: number
  height: number
  sanityLevel: number
  metaSinglePage: {
    originalImageUrl?: string
  }
  metaPages: PixivMetaPage[]
  totalView: number
  totalBookmarks: number
  isBookmarked: boolean
  visible: boolean
  isMuted: boolean
  totalComments: number
}
{
  "illust": {
    "id": 57907953,
    "title": "ใƒญใƒณใ‚ฐใƒ˜ใ‚ขใƒฌใƒ ใ‚Šใ‚“",
    "type": "illust",
    "imageUrls": {
      "squareMedium": "https://i.pximg.net/c/360x360_70/img-master/img/2016/07/15/00/08/24/57907953_p0_square1200.jpg",
      "medium": "https://i.pximg.net/c/540x540_70/img-master/img/2016/07/15/00/08/24/57907953_p0_master1200.jpg",
      "large": "https://i.pximg.net/c/600x1200_90/img-master/img/2016/07/15/00/08/24/57907953_p0_master1200.jpg"
    },
    "caption": "ใƒ‡ใ‚คใƒชใƒผ32โ†’5 ใ‚ใ‚ŠใŒใจใ†ใ”ใ–ใ„ใพใ™๏ผ",
    "restrict": 0,
    "user": {
      "id": 3424578,
      "name": "ใ“ใƒผใ‚„ใต@ไธ‰ๆ—ฅ็›ฎๆฑใซ26b",
      "account": "burittohiroba",
      "profileImageUrls": {
        "medium": "https://i2.pixiv.net/user-profile/img/2017/02/07/16/03/00/12115481_03cc0ec0f2580ac4a12a3682929b485a_170.jpg"
      },
      "isFollowed": false
    },
    "tags": [
      {
        "name": "Re:ใ‚ผใƒญใ‹ใ‚‰ๅง‹ใ‚ใ‚‹็•ฐไธ–็•Œ็”Ÿๆดป"
      },
      {
        "name": "ใƒฌใƒ "
      },
      {
        "name": "ใƒชใ‚ผใƒญ"
      },
      {
        "name": "ใƒฌใƒ (ใƒชใ‚ผใƒญ)"
      },
      {
        "name": "ใƒŠใƒ„ใ‚ญใƒปใƒฌใƒ "
      },
      {
        "name": "ใƒชใ‚ผใƒญ10000usersๅ…ฅใ‚Š"
      },
      {
        "name": "ใ‚นใƒใƒฌใƒ "
      },
      {
        "name": "ใƒกใ‚คใƒ‰"
      },
      {
        "name": "ใƒญใƒณใ‚ฐๅŒ–"
      }
    ],
    "tools": [],
    "createDate": "2016-07-15T00:08:24+09:00",
    "pageCount": 1,
    "width": 1000,
    "height": 1412,
    "sanityLevel": 2,
    "metaSinglePage": {
      "originalImageUrl": "https://i.pximg.net/img-original/img/2016/07/15/00/08/24/57907953_p0.jpg"
    },
    "metaPages": [],
    "totalView": 191059,
    "totalBookmarks": 28918,
    "isBookmarked": false,
    "visible": true,
    "isMuted": false,
    "totalComments": 181
  }
}

illustNew(params?: PixivParams): Promise<PixivIllustSearch>

Searches new illusts.

illustFollow(params?: PixivParams): Promise<PixivIllustSearch>

Searches new illusts from users you follow.

{
  "illusts": [
    {
      "id": 64419500,
      "title": "ใ€PFRDใ€‘Chapter.6",
      "type": "illust",
      "imageUrls": {
        "squareMedium": "https://i.pximg.net/c/360x360_70/img-master/img/2017/08/15/00/16/32/64419500_p0_square1200.jpg",
        "medium": "https://i.pximg.net/c/540x540_70/img-master/img/2017/08/15/00/16/32/64419500_p0_master1200.jpg",
        "large": "https://i.pximg.net/c/600x1200_90/img-master/img/2017/08/15/00/16/32/64419500_p0_master1200.jpg"
      },
      "caption": "ๆณ•ๅฐ”ๅกๅฒ›.็ผ‡ๆ‹‰ๅฏ†ๆž—ๅธฆ <br />ๆŒกๅœจ้˜ฟๅฐ”ๅกๅจœ้ขๅ‰็š„ๆ•ฐไธชๅคๆดป่€…ๆฏไธชไธชไฝ“้ƒฝๅธฆ็€ไผค๏ผŒไปŽๆ‘†่ตท็š„ๆžถๅŠฟๆฅ็œ‹ไนŸไผผไนŽๆฏซๆ— ็ซ ๆณ•๏ผŒไฝ†ๅคฉ็”Ÿ็š„็›ด่ง‰ไพ็„ถๅฆ‚ๅŒ่ญฆ้“ƒ่ˆฌๆ€ฅไฟƒ็š„ๆ•ฒๆ‰“็€้˜ฟๅฐ”ๅกๅจœ็š„ๅฟƒใ€‚<br />โ€œๆˆ‘่ฟ™ๆ˜ฏๅœจ...ๅฎณๆ€•ไนˆ๏ผŸโ€œๆ„Ÿๅ—ๅˆฐๆกๅ‰‘็š„ๅณๆ‰‹ๅพฎๅพฎ้ขคๆŠ–๏ผŒ้˜ฟๅฐ”ๅกๅจœ่‡ชๅ˜ฒ็š„่ฝป็ฌ‘โ€ๅ‘ต..ๆˆ‘่ฟ˜ไปฅไธบๆˆ‘ๅทฒ็ปๅฟ˜ไบ†ๅฎณๆ€•ๆ˜ฏไป€ไนˆไบ†ๅ‘ขโ€ใ€‚<br /><br />ๆฅๅง๏ผŒไธ็ฎกใ€ไฝ ไปฌใ€‘ๆ˜ฏไป€ไนˆ๏ผŒๅ ‚ๅ ‚ๆญฃๆญฃ็š„ไธ€ๅ†ณ่ƒœ่ดŸๅง๏ผ",
      "restrict": 0,
      "user": {
        "id": 22124330,
        "name": "่ถ…ๅ‡ถใฎ็‹„็’ๅก",
        "account": "swd3e22",
        "profileImageUrls": {
          "medium": "https://i4.pixiv.net/user-profile/img/2017/01/10/13/28/42/11988991_bae951a38d31d217fa1eceedc0aafdbe_170.jpg"
        },
        "isFollowed": true
      },
      "tags": [
        {
          "name": "ๅฅณใฎๅญ"
        },
        {
          "name": "่ฝๆ›ธ"
        },
        {
          "name": "ใ‚ชใƒชใ‚ธใƒŠใƒซ"
        },
        {
          "name": "ใ‚ฐใƒฉใƒณใƒกใ‚คใƒซ"
        },
        {
          "name": "pixivใƒ•ใ‚กใƒณใ‚ฟใ‚ธใ‚ขRD"
        },
        {
          "name": "ไธๆ•—็Ž‹ใฎๅพฉๆดป"
        },
        {
          "name": "ๅพฉๆดป่€…่จŽไผๆˆฆใ€้’ใ€‘"
        }
      ],
      "tools": [],
      "createDate": "2017-08-15T00:16:32+09:00",
      "pageCount": 1,
      "width": 2126,
      "height": 1150,
      "sanityLevel": 4,
      "metaSinglePage": {
        "originalImageUrl": "https://i.pximg.net/img-original/img/2017/08/15/00/16/32/64419500_p0.jpg"
      },
      "metaPages": [],
      "totalView": 228,
      "totalBookmarks": 63,
      "isBookmarked": false,
      "visible": true,
      "isMuted": false
    }
  ],
  "nextUrl": "https://app-api.pixiv.net/v2/illust/follow?restrict=public&offset=30"
}

illustComments(id: ID, params?: PixivParams): Promise<PixivCommentSearch>

Returns the comments on an illust.

export interface PixivCommentSearch {
  totalComments: number
  comments: PixivComment[]
  nextUrl: string | null
}

illustRelated(id: ID, params?: PixivParams): Promise<PixivIllustSearch>

Searches for illusts related to the one provided.

illustRecommended(params?: PixivParams): Promise<PixivIllustSearch>

Returns recommended illusts.

illustRecommendedNologin(params?: PixivParams): Promise<PixivIllustSearch>

Returns recommended illusts (logged out).

illustRanking(params?: PixivParams): Promise<PixivIllustSearch>

Returns top daily illusts by default.

trendingTagsIllust(params?: PixivParams): Promise<PixivTrendTags>

Returns an array of trending tags.

export interface PixivTrendTags {
  trend_tags: PixivTag[]
}

searchIllust(word: Word, params?: PixivParams): Promise<PixivIllustSearch>

Searches for illusts with the provided query.

searchNovel(word: Word, params?: PixivParams): Promise<PixivNovelSearch>

Searches for novels with the provided query.

export interface PixivNovelSearch {
  novels: PixivNovel[]
  nextUrl: string | null
  privacyPolicy?: {}
  searchSpanLimit?: number
}

searchUser(word: Word, params?: PixivParams): Promise<PixivUserSearch>

Searches for users with the provided query.

searchAutoComplete(word: Word): Promise<PixivAutoComplete>

Returns an array of auto-completed words from the input.

export interface PixivAutoComplete {
  searchAutoCompleteKeywords: string[]
}

illustBookmarkDetail(id: ID, params?: PixivParams): Promise<PixivBookmarkDetail>

Returns detailed info on a bookmark.

export interface PixivBookmarkDetail {
  isBookmarked: boolean
  tags: PixivTag[]
  restrict: string
}
{
  "bookmarkDetail": {
    "isBookmarked": false,
    "tags": [
      {
        "name": "Re:ใ‚ผใƒญใ‹ใ‚‰ๅง‹ใ‚ใ‚‹็•ฐไธ–็•Œ็”Ÿๆดป",
        "isRegistered": false
      },
      {
        "name": "ใƒฌใƒ ",
        "isRegistered": false
      },
      {
        "name": "ใƒชใ‚ผใƒญ",
        "isRegistered": false
      },
      {
        "name": "ใƒฌใƒ (ใƒชใ‚ผใƒญ)",
        "isRegistered": false
      },
      {
        "name": "ใƒŠใƒ„ใ‚ญใƒปใƒฌใƒ ",
        "isRegistered": false
      },
      {
        "name": "ใƒชใ‚ผใƒญ10000usersๅ…ฅใ‚Š",
        "isRegistered": false
      },
      {
        "name": "ใ‚นใƒใƒฌใƒ ",
        "isRegistered": false
      },
      {
        "name": "ใƒกใ‚คใƒ‰",
        "isRegistered": false
      },
      {
        "name": "ใƒญใƒณใ‚ฐๅŒ–",
        "isRegistered": false
      }
    ],
    "restrict": "public"
  }
}

illustBookmarkAdd(id: ID, data?: Object): Promise<unknown>

Adds a new bookmark.

illustBookmarkDelete(id: ID, data?: Object): Promise<unknown>

Deletes a bookmark.

userBookmarkTagsIllust(params?: PixivParams): Promise<PixivBookmarkSearch>

Searches your bookmark tags.

export interface PixivBookmarkSearch {
  bookmarkTags: PixivTag[]
  nextUrl: string | null
}
{
  "bookmarkTags": [],
  "nextUrl": null
}

novelRecommended(params?: PixivParams): Promise<PixivNovelSearch>

Searches recommended novels.

mangaNew(params?: PixivParams): Promise<unknown>

Searches new manga.

mangaRecommended(params?: PixivParams): Promise<PixivMangaSearch>

Searches recommended manga.

export interface PixivMangaSearch {
  illusts: PixivManga[]
  rankingIllusts: PixivManga[] | []
  privacyPolicy: {}
  nextUrl: string | null
}

novelRecommendedNologin(params?: PixivParams): Promise<PixivNovelSearch>

Searches recommended novels (logged out).

novelNew(params?: PixivParams): Promise<PixivNovelSearch>

Searches new novels.

ugoiraMetaData(id: number, params?: PixivParams): Promise<UgoiraMetaData>

Retrieves the zip url and frames for a Pixiv Ugoira.

export interface UgoiraMetaData {
  ugoiraMetadata: {
    zipUrls: {
      medium: string
    }
    frames: {
      file: string
      delay: number
    }[]
  }
}

fetch(target: string, opts?: PixivFetchOptions): Promise<any>

Fetches a route in the Pixiv API and returns the result.

See Sniffer for iOS 6.x Common API ยท upbit/pixivpy Wiki

pixiv.next(): Promise<any>

Return next request result.

usage
pixiv
  .searchIllust(word)
  .then(() => pixiv.next())
  .then(() => pixiv.next())
  .then((json) => {
    console.log(json)
  })

pixiv.hasNext(): boolean

Return true if pixiv.next() is able to run.

usage
if (pixiv.hasNext()) {
  pixiv.next().then()
}

pixiv.nextQuery(): Promise<string | undefined>

Return next params parameter.

Tests

Export your pixiv username and password before running Tests.

$ export USERNAME=your pixiv username...
$ export PASSWORD=your pixiv password...
$ npm test

Related

Contributors

Thanks goes to these wonderful people (emoji key):


akameco

๐Ÿ’ป ๐Ÿ“– โš ๏ธ ๐Ÿš‡

Austin Huang

๐Ÿ’ป ๐Ÿ“–

Cake

๐Ÿ’ป โš ๏ธ

Ade Firman Fauzi

๐Ÿ’ป

yeti2018

๐Ÿ’ป

maple

๐Ÿ’ป

Tenpi

๐Ÿ’ป ๐Ÿ“–

yanagiragi

๐Ÿ’ป

NigridsVa

๐Ÿ’ป

Anton Grigoryev

๐Ÿ’ป

ใใ‚‰

๐Ÿ’ป

This project follows the all-contributors specification. Contributions of any kind welcome!

License

MIT ยฉ akameco

More Repositories

1

PixivDeck

๐Ÿ’• pixiv client for Desktop like TweetDeck ๐Ÿ’•
JavaScript
437
star
2

s2s

Coding time Compile. A tool to write code fastest.
JavaScript
263
star
3

babel-plugin-react-intl-auto

i18n for the component age. Auto management react-intl ID.
TypeScript
212
star
4

extract-react-intl-messages

extract react intl messages
TypeScript
184
star
5

styled-spinkit

Spinner Loading components
TypeScript
92
star
6

styled-style

css modules like styled-components
JavaScript
91
star
7

babel-plugin-react-data-testid

babel plugin for react data-testid attributes
TypeScript
30
star
8

yamada

๐Ÿพ best image viewer while at work.
JavaScript
29
star
9

electron-load-devtool

Easily load dev tool for electron
JavaScript
24
star
10

golangify

Golang like error handling for async/await and sync function.
JavaScript
21
star
11

eslint-config-precure

ESLint shareable config for precure
JavaScript
20
star
12

reducer-tester

Utilities for testing redux reducers
TypeScript
19
star
13

extract-react-intl

Extract react-intl messages
JavaScript
18
star
14

electron-referer

Referer control for Electron app.
JavaScript
17
star
15

prioritize-yarn

If the project has yarn.lock, change npm install to yarn.
JavaScript
16
star
16

redux-actions-type

easy typing of redux action
TypeScript
15
star
17

babel-preset-zero

babelrc for zero config
JavaScript
14
star
18

pixiv-dl

pixiv image downloader
JavaScript
12
star
19

akameco

akameco CLI
JavaScript
12
star
20

babel-plugin-twitter

import from tweeeeeeet!!!!!!!!!!!!!
JavaScript
12
star
21

electron-terminal-open

Open App from Command Line Interface for Electron
Shell
11
star
22

sana-voice

ใ•ใชใƒœใ‚ฟใƒณใ‹ใ‚‰ใƒฉใƒณใƒ€ใƒ ใซๅ†็”Ÿใ™ใ‚‹CLI
JavaScript
11
star
23

react-s3-uploader-sample

JavaScript
11
star
24

touch-alt

Create from a template instead of a new file
JavaScript
10
star
25

try-xss-electron

Electronใ‚ขใƒ—ใƒชใฎXSSใงrm -fr /ใ‚’ๅฎŸ่กŒใ™ใ‚‹
JavaScript
9
star
26

pixiv

pixiv api client
JavaScript
8
star
27

babel-plugin-jsx-target-blank

add 'noopener noreferrer' to external link for security
JavaScript
8
star
28

yaml-flat-loader

JavaScript
8
star
29

babel-plugin-react-remove-classname

babel plugin for remove classname
TypeScript
8
star
30

pixiv-tag-downloader

ใ‚ฟใ‚ฐๆคœ็ดขใซ็‰นๅŒ–ใ—ใŸCLIใฎpixivใฎ็”ปๅƒใƒ€ใ‚ฆใƒณใƒญใƒผใƒ€ใƒผ
JavaScript
7
star
31

create-babelrc

create .babelrc using package.json
JavaScript
7
star
32

readme-gen

README generator for node.js.
JavaScript
7
star
33

npm-popute

watch 'ใƒใƒ—ใƒ†ใƒ”ใƒ”ใƒƒใ‚ฏ' while running npm install
JavaScript
6
star
34

twada-stand

ใƒ†ใ‚นใƒˆใ‚’ๆ›ธใ„ใฆใชใ„ๆ›ธใ„ใฆใชใ„ไบบใฎๅ‰ใซไพ‹ใฎใ‚นใ‚ฟใƒณใƒ‰ใŒ็พใ‚Œใพใ™
JavaScript
6
star
35

pixiv-img

pixiv image downloader
JavaScript
6
star
36

kimi-no-na-ha

ๅ›ใฎๅใฏใ€‚
Shell
6
star
37

pixiv-dl-preview

pixivใ‚คใƒฉใ‚นใƒˆใƒ€ใ‚ฆใƒณใƒญใƒผใƒ€ใƒผ + ็”ปๅƒใƒ—ใƒฌใƒ“ใƒฅใƒผ
JavaScript
6
star
38

s2s-plugins

s2s plugins
JavaScript
5
star
39

popute-random-img

ใƒใƒ—ใƒ†ใƒ”ใƒ”ใƒƒใ‚ฏใ‚’ใ‚ฟใƒผใƒŸใƒŠใƒซใงๆฅฝใ—ใ‚€
JavaScript
5
star
40

cli-to-api

transform cli to JSON API Server
JavaScript
5
star
41

babel-plugin-float-equal

Babel plugin for float equal
JavaScript
5
star
42

babel-plugin-fizzbuzz

Babel Plugin for fizzbuzz
JavaScript
5
star
43

s2s-examples

s2s examples (react,redux,flowtype...)
JavaScript
4
star
44

capture-element

JavaScript
4
star
45

jest-yaml-transform

Jest transform plugin. transform yaml to Object.
JavaScript
4
star
46

redux-observable-example

TypeScript
4
star
47

phoenix-react-sample-app

phoenix + react ใฎใ‚ตใƒณใƒ—ใƒซใ‚ขใƒ—ใƒชใ‚ฑใƒผใ‚ทใƒงใƒณ
JavaScript
4
star
48

symphogear

cacheable mp3 player from files and url for CLI
JavaScript
3
star
49

qiita-infinite-more

Qiitaใฎใƒ•ใ‚ฃใƒผใƒ‰ใซ็„ก้™ใ‚นใ‚ฏใƒญใƒผใƒซใ‚’่ฟฝๅŠ 
JavaScript
3
star
50

read-babelrc-up

Read the closet .babelrc file
JavaScript
3
star
51

github-kusa

Check the grass of GitHub at the terminal for macOS
JavaScript
3
star
52

how-to-test-reducers

JavaScript
3
star
53

react-native-counter-with-styled-components

JavaScript
3
star
54

babel-plugin-create-redux-action-func

JavaScript
3
star
55

generator-ts-lib

Scaffold node module with TypeScript.
JavaScript
3
star
56

typed-assign

Object.assingn, Overwrite when type mismatch
JavaScript
2
star
57

koharu

ๅฐๆ˜ฅ
JavaScript
2
star
58

npm-src

ghq for npm
JavaScript
2
star
59

babel-plugin-create-redux-action-type

JavaScript
2
star
60

pixiv-auth-got

JavaScript
2
star
61

npm-cd

JavaScript
2
star
62

babel-plugin-redux-action-compose

JavaScript
2
star
63

npm-pixiv

watch pixiv daily ranking while running npm install
JavaScript
2
star
64

electron-args

CLI helper for electron
JavaScript
2
star
65

autocomplete-date

Atom autocomplete date
JavaScript
2
star
66

lux-event

get lux value by eventemitter for osx user
JavaScript
2
star
67

github-weekly-activity

TypeScript
1
star
68

greasemonkey

greasemonkey plugin
JavaScript
1
star
69

rtl-snapshot-diff-example

JavaScript
1
star
70

git-grep-edit

git grep + peco + editor
Shell
1
star
71

akameco.github.io

CSS
1
star
72

vimpr

akameco vimperator plugins
JavaScript
1
star
73

electron-updater-example

JavaScript
1
star
74

ts-sum

JavaScript
1
star
75

ambient-light

Get ambient light in OSX
JavaScript
1
star
76

babel-plugin-react-remove-classname-test

babel plugin for remove classname
JavaScript
1
star
77

gcd-cli

GitHub cd
Shell
1
star
78

redux-saga-example

JavaScript
1
star
79

natori.proxy

proxy for ๅๅ–
JavaScript
1
star
80

use-actions

redux use-actions for me
TypeScript
1
star
81

morse-jp

This is a tool that converts 'Text' and 'Morse cord' to each other
JavaScript
1
star
82

pre-notranslate

Do not translate source code chrome extension
JavaScript
1
star
83

babel-plugin-s2s-action-creater

generate action creater
JavaScript
1
star
84

envrc-to-interface

TypeScript
1
star
85

find-data-test

JavaScript
1
star
86

ptils

utils for package.json
TypeScript
1
star
87

eslint-config-zero

eslint-config-zero
JavaScript
1
star
88

babel-plugin-react-path-display

babel plugin for react display name with file path prefix.
JavaScript
1
star
89

webpack-config-type-definition-example

JavaScript
1
star
90

Brewfile

Auto backup Brewfile by launchd.
Ruby
1
star
91

redux-async-qiita

redux async example with qiita api
JavaScript
1
star
92

babel-plugin-console-with-loc

babel plugin for console.log with loc
JavaScript
1
star
93

dotfiles

dotfiles
Vim Script
1
star
94

jamstack-intro

HTML
1
star
95

electron-github-actions

JavaScript
1
star
96

abematron

abema.tv for desktop
JavaScript
1
star
97

epic-tester

easy Epic test
JavaScript
1
star
98

jest-yaml-flat-transfrom

JavaScript
1
star
99

add-author-to-all-contributors

JavaScript
1
star
100

styled-style-example

JavaScript
1
star