Fetch News Collection
Example code is provided for both JavaScript , along with a response schema.
Route Schema (URL)
https://api.pewds.vercel.app/prothomalo/collection/{name}?start_from=0&per_page=15Path Parameters
| Parameter | Type | Description | Required? | Default |
|---|---|---|---|---|
| name | Examples: "latest" "politics" "sports" | The Name of the selected Collection | Yes | N/A |
Query Parameters
| Parameter | Type | Description | Required? | Default |
|---|---|---|---|---|
| start_from | Number | News Start From. | No | 0 |
| per_page | Number | News Per Page. | No | 15 |
Request Samples
import axios from "axios";
// Example request using no paramters.
const url = "https://api.pewds.vercel.app/prothomalo/collection/latest?start_from=0&per_page=15";
const data = async () => {
try {
const { data } = await axios.get(url);
return data;
} catch (err) {
throw new Error(err.message);
}
};
console.log(data);Response Schema
MIME Type: application/json
[
{
"title": "string",
"id": "string",
"uploadedAt": "string",
"topics": [
"string"
],
"preview": {
"intro": "string",
"full": "string"
},
"thumbnail": "string",
"url": "string"
},
]