API
Get Started

Get Started

Base URL

https://waifu.it/api

API Versioning

Some API and Gateway versions are now non-functioning, and are labeled as discontinued in the table below for posterity. Trying to use these versions will fail and return 400 Bad Request.

Waifu.it exposes different versions of our API. You should specify which version to use by including it in the request path like https://waifu.it/api/v{version_number}. Omitting the version number from the route will route requests to the current default version (marked below). You can find the change log for the newest API version here (opens in a new tab).

API Versions

VersionStatusDefault
4Available
3Deprecated
2Discontinued
1Discontinued

Authentication

Authenticating with the Waifu.it API can be done using a token found on the Dashboard page within your settings. 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.

For all authentication types, authentication is performed with the Authorization HTTP header in the format Authorization: TOKEN.

Example Token Authorization Header

Authorization: MTk4NjIyNDgzNDcxOTI1MjQ4.Cl2FMQ.ZnCjm1XVW7vRze4b7Cq4se7kKWs

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/v4/: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 - the axios (opens in a new tab) library may be required.
  • Some GET request examples displayed throughout these docs are written for use with Python - the requests (opens in a new tab) library may be required.