Search
This endpoint allows you to access and retrieve information about your favorite waifus. To access the /waifu
endpoint, you
will need to provide the proper authentication using the Authorization header.
Endpoint Details
The /waifu
endpoint allows you to retrieve information about a specific waifu.
- URL:
/waifu
- Method: GET
- Content Type: application/json
Authentication
To make requests to the /waifu
endpoint, you must include an Authorization
header in your API calls. This header should contain a valid access token.
Example Authorization Header
Authorization: YOUR_ACCESS_TOKEN;
Replace YOUR_ACCESS_TOKEN
with the actual token provided to you.
Request Headers
The request to the /waifu
endpoint should be a JSON object with the following headers:
Header | Type | Description | Required |
---|---|---|---|
Authorization | string | The unique identifier of the user sending the request. | True |
Parameters
The request parameters for the /waifu?{parameter}={value}
endpoint.
Parameter | Type | Description | Required |
---|---|---|---|
name | string | (Optional) The desired character name for the query. If not provided, a random waifu will be generated. | False |
anime | string | (Optional) The desired anime name for the query. If not provided, a random waifu will be selected. | False |
Example Request
Here's example of how to make a request to the /waifu
endpoint.
import axios from "axios";
/*
Replace "YOUR_ACCESS_TOKEN" with the token you got from the Kohai Bot and the endpoint.
*/
const url = "https://waifu.it/api/v4/waifu";
const data = async () => {
try {
const { data } = await axios.get(url, { headers: {
Authorization: "YOUR_ACCESS_TOKEN",
} });
return data;
} catch (err) {
throw new Error(err.message);
}
};
console.log(data);
Remember to replace YOUR_ACCESS_TOKEN
with your actual access token.
Responses
The server will respond with an appropriate message based on the input provided. A successfully API request will respond with a JSON object containing the following information:
_id
: The unique identifier of the waifu.name
: Information about the waifu's name.first
: The first name of the waifu.middle
: The middle name of the waifu (if available).last
: The last name of the waifu (if available).full
: The full name of the waifu.native
: The native name of the waifu.userPreferred
: The user's preferred name for the waifu.alternative
: An array of alternative names for the waifu.alternativeSpoiler
: An array of alternative names with potential spoilers.
image
: Information about the waifu's image.large
: URL to a large image of the waifu.
favourites
: The number of users who have favorited the waifu.siteUrl
: URL to the waifu's page on AniList.description
: Description of the waifu (if available).age
: Age of the waifu (if available).gender
: Gender of the waifu.bloodType
: Blood type of the waifu (if available).dateOfBirth
: Date of birth of the waifu (if available).year
: Year of birth.month
: Month of birth.day
: Day of birth.
media
: Information about the media associated with the waifu.nodes
: An array of media nodes.id
: The unique identifier of the media.idMal
: The MyAnimeList identifier of the media.coverImage
: Information about the cover image of the media.medium
: URL to a medium-sized cover image of the media.
bannerImage
: URL to a banner image of the media (if available).title
: Information about the title of the media.romaji
: Romaji representation of the title.english
: English representation of the title (if available).native
: Native representation of the title.userPreferred
: User-preferred representation of the title.
synonyms
: An array of synonyms for the media title.popularity
: Popularity score of the media.type
: Type of the media (e.g., ANIME, MANGA).format
: Format of the media (e.g., TV, MANGA).
Content Type: application/json
"status": 200,
"_id": 11251,
"name": {
"first": "Nanako",
"middle": null,
"last": "Kaisei",
"full": "Nanako Kaisei",
"native": "開成 奈々子",
"userPreferred": "Nanako Kaisei",
"alternative": [],
"alternativeSpoiler": []
},
"image": {
"large": "https://s4.anilist.co/file/anilistcdn/character/large/b220909-iQMT7Xyikifz.jpg"
},
"favourites": 0,
"siteUrl": "https://anilist.co/character/220909",
"description": null,
"age": null,
"gender": "Female",
"bloodType": null,
"dateOfBirth": {
"year": null,
"month": null,
"day": null
},
"media": {
"nodes": [
{
"id": 106964,
"idMal": 118955,
"coverImage": {
"medium": "https://s4.anilist.co/file/anilistcdn/media/manga/cover/small/nx106964-FeyF5m9SQnXE.jpg"
},
"bannerImage": "https://s4.anilist.co/file/anilistcdn/media/manga/banner/106964-ryuN7wdxWc5X.jpg",
"title": {
"romaji": "Zenaku no Kuzu",
"english": null,
"native": "善悪の屑",
"userPreferred": "Zenaku no Kuzu"
},
"synonyms": [
"The Scum of Good and Evil"
],
"popularity": 548,
"type": "MANGA",
"format": "MANGA"
}
]
}
This documentation should help you use axios
(opens in a new tab) for Node.js and requests
(opens in a new tab)
for Python to interact with the /waifu
endpoint.
That's it! You are now ready to use the /waifu
endpoint to retrieve information about your favorite waifus. Happy coding!