Skip to content

book000/pixivts

Repository files navigation

pixivts

pixiv Unofficial API Library for TypeScript

This is NOT a fork of @ibaraki-douji/pixivts. However, it is used as a reference.

✨ Features

  • Zero runtime dependencies — no axios, no zod at runtime; uses native fetch
  • Result-typed API — every method returns Result<T, PixivError>; no thrown exceptions for API errors
  • Automatic token refresh — exchanges the refresh token for an access token on startup, and retries on 401
  • ESM + CJS dual output — works in Node.js ESM/CJS and edge runtimes
  • Paginated resultsPaginatedResultAsync with .pages() / .items() async generators for multi-page iteration
  • Resource-based namespacesillusts, novels, users, manga, ugoira, images
  • Optional MySQL recorder@book000/pixivts-db-mysql persists every API response via Drizzle ORM

📦 Packages

Package Description
@book000/pixivts Core API client — zero runtime dependencies, Result-typed, ESM + CJS
@book000/pixivts-db-mysql Optional MySQL recorder using Drizzle ORM

🚀 Quick Start

npm install @book000/pixivts
import { PixivClient } from '@book000/pixivts'

const client = await PixivClient.of(process.env.PIXIV_REFRESH_TOKEN!)

const result = await client.illusts.detail({ illustId: 12345 })
if (result.isOk) {
  console.log(result.value.illust.title)
}

📖 Documentation

📑 License

This project is licensed under the MIT License

About

pixiv Unofficial API Library for TypeScript : https://book000.github.io/pixivts/

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors