JSON responses
Experimental
This is an internal view of page data, not a supported API. Field names, structure and route coverage can change or disappear without notice, and nothing here is versioned. Don't build long-lived integrations on it. For stable interfaces, use pixiv's own API.
PixivFE normally renders HTML. Send Accept: application/json and a page route answers with the data that page was built from instead.
curl -H 'Accept: application/json' https://pixivfe.example/rankingThe exact media type must appear in Accept. Wildcards (*/*, application/*) and browsers' default headers do not request JSON, so ordinary navigation is unaffected.
What you get
The response is the same structure the HTML view consumes, encoded with Go's encoding/json: upstream pixiv fields keep their names, and the computed fields PixivFE adds (Illust.RecentWorks, User.Artworks, pagination counters) keep Go's exported names. Content-Type is application/json; charset=utf-8.
Errors use the same negotiation. A failure returns:
{"title": "Error", "status": 404, "message": "…"}A missing session returns HTTP 401 with the same fields plus loginReturnPath and noAuthReturnPath, and the message "Authentication required".
Covered routes
| Page | Route |
|---|---|
| Landing, newest, ranking | /, /newest, /ranking, /rankingCalendar |
| Discovery | /discovery, /discovery/novel, /discovery/users |
| Users | /users/{id}, /users/{id}/{category}, /users/{id}/{category}/{tag} |
| Works | /artworks/{id}, /novel/{id}, /novel/series/{id}, /users/{user_id}/series/{series_id} |
| pixivision | /pixivision, /pixivision/a/{id}, /pixivision/c/{id}, /pixivision/t/{id} |
| Other pages | /search, /about, /settings, /self/followingWorks, /self/login |
Redirects (/self, /member.php, /novel/show.php), static assets, /oembed, the htmx fragments under /api/ and the /street shell are not part of this negotiation. /street data comes from /api/street, which already returns fragments, not JSON.
Caching
Responses carry Vary: Accept so a shared cache keeps the HTML and JSON variants apart, and the same Cache-Control the HTML page would send — public pages stay publicly cacheable, signed-in responses stay private. Handler-computed error responses are never cached.