v2 is generally available. See what changed
Skip to content
Acme Commerce API Menu

List products

GET /api/v1/products 300 requests per minute Deprecated v1

No authentication required.

A newer version of this operation is available: GET /api/v2/products.

Public catalogue. No credentials required, so this endpoint is safe to call from a browser.

Full URL: https://api.acme.example/api/v1/products

Query parameters

Name Type Required Description
per_page integer no Results per page, 1–100.
page integer no Page number, 1-indexed.
currency string, one of USD, EUR, GBP no Prices are converted to this currency.
q string, maxLength 120 no Free-text search over name and description. Replaces the v1 search endpoint.

Responses

200 A page of products.

Example request

cURL
curl -X GET 'https://api.acme.example/api/v1/products' \
  -H 'Accept: application/json'
JavaScript
const response = await fetch('https://api.acme.example/api/v1/products', {
  method: 'GET',
  headers: {
    'Accept': 'application/json'
  }
});

const data = await response.json();
PHP (Laravel)
use Illuminate\Support\Facades\Http;

$response = Http::withHeaders([
    'Accept' => 'application/json',
])->get('https://api.acme.example/api/v1/products');

$data = $response->json();
PHP (Guzzle)
use GuzzleHttp\Client;

$client = new Client();

$response = $client->request('GET', 'https://api.acme.example/api/v1/products', [
    'headers' => [
        'Accept' => 'application/json',
    ],
]);

$data = json_decode((string) $response->getBody(), true);

Example response

200
{
    "data": [
        {
            "id": 12,
            "name": "Field Notebook",
            "price": 1999,
            "currency": "USD",
            "in_stock": true
        }
    ],
    "meta": {
        "page": 1,
        "per_page": 25,
        "total": 1
    }
}

Free while you are building.

Get an API key

This page as Markdown, or the whole API as OpenAPI. Ask ChatGPT Ask Claude