Product Search
This endpoint should allow us to search through products using various filters and get paginated results - search by category, title
GEThttps://api.brand.com/product
Search products
This endpoint allows our system to search through products and retrieve a paginated list of results. By default, a maximum of 20 products are shown per page.
Optional attributes
- Name
query- Type
- string
- Description
Search term to filter products by title.
- Name
category- Type
- string
- Description
Filter products by category.
- Name
limit- Type
- integer
- Description
Limit the number of products returned per page.
- Name
page- Type
- integer
- Description
Page number for pagination. Starts at 1.
Request
GET
https://api.brand.com/productcurl -G https://api.brand.com/products \
-H "Authorization: Bearer {token}" \
-d query="blue jacket" \
-d category="t-shirts" \
-d limit=20 \
-d page=1 \
Response
{
"total": 42,
"page": 1,
"limit": 10,
"has_more": true,
"data": [
{
id: "productID1",
title: "Product Title 1",
price: "29.99",
size: "M",
currency: "USD",
category: "Man > T-shirt",
brand: "Brand 1",
images: ["https://brand.com/image.png"],
link: "https://brand.com/products/some-product-slug",
purchaseDate: "2023-06-01",
}
]
}