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 productcategory
- string The category of the producttitle
- string Product titlenumber
- string Base part/order numbermodel
- string Model number (on underside)thumb
- string Url to the thumb imagegallery
- array of imagescolor
- array of model colorsprocessor
- objectname
- string Processor’s namecpu
- string Number of CPU coresgpu
- string Number of GPU coresspeed
- string Speen in GHz
memory
- array of memory variants- object
size
- string Memory sizeadd_price
- string Amount of additional price
- object
storage
- array of storage variants- object
size
- string Storage sizeadd_price
- string Amount of additional price
- object
display
- objectsize
- string Screen sizeresolution
- string Screen resolutionPPI
- string Pixel densityratio
- string Aspect ratiobrightness
- string Brightness ( cd⁄m2)type
- string Display typecolor
- string Color spacerefresh_rate
- string Refresh rate in Hz
connectivity
- object of connectivitybattery
- objectlife
- string Battery life informationtype
- string Battery type information
dimensions
- objectwidth
- string Device widthheight
- string Device heightdepth
- string Device depthweight
- string Device weight
os
- objectinitial
- string Initial OSlatest
- string Latest OS
price
- string Base price