trace.moe.ts
TypeScript icon, indicating that this package has built-in type declarations

1.3.10-patch1 • Public • Published

trace.moe.ts

An API wrapper for https://trace.moe with typings.

CircleCI Build Status Downloads License

🔧 INSTALLATION

You can use the following command to install this package, or replace yarn add with your package manager of choice.

$ yarn add trace.moe.ts

🚀 USAGE

const { TraceMoe } = require("trace.moe.ts");
// ES6 Import.
import { TraceMoe } from "trace.moe.ts";

const api = new TraceMoe();

// Fetching similar anime using an url.
await api.fetchAnime("https://cdn.xndr.tech/u/BKey7tr.jpeg"); // Returns Promise<SearchResponse>

// Fetching similar anime using an image.
await api.fetchAnimeFromBuffer(fs.readFileSync("path-to-image")); // Returns Promise<SearchResponse>

// Fetching your qouta and account limits.
await api.fetchMe(); // Returns Promise<MeResult>

📜 EXAMPLES

  • API#fetchAnime() and API#fetchAnimeFromBuffer()
{
   frameCount: 9339843,
   error: '',
   result: Array<Result> // Refer to lib/structures/Result.ts or below for reference.
}
{
   // anilist: 12189 # If anilistInfo is false, this is the value it will return. If true, refer below.
   anilist: {
     id: 12189,
     idMal: 12189,
     title: {
       native: '氷菓',
       romaji: 'Hyouka',
       english: 'Hyouka'
     },
     synonyms: [ 'Hyouka: Forbidden Secrets' ],
     isAdult: false
   },
   filename: '[DHR&Hakugetsu][Hyouka][03][720P][BIG5][AVC_AAC].mp4',
   episode: 3,
   from: 471.33, // Parsed in milliseconds.
   to: 474.75, // Parsed in milliseconds.
   similarity: 0.9658578643762691, // Will return 1 if 100% similar.
   video: 'url-to-video',
   image: 'url-to-image'
}
  • API#fetchMe()
{
   id: 'ip-or-token',
   priority: 0,
   concurrency: 1,
   quota: 1000,
   quotaUsed: 58
}

💸 TIP JAR

If you enjoyed it and would like to show your appreciation, you may want to tip me here.

It is never required but always appreciated. Thanks from the bottom of my heart!

Donate With Address
Ko-fi Click Here
PayPal Click Here

📖 LICENSE

This project is licensed under the GPL-3.0 license.

Package Sidebar

Install

npm i trace.moe.ts

Weekly Downloads

29

Version

1.3.10-patch1

License

GPL-3.0

Unpacked Size

48.5 kB

Total Files

19

Last publish

Collaborators

  • janleigh