An unofficial API wrapper for pixivFANBOX and Fantia.
Compatible with Kotlin Multiplatform (KMP) and usable on Android and iOS.
- All features are fully functional.
- Currently under development.
- Please wait for the official release.
Platform | Support |
---|---|
Android | ✅ Supported |
iOS | ✅ Supported |
Desktop | ❌ Not Supported |
Web | ❌ Not Supported |
Fankt is available on Maven Central.
Add the library to your project using the following code:
repositories {
mavenCentral()
}
dependencies {
implementation("me.matsumo.fankt:fanbox:$version")
implementation("me.matsumo.fankt:fantia:$version")
}
To use the pixivFANBOX API, you need a session ID called FANBOXSESSID
.
You can obtain this session ID from the cookies after logging in via a browser.
Refer to PixiView-KMP for details about this approach.
Set the session ID using fanbox.setSessionId(sessionId: String)
before using the API.
Additionally, you need to obtain a CSRF token (X-CSRF-Token) for operations like POST requests.
You can acquire this token by calling fanbox.updateCsrfToken()
.
Make sure to retrieve the token before using the API.
Since the CSRF token expires after a certain period, it is recommended to update it as needed before API calls.
val fanbox = Fanbox()
// Set the session ID and CSRF token before using the API
fanbox.setSessionId("your_session_id")
fanbox.updateCsrfToken()
// Example: Retrieve posts from a creator
fanbox.getCreatorPosts(creatorId = FanboxCreatorId("creator_id"))
WIP (Work in Progress)
A sample app with a Swagger UI-like interface is available.
You can test API results by inputting the required parameters.
Copyright 2025 daichi-matsumoto
Licensed under the Creative Commons NonCommercial License (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://creativecommons.org/licenses/by-nc/4.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.