Skip to main content
GET
/
api
/
products
List Products
curl --request GET \
  --url https://api.example.com/api/products
{
  "success": true,
  "data": [
    {
      "id": 123,
      "nombre": "<string>",
      "descripcion": "<string>",
      "precio": 123,
      "precioOriginal": 123,
      "stock": 123,
      "foto": "<string>",
      "isFeatured": true,
      "peso": 123,
      "alto": 123,
      "ancho": 123,
      "profundidad": 123,
      "categoriaId": 123,
      "marcaId": 123,
      "createdAt": {},
      "updatedAt": {}
    }
  ],
  "meta": {
    "page": 123,
    "limit": 123,
    "total": 123,
    "totalPages": 123
  }
}

Endpoint

GET /api/products

Authentication

No authentication required. This is a public endpoint.

Query Parameters

page
number
default:"1"
Page number for pagination
limit
number
default:"10"
Number of products per page
categoryId
number
Filter products by category ID
brandId
number
Filter products by brand ID (accepts both brandId and marcaId)
Search products by name or description
filter
string
Additional filter criteria
order
string
default:"newest"
Sort order for results (e.g., “newest”, “price-asc”, “price-desc”)
minimal
boolean
default:"false"
Return minimal product data (useful for performance optimization)

Response

success
boolean
Indicates if the request was successful
data
array
Array of product objects
id
number
Unique product identifier
nombre
string
Product name
descripcion
string
Product description
precio
decimal
Current product price
precioOriginal
decimal
Original price (if product is on sale)
stock
number
Available stock quantity
foto
string
Product image URL
Whether the product is featured
peso
decimal
Product weight in kg
alto
number
Product height in cm
ancho
number
Product width in cm
profundidad
number
Product depth in cm
categoriaId
number
Associated category ID
marcaId
number
Associated brand ID
createdAt
datetime
Product creation timestamp
updatedAt
datetime
Last update timestamp
meta
object
Pagination metadata
page
number
Current page number
limit
number
Items per page
total
number
Total number of products
totalPages
number
Total number of pages

Example Request

curl -X GET "https://api.pcfix.com/api/products?page=1&limit=20&categoryId=5&order=newest"

Example Response

{
  "success": true,
  "data": [
    {
      "id": 1,
      "nombre": "Laptop Gaming XYZ",
      "descripcion": "High-performance gaming laptop with RTX graphics",
      "precio": "1299.99",
      "precioOriginal": "1499.99",
      "stock": 15,
      "foto": "https://cdn.pcfix.com/products/laptop-xyz.jpg",
      "isFeatured": true,
      "peso": "2.5",
      "alto": 30,
      "ancho": 40,
      "profundidad": 3,
      "categoriaId": 5,
      "marcaId": 2,
      "createdAt": "2024-01-15T10:30:00Z",
      "updatedAt": "2024-01-20T14:45:00Z"
    }
  ],
  "meta": {
    "page": 1,
    "limit": 20,
    "total": 150,
    "totalPages": 8
  }
}

Error Response

{
  "success": false,
  "error": "Error message description"
}

Build docs developers (and LLMs) love