132 lines
3.8 KiB
Plaintext
Raw Normal View History

2024-03-08 18:28:23 +07:00
---
title: Crunchyroll | Anime Info
---
import { Tab, Tabs } from "nextra-theme-docs";
# Get Anime Info
Technical details regarding the usage of the get anime info function for the GogoAnime provider can be found below. Example code is provided for both JavaScript and Python, along with a response schema.
## Route Schema (URL)
```
https://api.nganime.my.id/anime/crunchyroll/info/{id}?type={type}
```
## Path Parameters
| Parameter | Type | Description | Required? | Default |
| :-------: | :----: | --------------------------------------------------------------------------------------------------------- | :-------: | :-----: |
| id | string | The Crunchyroll ID of the anime; i.e. provided by searching for said anime and selecting the correct one. | Yes | |
## Path Parameters
| Parameter | Type | Description | Required? | Default |
| :-------------: | :----: | ----------------------------------------------------------------------------------------------------------- | :-------: | :-----: |
| type | string | The Crunchyroll type of the anime; i.e. provided by searching for said anime and selecting the correct one. | Yes | |
| fetchAllSeasons | bool | Whether to respond with all Seasons or just the first one | No | |
## Request Samples
<Tabs items={["JavaScript", "Python"]}>
<Tab>
<>
```js
import axios from "axios";
// Using the example ID of "GRVN8MNQY", the id for Classroom of the Elite.
const url = "https://api.nganime.my.id/anime/crunchyroll/info/GRVN8MNQY";
const data = async () => {
try {
const { data } = await axios.get(url,{ params: { type: "series" } });
return data;
} catch (err) {
throw new Error(err.message);
}
};
console.log(data);
```
</>
</Tab>
<Tab>
<>
```python
import requests
# Using the example ID of "spy-x-family".
url = "https://api.nganime.my.id/anime/crunchyroll/info/GRVN8MNQY"
response = requests.get(url, params={"type": "series"})
data = response.json()
print(data)
```
</>
</Tab>
</Tabs>
## Response Schema
<Tabs items={["200 OK", "404 Not Found", "500 Internal Server Error"]}>
<Tab>
**MIME Type:** `application/json`
```json copy=false
{
"id": "string",
"title": "string",
"isAdult": "boolean",
"image": "string",
"cover": "string",
"description": "string",
"releaseDate": "number",
"genres": "string[]",
"season": "string", // or null
"hasDub": "boolean",
"hasSub": "boolean",
"rating": "string",
"ratingTotal": "number",
"recommendations": [
{
"id": "string",
"title": "string",
"image": "string",
"cover": "string",
"description": "string"
}
]
"episodes": [
"seasonName": [
{
"id": "string",
"season_number": "number",
"episode_number": "number",
"title": "string",
"image": "string",
"description": "string",
"releaseDate": "string",
"isHD": "boolean",
"isAdult": "boolean",
"isDubbed": "boolean",
"isSubbed": "boolean"
}
]
]
}
```
</Tab>
<Tab>
**MIME Type:** `application/json`
```json copy=false
"message": {}
```
</Tab>
<Tab>
**MIME Type:** `application/json`
```json copy=false
"message": {}
```
</Tab>
</Tabs>