Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/yashraj-n/animon-api


https://github.com/yashraj-n/animon-api

Last synced: 4 days ago
JSON representation

Awesome Lists containing this project

README

        


GitHub Readme Stats

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/latest

Response:
{
"error":,
"message":,
"data":[
{
"title":,
"image":,
"released":,
"id":
}

}
```

##### **/api/popular** Get Latest Popular Anime data

```bash
GET /api/popular

Response:
{
"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/)