Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yashraj-n/animon-api
https://github.com/yashraj-n/animon-api
Last synced: 4 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/yashraj-n/animon-api
- Owner: yashraj-n
- License: mit
- Created: 2022-06-27T15:43:31.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-06-27T15:43:53.000Z (over 2 years ago)
- Last Synced: 2024-04-24T05:30:45.153Z (9 months ago)
- Language: JavaScript
- Size: 41 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Animon-API
A Simple API for getting anime details
## Features
- Made in [Fastify](https://www.fastify.io/ "Fastify")
- Caches anime data for better perfomance and speed
- Automatic genrated documentation using [Fastify Swagger](https://github.com/fastify/fastify-swagger "Fastify Swagger")
- Much More...### How This works
Animon-Api uses [Cheerio](https://www.npmjs.com/package/cheerio "Cheerio") to scrape data from [GoGoAnime](https://ww1.gogoanime2.org/). It parses that data into JSON and returns it using REST API.
Also, API caches most of the data in Redis DB to make API faster
### Endpoints
##### / Route
```bash
GET /Response:
{
"message": "API Working!!!"
}
```##### **/documentation** Documentation
Visit [localhost:3000/documentation](http://localhost:3000/documentation "localhost:3000/documentation") for Swagger Documentation
##### **/api/anime/data** Get Anime Data using ID
```bash
POST /api/anime/data
{
id:
}Response:
{
"error":,
"message":,
"data": {
"image":,
"title":,
"type":,
"desc":,
"genre":
"status": ,
"othername": ,
"episodes": {
"name": ,
"string":
}
}
}
```##### **/api/latest** Get Latest Anime data
```bash
GET /api/latestResponse:
{
"error":,
"message":,
"data":[
{
"title":,
"image":,
"released":,
"id":
}}
```##### **/api/popular** Get Latest Popular Anime data
```bash
GET /api/popularResponse:
{
"error":,
"message":,
"data":[
{
"title":,
"image":,
"released":,
"id":
}
]
}
```##### **/api/stream/** Get HLS streaming link
```bash
POST /api/stream/
{
"id":,
"ep":
}Response:
{
"error":,
"message":,
"data":, # iframe src link
"android": # HLS Playlist link
}
```##### **/api/search/** Get HLS streaming link
```bash
POST /api/search
{
"search":
}Response:
{
"error":,
"message":,
"data":[
{
"title":,
"image":,
"released":,
"id":
}
]
}
```### Setup
#### Requirements
Download and Install Redis DB from [here](https://redis.io/ "Redis Download Link").
Make sure you have node.js version >= 14
### Installation
Install Typescript Compiler (tsc) globally
for npm
```bash
npm i -g tsc
```for yarn
```bash
yarn global add typescript
```Clone the repo
```bash
git clone https://github.com/yashraj-n/Animon-API
```Change Directory
```bash
cd Animon-API
```Install Typescript
for npm
```bash
npm i -D typescript
```for yarn
```bash
yarn add typescript -D
```#### Run the server locally
Make sure you have redis server running locally
Change your Redis Credentials in /src/utils/redisDB.ts
Run `yarn start` or `npm start` to start the server locally on [port 3000](http://localhost:3000 "Animon-Api")
## Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
## License
[MIT](https://choosealicense.com/licenses/mit/)