mirror of
https://github.com/MinazukiAmane/Nganime-Docs.git
synced 2025-03-16 20:45:56 +08:00
95 lines
2.3 KiB
Plaintext
95 lines
2.3 KiB
Plaintext
|
---
|
||
|
title: Fetch News Info
|
||
|
---
|
||
|
|
||
|
import { Tab, Tabs } from "nextra-theme-docs";
|
||
|
|
||
|
# Fetch News Feeds
|
||
|
|
||
|
Technical details regarding the usage of the fetch news info function for the ANN 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/news/ann/info
|
||
|
```
|
||
|
|
||
|
## Query Parameters
|
||
|
|
||
|
| Parameter | Type | Description | Required? | Default |
|
||
|
| :-------: | :----: | ----------------------------------------------------------------------- | :-------: | :-----: |
|
||
|
| id | string | This is the ID of the news story that will be returned in the function. | Yes | N/A |
|
||
|
|
||
|
## Request Samples
|
||
|
|
||
|
<Tabs items={["JavaScript", "Python"]}>
|
||
|
<Tab>
|
||
|
<>
|
||
|
```js
|
||
|
import axios from "axios";
|
||
|
|
||
|
// An example news story about the Kindaichi Case Files ending.
|
||
|
const url = "https://api.nganime.my.id/news/ann/info?id=2023-04-26/kibo-no-chikara-~otona-precure-23~-anime-teaser-narrated-by-nozomi-yuko-sanpei/.197525";
|
||
|
const data = async () => {
|
||
|
try {
|
||
|
const { data } = await axios.get(url);
|
||
|
return data;
|
||
|
} catch (err) {
|
||
|
throw new Error(err.message);
|
||
|
}
|
||
|
};
|
||
|
|
||
|
console.log(data);
|
||
|
```
|
||
|
</>
|
||
|
|
||
|
</Tab>
|
||
|
<Tab>
|
||
|
<>
|
||
|
```python
|
||
|
import requests
|
||
|
|
||
|
# An example news story about the Kindaichi Case Files ending.
|
||
|
url = "https://api.nganime.my.id/news/ann/info?id=2023-04-26/kibo-no-chikara-~otona-precure-23~-anime-teaser-narrated-by-nozomi-yuko-sanpei/.197525"
|
||
|
response = requests.get(url)
|
||
|
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",
|
||
|
uploadedAt: "string",
|
||
|
intro: "string",
|
||
|
description: "string",
|
||
|
thumbnail: "string",
|
||
|
url: "string"
|
||
|
}
|
||
|
]
|
||
|
```
|
||
|
</Tab>
|
||
|
<Tab>
|
||
|
**MIME Type:** `application/json`
|
||
|
```json copy=false
|
||
|
"message": {}
|
||
|
```
|
||
|
</Tab>
|
||
|
<Tab>
|
||
|
**MIME Type:** `application/json`
|
||
|
```json copy=false
|
||
|
"message": {}
|
||
|
```
|
||
|
</Tab>
|
||
|
</Tabs>
|