Get Started
The base URL for the Waifu.it REST API is: https://waifu.it/api/:endpoint
(opens in a new tab)
- Replace
:endpoint
with the endpoint you want response from.
Authentication
- Use the API token that you generate to authenticate each request made to the API.
If you don't have an API token, then just head over to https://docs.waifu.it/faq (opens in a new tab), then read and get one for free.
Request Header
- Set your API token as the
Authorization
header on every request.
Request Samples
import axios from "axios";
/*
Replace "Your-API-Token" with the token you got from the Kohai Bot and the endpoint.
*/
const url = "https://waifu.it/api/:endpoint"
const data = async () => {
try {
const { data } = await axios.get(url, { headers: {
Authorization: "Your-API-Token",
} });
return data;
} catch (err) {
throw new Error(err.message);
}
};
console.log(data);
Response Schema
Content Type: application/json
"status": 200,
"message": {}
Notes
- Some
GET
request examples displayed throughout these docs are written for use with Node.js - theaxios
(opens in a new tab) library may be required. - Some
GET
request examples displayed throughout these docs are written for use with Python - therequests
(opens in a new tab) library may be required.