GET
/
api
/
v1
/
locations
/
{locationId}
/
products
/
popular
Get Popular Products
curl --request GET \
  --url https://api.cravejs.com/api/v1/locations/{locationId}/products/popular \
  --header 'X-API-Key: <api-key>'
[
  {
    "id": "64a7b8c9d1e2f3a4b5c6d7e8",
    "name": "Margherita Pizza",
    "price": "$16.99",
    "description": "Fresh mozzarella, basil, and tomato sauce",
    "availability": "available",
    "image": "https://example.com/images/margherita-pizza.jpg",
    "hasModifiers": true
  },
  {
    "id": "64a7b8c9d1e2f3a4b5c6d7ea",
    "name": "Caesar Salad",
    "price": "$12.99",
    "description": "Crisp romaine, parmesan, croutons, caesar dressing",
    "availability": "available",
    "image": "",
    "hasModifiers": false
  }
]

Path Parameters

locationId
string
required
The unique identifier for the restaurant location

Query Parameters

limit
integer
Maximum number of popular products to return (default: 15, max: 15)
[
  {
    "id": "64a7b8c9d1e2f3a4b5c6d7e8",
    "name": "Margherita Pizza",
    "price": "$16.99",
    "description": "Fresh mozzarella, basil, and tomato sauce",
    "availability": "available",
    "image": "https://example.com/images/margherita-pizza.jpg",
    "hasModifiers": true
  },
  {
    "id": "64a7b8c9d1e2f3a4b5c6d7ea",
    "name": "Caesar Salad",
    "price": "$12.99",
    "description": "Crisp romaine, parmesan, croutons, caesar dressing",
    "availability": "available",
    "image": "",
    "hasModifiers": false
  }
]

Authorizations

X-API-Key
string
header
required

Path Parameters

locationId
string
required

The unique identifier for the restaurant location

Query Parameters

limit
integer
default:15

Maximum number of popular products to return

Required range: x <= 15

Response

200
application/json

Popular products retrieved successfully.

The response is of type object[].