Skip to main content
Deno 2 is finally here 🎉️
Learn more

nekosapi

Unofficial deno module for nekosapi.com~

Import deno 🦖

import {Nekos} from 'https://deno.land/x/nekosapi@v1.0.3/mod.ts';

Import NekosUrl to use diff api urls. (nekosapi, nekidev, vercel)

import {NekosUrl} from 'https://deno.land/x/nekosapi@v1.0.3/mod.ts';

SLIME: defaults to NekosUrl.vercel.

new Nekos(nekosUrl?: NekosUrl, token?: string)

SLIME: smth like-

import {Nekos, NekosUrl} from 'https://deno.land/x/nekosapi@v1.0.3/mod.ts';

const neko = new Nekos(NekosUrl.nekosapi, 'token uwO');

SLIME: nekosUrl and token are optional~

.me() -> Promise<NekosMe> fetches /token

SLIME: smth like-

await neko.me(); // (await) cus returns a <Promise>

SLIME: access token is necessary.

.images(categories?: Array<string>, limit?: number, offset?: number) -> Promise<Array<NekosImage>> fetches /image?categories=&limit=20&offset=0

SLIME: smth like-

await neko.images(); // (await) cus returns a <Promise>

SLIME: access token is necessary.

.image(id: string) -> Promise<NekosImage> fetches /image/{id}

SLIME: smth like-

await neko.image('d02a6ffc-0f2a-4b60-8ef7-c28460890136'); // (await) cus returns a <Promise>

.randoImage(categories?: Array<string>) -> Promise<NekosImage> fetches /image/random?categories=

SLIME: smth like-

await neko.randoImage(); // (await) cus returns a <Promise>

.randoImages(categories?: Array<string>, limit?: number) -> Promise<Array<NekosImage>> fetches /image/random?categories=&limit=2

SLIME: smth like-

await neko.randoImages(); // (await) cus returns a <Promise>

.searchArtists(search: string, limit?: number, offset?: number) -> Promise<Array<NekosArtist>> fetches /artist?search=search&limit=20&offset=0

SLIME: smth like-

await neko.searchArtists('shirentutu'); // (await) cus returns a <Promise>

.artists(limit?: number, offset?: number) -> Promise<Array<NekosArtist>> fetches /artist?limit=20&offset=0

SLIME: smth like-

await neko.artists(); // (await) cus returns a <Promise>

.artist(id: string) -> Promise<NekosArtist> fetches /artist/{id}

SLIME: smth like-

await neko.artist('ea6e23ab-d0fc-4ede-984a-350a07e41ced'); // (await) cus returns a <Promise>

.artistImages(id: string, limit?: number, offset?: number) -> Promise<Array<NekosImage>> fetches /artist/{id}/images?limit=20&offset=0

SLIME: smth like-

await neko.artistImages('ea6e23ab-d0fc-4ede-984a-350a07e41ced'); // (await) cus returns a <Promise>

.searchCharacters(search: string, limit?: number, offset?: number) -> Promise<Array<NekosCharacter>> fetches /artist?search=search&limit=20&offset=0

SLIME: smth like-

await neko.searchCharacters('megumin'); // (await) cus returns a <Promise>

.characters(limit?: number, offset?: number) -> Promise<Array<NekosCharacter>> fetches /character?limit=20&offset=0

SLIME: smth like-

await neko.characters(); // (await) cus returns a <Promise>

.character(id: string) -> Promise<NekosCharacter> fetches /character/{id}

SLIME: smth like-

await neko.character('347b1792-866f-4b2b-b68a-98e226de6b8f'); // (await) cus returns a <Promise>

.searchCategories(search: string, limit?: number, offset?: number) -> Promise<Array<NekosCategory>> fetches /category?search=search&limit=20&offset=0

SLIME: smth like-

await neko.searchCategories('beach'); // (await) cus returns a <Promise>

.categories(limit?: number, offset?: number) -> Promise<Array<NekosCategory>> fetches /category?limit=20&offset=0

SLIME: smth like-

await neko.categories(); // (await) cus returns a <Promise>

.category(id: string) -> Promise<NekosCategory> fetches /category/{id}

SLIME: smth like-

await neko.category('ae7bd1bb-a9e1-4bf3-ab4d-02ec47eff3ba'); // (await) cus returns a <Promise>