Docs
GET Single product

GET Single Product


GET
/api/products/:id

Retrieve a list of products available on the site.

Parameters:

  • id (required): Product ID.

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/apiproducts/13-inch-m2-air')
.then(res => res.json())
.then(data => console.log(data));

Output