Fetch search result
Example code is provided for both JavaScript , along with a response schema.
Route Schema (URL)
https://api.pewds.vercel.app/daraz/search/{name}Path Parameters
| Parameter | Type | Description | Required? | Default |
|---|---|---|---|---|
| name | string | The search query; i.e. the name of the product you are looking for. | Yes | N/A |
Query Parameters (Upcoming).
| Parameter | Type | Description | Required? | Default |
|---|---|---|---|---|
| page | Number | Page Number. | No | 1 |
Request Samples
import axios from "axios";
// Example request using no paramters.
const url = "https://api.pewds.vercel.app/daraz/search/shirt";
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"
},
]