Single Category
GET
/api/categories/:id
Parameters:
- id (required): Category ID.
Retrieve a list of products available on the site.
The list of categories:
- mac
- ipad
- iphone
- watch
- vision
- airpods
- tv&home
- entertainment
- accessories
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/categories/mac')
.then(res => res.json())
.then(data => console.log(data));