Repository
Current version released
3 years ago
Versions
nekosapi
Unofficial deno module for nekosapi.com~
Import deno 🦖
import {Nekos} from 'https://deno.land/x/nekosapi@v1.0.2/mod.ts';Import NekosUrl to use diff api urls. (nekosapi, nekidev, vercel)
import {NekosUrl} from 'https://deno.land/x/nekosapi@v1.0.2/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.2/mod.ts';
const neko = new Nekos(NekosUrl.nekosapi, 'token uwO');SLIME: nekosUrl and token are optional~
.me() fetches /token
SLIME: smth like-
await neko.me(); // (await) cus returns a <Promise>SLIME: access token is necessary.
.images(limit?: number, offset?: number) fetches /image?limit=20&offset=0
SLIME: smth like-
await neko.images(); // (await) cus returns a <Promise>SLIME: access token is necessary.
.image(id: string) fetches /image/{id}
SLIME: smth like-
await neko.image('d02a6ffc-0f2a-4b60-8ef7-c28460890136'); // (await) cus returns a <Promise>.randoImage() fetches /image/random
SLIME: smth like-
await neko.randoImage(); // (await) cus returns a <Promise>.randoImages(limit?: number) fetches /image/random?limit=2
SLIME: smth like-
await neko.randoImages(); // (await) cus returns a <Promise>.searchArtists(search: string, limit?: number, offset?: number) 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) fetches /artist?limit=20&offset=0
SLIME: smth like-
await neko.artists(); // (await) cus returns a <Promise>.artist(id: string) 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) 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) 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) fetches /character?limit=20&offset=0
SLIME: smth like-
await neko.characters(); // (await) cus returns a <Promise>.character(id: string) 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) 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) fetches /category?limit=20&offset=0
SLIME: smth like-
await neko.categories(); // (await) cus returns a <Promise>.category(id: string) fetches /category/{id}
SLIME: smth like-
await neko.category('ae7bd1bb-a9e1-4bf3-ab4d-02ec47eff3ba'); // (await) cus returns a <Promise>