您可以使用以下方式传递用户 token 来鉴权:
Authorization
传递PHPSESSID
传递请求路径 /ajax/*
的返回结果与 https://pixiv.net/ajax/*
的行为完全一致。
以下列举部分 PixivNow 的独特接口:
/api/illust/random
返回随机图片,其实是 /ajax/illust/discovery
的语法糖,也支持直接返回图片。
max
{number}
返回图片的个数mode
{'all' | 'safe' | 'r18'}
其中 r18
只有在登录状态且参数设置允许时才会返回format
{'image' | 'json'}
返回的格式,如果 Accept
包含 image
则预设为 image
/api/ranking
是 /ranking.php
的重定向。
/user
通过传入的 token,以 json 格式返回源站 <meta name="global-data">
中的用户信息。
本站的图片使用 CloudFlare Workers 进行代理,可以直接访问欣赏众多插画。
但是由于遭遇了大量不明流量,因此我们暂时开启了图片代理服务的防盗链。如果您有自行部署整站的需要,可以通过在Vercel环境变量VITE_PXIMG_BASEURL_I
中传入反代url(首选),或修改 vercel.json
中的对于图片的重定向配置,图片的请求路径与源站完全一致。
For communication and learning only.
All data & pictures from query: ©Pixiv & Illusts' authors
Copyright 2021 PixivNow
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.