Skip to main content
GET
/
products
curl https://api.example.com/products
{
  "products": [
    {
      "id": 123,
      "name": "Espresso Coffee",
      "price": 12.99,
      "image": "espresso.jpg",
      "inventory": 50,
      "categoryId": 1,
      "category": {
        "id": 1,
        "name": "Beverages",
        "image": "beverages.jpg"
      }
    },
    {
      "id": 122,
      "name": "Cappuccino",
      "price": 14.99,
      "image": "cappuccino.jpg",
      "inventory": 35,
      "categoryId": 1,
      "category": {
        "id": 1,
        "name": "Beverages",
        "image": "beverages.jpg"
      }
    }
  ],
  "total": 45
}
Retrieve a paginated list of products with optional filtering by category.

Authentication

This endpoint is public and does not require authentication.

Query Parameters

category_id
number
Filter products by category ID
take
number
default:"10"
Number of products to retrieve per page
skip
number
default:"0"
Number of products to skip (for pagination)

Response

products
array
Array of product objects
total
integer
Total number of products matching the query
curl https://api.example.com/products
{
  "products": [
    {
      "id": 123,
      "name": "Espresso Coffee",
      "price": 12.99,
      "image": "espresso.jpg",
      "inventory": 50,
      "categoryId": 1,
      "category": {
        "id": 1,
        "name": "Beverages",
        "image": "beverages.jpg"
      }
    },
    {
      "id": 122,
      "name": "Cappuccino",
      "price": 14.99,
      "image": "cappuccino.jpg",
      "inventory": 35,
      "categoryId": 1,
      "category": {
        "id": 1,
        "name": "Beverages",
        "image": "beverages.jpg"
      }
    }
  ],
  "total": 45
}

Pagination

The products are returned in descending order by ID (newest first). Use the take and skip parameters for pagination:
  • Page 1: take=10&skip=0
  • Page 2: take=10&skip=10
  • Page 3: take=10&skip=20
The total field in the response indicates the total number of products matching your query.

Build docs developers (and LLMs) love