Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/slavyandesu/moe-api
Search anime scene using trace.moe API.
https://github.com/slavyandesu/moe-api
anime api image image-finder source-finder trace-moe wrapper
Last synced: 2 months ago
JSON representation
Search anime scene using trace.moe API.
- Host: GitHub
- URL: https://github.com/slavyandesu/moe-api
- Owner: SlavyanDesu
- Created: 2023-01-22T16:50:27.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2023-07-18T02:56:10.000Z (over 1 year ago)
- Last Synced: 2024-10-25T09:48:12.197Z (3 months ago)
- Topics: anime, api, image, image-finder, source-finder, trace-moe, wrapper
- Language: TypeScript
- Homepage:
- Size: 249 KB
- Stars: 9
- Watchers: 1
- Forks: 2
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Installation
```sh
$ npm install moe-api
```## Usage
### ESM
```js
import TraceMoe from 'moe-api'
const moe = new TraceMoe()
```### CommonJS
```js
const TraceMoe = require('moe-api').default
const moe = new TraceMoe()
```## Options
```js
const moe = new TraceMoe({
apiKey: 'ABC',
cutBorders: false,
anilistInfo: true,
mute: false,
size: 1
})
```
- `apiKey`: Your API key, you can safely ignore this if you don't have it.
- `cutBorders`: Cut away unnecessary parts of the images that would affect search results accuracy. Default is `false`.
- `anilistInfo`: Include AniList info. Default is `true`.
- `mute`: Mute generated video. Default is `false`.
- `size`: Size of generated media. `0` small, `1` medium, and `2` large. Default is `1`.## Example
```js
import TraceMoe from 'moe-api'
const moe = new TraceMoe()async function sourceFromUrl(url) {
const res = await moe.traceFromUrl(url)
console.log(res)
}sourceFromUrl('https://images.plurk.com/32B15UXxymfSMwKGTObY5e.jpg')
```## API
**moe.traceFromUrl(url)**
- `url` string of media URL that can be decoded by `ffmpeg`.Get source from given media URL.
**moe.traceFromFile(filePath)**
- `filePath` string of existing media path.Get source from given file.
**moe.traceFromBase64(base64)**
- `base64` string of Base64 or data URL.Get source from Base64 string or data URL.
**moe.me()**
Check the search quota and limit for your account (with API key) or IP address (without API key).For more info please check [trace.moe API docs](https://soruly.github.io/trace.moe-api/#/docs).
## License
**moe-api** © [SlavyanDesu](https://github.com/SlavyanDesu), released under the [MIT License](LICENSE). Authored and maintained by SlavyanDesu.