|
REST API built with NestJS that provides information about the anime Bocchi the Rock! by consuming data from Jikan API. |
|
- NestJS - Node.js Framework
- TypeScript
- Axios - HTTP Client
git clone https://github.com/UlisesChoco/bocchi-api
cd .\bocchi-api\
npm install
npm run startBase URL: http://localhost:3000
| Method | Endpoint | Description |
|---|---|---|
| GET | /bocchi/season-one |
Season one information |
| GET | /bocchi/season-two |
Season two information |
| GET | /bocchi/special-episode |
Special episode information |
| GET | /bocchi/movie |
Movie information |
All endpoints return the same JSON structure:
{
"data": {
"images": {
"jpg": {
"image_url": "https://cdn.myanimelist.net/images/anime/1448/127956.jpg"
}
},
"trailer": {
"embed_url": "https://www.youtube.com/embed/example"
},
"title_english": "Bocchi the Rock!",
"title_japanese": "ぼっち・ざ・ろっく!",
"episodes": 12,
"aired": {
"from": "2022-10-09T00:00:00+00:00",
"to": "2022-12-25T00:00:00+00:00"
},
"duration": "24 min per ep",
"rating": "PG-13 - Teens 13 or older",
"synopsis": "Hitori Gotoh, \"Bocchi-chan,\" is a girl who's so introverted...",
"background": "Bocchi the Rock! adapts the first three volumes..."
}
}When the anime does not exist in the external API.
{
"statusCode": 404,
"message": "Anime with ID 99999 not found in external API"
}When the request limit to the external API is exceeded.
{
"statusCode": 429,
"message": "Too many requests to external API. Please try again later."
}When the external API is unavailable or times out.
{
"statusCode": 503,
"message": "External API is unavailable. Please try again later."
}When an unexpected error occurs on the server.
{
"statusCode": 500,
"message": "An unexpected error occurred while fetching anime data"
}src/
├── api/
│ ├── interfaces/
│ │ ├── anime.interface.ts
│ │ ├── image.interface.ts
│ │ ├── trailer.interface.ts
│ │ └── aired.interface.ts
│ ├── mapper/
│ │ └── anime.mapper.ts
│ ├── bocchi.controller.ts
│ ├── bocchi.service.ts
│ └── bocchi.module.ts
├── app.module.ts
└── main.ts
This API consumes data from Jikan API v4, an unofficial MyAnimeList API.
| Content | MAL ID |
|---|---|
| Season 1 | 47917 |
| Season 2 | 61006 |
| Special Episode | 59806 |
| Movie | 55357 |
