Docs
GET All products

GET All Products


GET
/api/products

Retrieve a list of all products.

Parameters:

null

Response:

  • 200 OK: Successful request. Returns a JSON array containing product objects.
  • 400 Bad Request: Invalid parameters supplied.
  • 404 Not Found: No products matching the criteria were found.
  • 500 Internal Server Error: Server encountered an unexpected condition.

Sample Request:

fetch('https://applejson.net/api/products')
.then(res => res.json())
.then(data => console.log(data));

Output:

Output data model

Return array with Product objects.

Each Product object has the data:

  • id - string The id of the product
  • category - string The category of the product
  • title - string Product title
  • number - string Base part/order number
  • model - string Model number (on underside)
  • thumb - string Url to the thumb image
  • gallery - array of images
  • color - array of model colors
  • processor - object
    • name - string Processor’s name
    • cpu - string Number of CPU cores
    • gpu - string Number of GPU cores
    • speed - string Speen in GHz
  • memory - array of memory variants
    • object
      • size - string Memory size
      • add_price - string Amount of additional price
  • storage - array of storage variants
    • object
      • size - string Storage size
      • add_price - string Amount of additional price
  • display - object
    • size - string Screen size
    • resolution - string Screen resolution
    • PPI - string Pixel density
    • ratio - string Aspect ratio
    • brightness - string Brightness ( cd⁄m2)
    • type - string Display type
    • color - string Color space
    • refresh_rate - string Refresh rate in Hz
  • connectivity - object of connectivity
  • battery - object
    • life - string Battery life information
    • type - string Battery type information
  • dimensions - object
    • width - string Device width
    • height - string Device height
    • depth - string Device depth
    • weight - string Device weight
  • os - object
    • initial - string Initial OS
    • latest - string Latest OS
  • price - string Base price