GET/ product-segments/ :id/ products/
View product segment
You can return all products assigned to a specific product segment.
Attributes
Optional unless marked required
- id
- A unique identifier for the products' segment which is given by User automatically.
Request
- cURL
- JavaScript
- PHP
- Python
curl -X GET "https://<your_app_subdomain>.user.com/api/public/product-segments/:id/products/" \
-H "Authorization: Token <your_64_char_api_key>" \
-H "Accept: */*; version=2"
const response = await fetch(
"https://<your_app_subdomain>.user.com/api/public/product-segments/:id/products/",
{
method: "GET",
headers: {
Authorization: "Token <your_64_char_api_key>",
Accept: "*/*; version=2",
},
},
);
const data = await response.json();
console.log(data);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://<your_app_subdomain>.user.com/api/public/product-segments/:id/products/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Token <your_64_char_api_key>",
"Accept: */*; version=2",
],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import requests
response = requests.get(
"https://<your_app_subdomain>.user.com/api/public/product-segments/:id/products/",
headers={
"Authorization": "Token <your_64_char_api_key>",
"Accept": "*/*; version=2",
},
)
print(response.json())
Response examples
- 200 OK
- 404 Not Found
{"count": 2,"next": null,"previous": null,"results": [{"id": 83,"name": "Example name","description": "Example description","custom_id": "1818","product_url": "https://example.com/","image_url": "https://example.com/","qty": 1,"created_at": "2024-11-22T09:35:49.762128Z","updated_at": "2026-11-17T01:08:08.496546Z","categories": ,1 item"attributes": ,2 items"thumbnail": null,"special_price": 0,"brand_name": null,"city": null,"target_group": null,"country": null},{"id": 46,"name": "Example name","description": "Example description","custom_id": "674","product_url": "https://example.com/","image_url": "https://example.com/","qty": 1,"created_at": "2024-11-22T09:35:49.346459Z","updated_at": "2026-11-17T01:08:08.150023Z","categories": ,1 item"attributes": ,2 items"thumbnail": null,"special_price": 0,"brand_name": null,"city": null,"target_group": null,"country": null}]}{
"detail": "No Segment matches the given query."
}
Response fields
Fields returned in the 200 OK response body.
- count
- Number of results across all pages. It can lag behind recent changes; see Response pagination.
- next
- URL of the next page of results. null on the last page.
- previous
- URL of the previous page of results. null on the first page.
- results
- Results on this page.
- results[].
id - A unique identifier for the products' segment which is given by User automatically.
- results[].
name - A product name.
- results[].
description - Description of the product, or
null. - results[].
custom_id - A unique identifier for the product which is provided by the client. Usually related to the product’s SKU.
- results[].
product_url - A URL of a product.
- results[].
image_url - A URL of a product image.
- results[].
qty - Quantity of the product, or
nullif not set. - results[].
created_at - A creation date of a product.
- results[].
updated_at - A date of last product update.
- results[].
categories - A list of categories' ids.
- results[].
attributes - Custom product attributes that have a value, each with
name,name_std,value,descriptionandvalue_type.- results[].
attributes[]. name - A product name.
- results[].
attributes[]. name_std - Standardized name of the attribute, used as its key in the API.
- results[].
attributes[]. value - Value of the attribute for this product.
- results[].
attributes[]. description - Description of the attribute.
- results[].
attributes[]. value_type - Value type of the attribute:
1boolean,2integer,3date,4string,5datetime,6fixed (a list of choices),7float or8JSON.
- results[].
- results[].
thumbnail - URL of the product's thumbnail image, or
nullif there is none. Returned only by the product detail endpoint. - results[].
special_price - Special price of the product, as a whole number;
0if not set. - results[].
brand_name - A brand name.
- results[].
city - An origin city of a product.
- results[].
target_group - A name of a target
- results[].
country - An origin country of a product.
- results[].
note
Errors that can come from any endpoint (401, 429, 500, 502, 504) are described in HTTP response codes.