Skip to main content

A library for the Pixiv API.

Project description

PyPI Pyversions Docs

A library for the Pixiv API. Uses Pixiv’s App API.

Install with:

$ pip install pixiv-api


To start making requests to the Pixiv API, instantiate a client object.

from pixivapi import Client

client = Client()

The client can be authenticated to Pixiv’s API in multiple ways. One is by logging in with a username and password:

client.login('username', 'password')

And another is with a refresh token.


Once authenticated, a refresh token can be saved for future authorizations.

refresh_token = client.refresh_token

After authenticating, the client can begin making requests to all of the Pixiv endpoints. For example, the following code block downloads an image from Pixiv.

from pathlib import Path
from pixivapi import Size

illustration = client.fetch_illustration(75523989)
    directory=Path.home() / 'my_pixiv_images',

And the next code block downloads all illustrations of an artist.

from pathlib import Path
from pixivapi import Size

artist_id = 2188232
directory = Path.home() / 'wlop'

response = client.fetch_user_illustrations(artist_id)
while True:
    for illust in response['illustrations']:, size=Size.ORIGINAL)

    if not response['next']:

    response = client.fetch_user_illustrations(

Read the complete documentation at



  • Fix quickstart example documentation.


  • Update authentication in response to Pixiv’s changes.


  • Change Client.account from a dict to an Account model.

  • Remove None attributes from User that only applied to responses from Client.fetch_user and move them to a FullUser subclass.

  • Change return type of Client.fetch_user to a FullUser. No attributes were changed.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pixiv-api-0.3.2.tar.gz (17.2 kB view hashes)

Uploaded source

Built Distribution

pixiv_api-0.3.2-py3-none-any.whl (17.7 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page