node package manager
Don’t reinvent the wheel. Reuse code within your team. Create a free org »

pixiv.moe

pixiv.moe

Build Status Coverage Status npm npm version Website styled with prettier

A pinterest-style layout site, shows illusts on pixiv.net order by popularity. Written with react.

Table of Contents

Tech Stack

  • react
  • react-dom
  • react-router
  • redux
  • redux-thunk
  • react-redux
  • react-mdl
  • whatwg-fetch

Online Site

https://pixiv.moe

Features

  • Pinterest-style layout illusts.
  • Select keywords.
  • Login in Pixiv and add bookmarks easily.

Privacy

We would never record your password.

The authorized data is only stored in localStorage and ACCESS_TOKEN will expire in one hour. That is to say, your login session will only remain for one hour!

Q&A

Q: Why don't you use REFRESH TOKEN?

A: Pixiv change the REFRESH TOKEN auth method, so re-login with refresh_token is failed.

Dev

# Start for development 
$ git clone https://github.com/LoveLiveSunshine/pixiv.moe
cd pixiv.moe
$ npm install
$ npm start

Commands

  • Install dependencies: npm install
  • Run: npm start
  • Test: npm test
  • Build: npm run dist
  • Publish to gh-pages: npm run deploy

API

The API is based on HTTPS requests and JSON responses.The stable HTTPS endpoint for the latest version is: https://api.pixiv.moe/v1

Ranking List

request

GET /ranking?page=[:page]

example
curl 'https://api.pixiv.moe/v1/ranking?page=1' 
response
JSON
{
  "status": "success",
  "response": {
    "content": "all",
    "mode": "daily",
    "date": "2017-05-21",
    "works": [
      {
        "rank": 1,
        "previous_rank": 6,
        "work": {
          "id": 62984197,
          "title": "",
          "caption": null,
          "tags": ["SUKJA", "オリジナル", "ゴスロリ"],
          "tools": null,
          "image_urls": {
            "large":
              "https://api.pixiv.moe/v1/image/Ly9pMi5waXhpdi5uZXQvaW1nLW9yaWdpbmFsL2ltZy8yMDE3LzA1LzIwLzE3LzE1LzM5LzYyOTg0MTk3X3AwLnBuZw==",
            "px_480mw":
              "https://api.pixiv.moe/v1/image/Ly9pMi5waXhpdi5uZXQvYy80ODB4OTYwL2ltZy1tYXN0ZXIvaW1nLzIwMTcvMDUvMjAvMTcvMTUvMzkvNjI5ODQxOTdfcDBfbWFzdGVyMTIwMC5qcGc="
          },
          "width": 700,
          "height": 1000,
          "stats": {
            "scored_count": 2470,
            "score": 24700,
            "views_count": 33130,
            "favorited_count": {
              "public": null,
              "private": null
            },
            "commented_count": null
          },
          "publicity": 0,
          "age_limit": "all-age",
          "created_time": "2017-05-20 17:15:00",
          "reuploaded_time": "2017-05-20 17:15:39",
          "user": {
            "id": 4889903,
            "account": "sorolp",
            "name": "SUKJA",
            "is_following": null,
            "is_follower": null,
            "is_friend": null,
            "is_premium": null,
            "profile_image_urls": {
              "px_50x50":
                "https://api.pixiv.moe/v1/image/Ly9pMy5waXhpdi5uZXQvdXNlci1wcm9maWxlL2ltZy8yMDE2LzExLzI1LzE4LzI4LzI1LzExNzk0MDM4X2ViNGViYjkzOWE5ZTVmNTAzZGUyYjdkMjU0N2IxMjUzXzUwLmpwZw=="
            },
            "stats": null,
            "profile": null
          },
          "is_manga": null,
          "is_liked": null,
          "favorite_id": null,
          "page_count": 1,
          "book_style": "none",
          "type": "illustration",
          "metadata": null,
          "content_type": null,
          "sanity_level": "white"
        },
        "unique_id": "2uba8cM"
      }
    ]
  },
  "count": 1
}

Illust List

request

GET /gallery?tag=[:tag]&page=[:page]

example
curl 'https://api.pixiv.moe/v1/gallery?tag=nico&page=1' 
response
JSON
{
    "status":"success",
    "response":[
        {
            "id":55080228,
            "title":"3年生組",
            "image_urls":{
                "px_128x128":"//i1.pixiv.net/c/128x128/img-master/img/2016/02/04/10/09/39/55080228_p0_square1200.jpg",
                "px_480mw":"//i1.pixiv.net/c/480x960/img-master/img/2016/02/04/10/09/39/55080228_p0_master1200.jpg",
                "large":"//i1.pixiv.net/img-original/img/2016/02/04/10/09/39/55080228_p0.jpg",
                "small":"//i1.pixiv.net/c/150x150/img-master/img/2016/02/04/10/09/39/55080228_p0_master1200.jpg",
                "medium":"//i1.pixiv.net/c/600x600/img-master/img/2016/02/04/10/09/39/55080228_p0_master1200.jpg"
            },
            "stats":{
                "scored_count":14014,
                "score":139358,
                "views_count":388896,
                "favorited_count":{
                    "public":16567,
                    "private":1463
                },
                "commented_count":228
            },
            "unique_id":"13KPDGM"
        }
    ],
    "count":50,
    "pagination":{
        "previous":null,
        "next":2,
        "current":1,
        "per_page":50,
        "total":33863,
        "pages":678
    },
    "expires_at":1478517054
}

Illust Detail

request

GET /illust/[:illust_id]

example
curl 'https://api.pixiv.moe/v1/illust/50110342'
response
JSON
{
    "status":"success",
    "count":1,
    "response":{
        "id":50110342,
        "title":"ことにこと♥【COMIC1☆9】",
        "caption":"5月2日、COMIC1☆9【ヤモセブン】せー50bでマイクロファイバークロスになります!",
        "tags":[
            "ラブライブ!",
            "矢澤にこ",
            "南ことり",
            "にことり",
            "胸囲の格差社会",
            "水着",
            "サイハイソックス",
            "(・8・)",
            "ラブライブ!1000users入り"
        ],
        "tools":[
 
        ],
        "image_urls":{
            "px_128x128":"//i3.pixiv.net/c/128x128/img-master/img/2015/04/30/19/56/14/50110342_p0_square1200.jpg",
            "px_480mw":"//i3.pixiv.net/c/480x960/img-master/img/2015/04/30/19/56/14/50110342_p0_master1200.jpg",
            "large":"//i3.pixiv.net/img-original/img/2015/04/30/19/56/14/50110342_p0.png"
        },
        "width":784,
        "height":704,
        "stats":null,
        "publicity":0,
        "age_limit":"all-age",
        "created_time":"2015-04-30 19:56:14",
        "reuploaded_time":"2015-04-30 19:56:14",
        "user":{
            "id":2473967,
            "account":"axial",
            "name":"あゆま紗由",
            "profile_image_urls":{
                "px_50x50":"http://i2.pixiv.net/user-profile/img/2016/07/13/11/20/47/11192925_b983eb7c8038bffa8db23d1341787d0e_50.jpg"
            },
            "stats":null,
            "profile":null
        },
        "page_count":1,
        "book_style":"right_to_left",
        "type":"illustration",
        "metadata":null,
        "content_type":null
    }
}
{
    "status":"failure",
    "has_error":true,
    "errors":{
        "system":{
            "message":"対象のイラストは見つかりませんでした。(illust_id:5)",
            "code":206
        }
    }
}

Illust Comments

request

GET /illust/comments/[:illust_id]?page=[:page]

example
curl 'https://api.pixiv.moe/v1/illust/comments/47527196?page=1'
response
JSON
{
    "total_comments":8,
    "comments":[
        {
            "id":59071954,
            "comment":"凛ちゃん可愛い(๑////๑) 凛ちゃんロングでも似合う(๑////๑)",
            "date":"2016-07-24T14:40:19+09:00",
            "user":{
                "id":17882671,
                "name":"あかーし",
                "account":"osomatsu0224",
                "profile_image_urls":{
                    "medium":"https://source.pixiv.net/common/images/no_profile.png"
                }
            },
            "parent_comment":[
 
            ]
        },
        {
            "id":48082755,
            "comment":"凛ちゃんかわいい!( =ω=)",
            "date":"2015-07-25T17:28:31+09:00",
            "user":{
                "id":14019593,
                "name":"小原林檎",
                "account":"ai888",
                "profile_image_urls":{
                    "medium":"https://i4.pixiv.net/user-profile/img/2016/12/31/18/35/26/11938047_60df513a413dbc60ece3c2328e300a6c_170.jpg"
                }
            },
            "parent_comment":[
 
            ]
        },
        {
            "id":43536113,
            "comment":"凛ちゃんかわいいです! LINEのトプ画にいただいてもいいですか?",
            "date":"2015-02-09T18:03:15+09:00",
            "user":{
                "id":7954997,
                "name":"かぼす",
                "account":"nktama",
                "profile_image_urls":{
                    "medium":"https://source.pixiv.net/common/images/no_profile.png"
                }
            },
            "parent_comment":[
 
            ]
        },
        {
            "id":42094960,
            "comment":"絵のタッチかわいい すごい好き(*´ω`*)",
            "date":"2014-12-22T20:18:19+09:00",
            "user":{
                "id":4675404,
                "name":"めろうん",
                "account":"chaosevangel",
                "profile_image_urls":{
                    "medium":"https://i1.pixiv.net/user-profile/img/2014/11/07/04/15/43/8594336_18ab997b91995f58ac7276919a868459_170.jpg"
                }
            },
            "parent_comment":[
 
            ]
        },
        {
            "id":41885041,
            "comment":"途中、ホグワーツがあった。",
            "date":"2014-12-14T16:56:06+09:00",
            "user":{
                "id":6695794,
                "name":"ラブライバーエグゼイド",
                "account":"touhousanngetusei",
                "profile_image_urls":{
                    "medium":"https://i3.pixiv.net/user-profile/img/2015/02/10/22/23/46/8954842_fda4fed98e997f25ed3d9856395c98cf_170.jpg"
                }
            },
            "parent_comment":[
 
            ]
        },
        {
            "id":41875578,
            "comment":"髪型変更いいゾ〜コレ",
            "date":"2014-12-14T09:56:58+09:00",
            "user":{
                "id":9328878,
                "name":"緑丸",
                "account":"aimoti1341",
                "profile_image_urls":{
                    "medium":"https://source.pixiv.net/common/images/no_profile.png"
                }
            },
            "parent_comment":[
 
            ]
        },
        {
            "id":41848371,
            "comment":"www",
            "date":"2014-12-13T11:58:48+09:00",
            "user":{
                "id":5498845,
                "name":"bakaookami",
                "account":"bakaookami_suzuha",
                "profile_image_urls":{
                    "medium":"https://i4.pixiv.net/user-profile/img/2015/12/20/16/45/33/10264359_44a222b4c066644ecd7d4d5113009ea0_170.jpg"
                }
            },
            "parent_comment":[
 
            ]
        }
    ]
}

Auth

request

POST /user/auth

{
    "username":"[:username]",
    "password":"[:password]"
}
example
curl 'https://api.pixiv.moe/v1/user/auth' \
-H 'content-type: application/json' \
-H 'accept: application/json' \
--data-binary '{"username":"abc","password":"mypassword"}'
response
JSON
{
    "status":"success",
    "message":null,
    "data":{
        "access_token":"AAAAAAAAAAAAA",
        "expires_in":3600,
        "token_type":"bearer",
        "scope":"unlimited",
        "refresh_token":"BBBBBBBBBBBB",
        "user":{
            "profile_image_urls":{
                "px_16x16":"http://i4.pixiv.net/user-profile/img/2016/08/22/18/33/22/11390779_2ffb9b376cf90d1876182b5d894d5e1f_16.jpg",
                "px_50x50":"http://i4.pixiv.net/user-profile/img/2016/08/22/18/33/22/11390779_2ffb9b376cf90d1876182b5d894d5e1f_50.jpg",
                "px_170x170":"http://i4.pixiv.net/user-profile/img/2016/08/22/18/33/22/11390779_2ffb9b376cf90d1876182b5d894d5e1f_170.jpg"
            },
            "id":"123456",
            "name":"nickname",
            "account":"username",
            "is_premium":false,
            "x_restrict":0,
            "is_mail_authorized":true
        }
    }
}
{
    "status":"failure",
    "message":"Login error: 103:pixiv ID、またはメールアドレス、パスワードが正しいかチェックしてください。"
}

Add Favourite

request

PUT /favourite/[:illust_id]

example
curl 'https://api.pixiv.moe/v1/favourite/46453302' \
-X PUT \
-H 'access-token: AAA' \
-H 'content-type: application/json' \
-H 'accept: application/json'
response
JSON
{
    "status":"success",
    "message":"をブックマークに追加しました"
}
{
    "status":"failure",
    "message":"あなたは既にブックマークに追加しました"
}
{
    "status":"failure",
    "message":"再度ログインログインセッションの有効期限が切れていてください。"
}

Contribute

Feel free to contribute (PR-s and issues welcomed).

Contributors

Thanks goes to these wonderful people (emoji key):


そらヽ(・ω・ゞ)

💻 📖 🎨 ⚠️

吟夢ちゃん

💻 🤔

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

License

MIT license