Access CommerceClarity APIs via Bearer Token
CommerceClarity APIs use Bearer Token authentication to protect endpoints and ensure that only authorized clients can access the data. Each API request must include a valid access token in the HTTP header.
Currently, API tokens are provided directly by the CommerceClarity support team. To request an access token, fill out the support form available at this link providing your organization name and the API token request in the description.
To authenticate your API requests, include the token in the Authorization header of each HTTP request using the format Bearer <token>.
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
curl -X GET "https://api.commerceclarity.com/api/2026-05/entities" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Accept: application/json"
const apiUrl = 'https://api.commerceclarity.com/api/2026-05/entities';
const token = 'YOUR_API_TOKEN';
fetch(apiUrl, {
method: 'GET',
headers: {
'Authorization': `Bearer ${token}`,
'Accept': 'application/json'
}
})
.then(response => {
if (!response.ok) {
throw new Error(`Status: ${response.status}`);
}
return response.json();
})
.then(data => {
console.log('Received data:', data);
// Process the data
})
.catch(error => {
console.error('Error during the API request:', error);
});
<?php
require 'vendor/autoload.php';
use GuzzleHttp\Client;
use GuzzleHttp\Exception\RequestException;
$client = new Client([
'base_uri' => 'https://api.commerceclarity.com/api/2026-05/',
'timeout' => 10.0,
'headers' => [
'Authorization' => 'Bearer YOUR_API_TOKEN',
'Accept' => 'application/json',
]
]);
try {
$response = $client->get('entities');
$data = json_decode($response->getBody()->getContents(), true);
// Process the data
} catch (RequestException $e) {
if ($e->hasResponse()) {
$errorResponse = json_decode($e->getResponse()->getBody()->getContents(), true);
// Handle the error...
}
}
import requests
api_url = 'https://api.commerceclarity.com/api/2026-05/entities'
token = 'YOUR_API_TOKEN'
headers = {
'Authorization': f'Bearer {token}',
'Accept': 'application/json'
}
try:
response = requests.get(api_url, headers=headers)
response.raise_for_status() # Raise an exception for HTTP 4XX/5XX responses
data = response.json()
# Process the data
except requests.exceptions.HTTPError as err:
print(f'HTTP Error: {err}')
if response.text:
error_data = response.json()
print(f'Error message: {error_data.get("message", "No message")}')
except requests.exceptions.RequestException as err:
print(f'Request error: {err}')
If the token is missing or invalid, the API request will receive a 401 Unauthorized error response.
{
"status": "error",
"timestamp": "2026-10-29T10:00:00.000000Z",
"errors": {
"error": "Authentication failed. Please check your authentication credentials"
}
}
Your API token provides full access to your CommerceClarity account. To protect your data:
Always use HTTPS for API requests to ensure that the token and all transmitted data are encrypted during transit.
Avoid including API tokens in publicly accessible JavaScript frontend applications. Instead, use a backend server to make API requests.
| Problem | Possible Cause | Solution |
|---|---|---|
| "Unauthenticated" or 401 error | Missing or invalid token | Verify that the token is correctly formatted and included in the Authorization header |
403 or 404 on some requests |
brand_id names a brand you do not belong to (403) or that does not exist (404) |
Take brand_id from Workspace & brands |
Create entities from product codes and have them enriched automatically.
Go to Create entityRetrieve and filter your entities and their attributes with the declarative filter tree.
Go to List / Query entitiesDiscover the brand's attributes and their norm_name for use in filters.
If you have questions or encounter issues with the APIs, our support team is available to help. Fill out the support form available at this link including details about your request and any error messages received.