Fetch Ads
Example code is provided for both JavaScript , along with a response schema.
Route Schema (URL)
https://api.pewds.vercel.app/bikroy/ads/Query Parameters.
| Parameter | Type | Description | Required? | Default |
|---|---|---|---|---|
| search | string | The search query; i.e. the name of the ads you are looking for. | Yes | N/A |
| page | Number | Page Number. | No | 1 |
| categorySlug | string | Slug of specific category.Examples: "mobiles" | No | N/A |
| category | Number | Id of specific category.Examples: "229" | No | N/A |
| locationSlug | string | Location Slug of specific category. Examples: "mohammadpur" "dhaka" | No | N/A |
Request Samples
import axios from "axios";
// Example request using no paramters.
const url = "https://api.pewds.vercel.app/bikroy/ads?search=iphone xs&categorySlug=mobiles";
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"
},
]