Advanced headless integration using the API
For full control and flexibility, you can retrieve recommendations directly from the Recommendations API. This approach is ideal for headless architectures or native apps, or CRM-integrated environments where you want to manage the rendering fully on your side.
Advanced headless integration setup
Make your API request
You can now call the Recommendations API to retrieve product recommendations associated with your RECO_ID.
Recommendation request example :
GET https://uc-info.eu.abtasty.com/v1/reco/[SITE_ID]/recos/[RECO_ID]?variables=[VARIABLES]&fields=[FIELDS]RECO_ID
The unique identifier of your recommendation (copied from the platform).
5a936bc0-fbd1-4048-81a8-b94da73178e2
SITE_ID
Your AB Tasty site identifier.
952
VARIABLES
JSON-encoded dynamic variables used by the recommendation
JSON.stringify({
"viewing_item": "46857036202293",
"viewed_items": [
"46855642644789"
]
})
FIELDS
Optional JSON-encoded fields to retrieve from the query. By default, only id.
JSON.stringify([ "img_link", "id", "price", "catalog_page_path", "name", "revenues_last_30_days" ])
Handle the API response
The API will return a list of recommended products based on the selected strategy and context.
Response example:
{
"queryRecosApi": {
"name": "n/a",
"items": [
{
"img_link": "https://cdn.shopify.com/s/files/1/0722/7578/8085/products/retroviseur-vicma-reversible-m10-rond-o116-noir.jpg?v=1695221168",
"id": "46857073852725",
"price": 15,
"category": "auto-moto",
"name": "Rétroviseur Vicma réversible M10 rond Ø116 noir",
"revenues_last_30_days": 135,
"catalog_page_path": ""
},
{
"img_link": "https://cdn.shopify.com/s/files/1/0722/7578/8085/products/retroviseur-vicma-reversible-m8-rond-noir.jpg?v=1695221665",
"id": "46857169764661",
"price": 15,
"category": "auto-moto",
"name": "Rétroviseur Vicma réversible M8 rond noir",
"revenues_last_30_days": 45,
"catalog_page_path": ""
},
{
"img_link": "https://cdn.shopify.com/s/files/1/0722/7578/8085/products/3233895f998ab4914e85.00276182.jpg?v=1695219340",
"id": "46856601403701",
"price": 32.99,
"category": "sport",
"name": "Disque de Frein Shimano Deore XT SM-RT86 Noir",
"revenues_last_30_days": 65.98,
"catalog_page_path": ""
},
{
"img_link": "https://cdn.shopify.com/s/files/1/0722/7578/8085/products/laine-de-silencieux-haute-temperature-doppler.jpg?v=1695221884",
"id": "46857231860021",
"price": 14,
"category": "auto-moto",
"name": "Laine de silencieux haute température Doppler 500x700x10",
"revenues_last_30_days": 84,
"catalog_page_path": ""
},
{
"img_link": "https://cdn.shopify.com/s/files/1/0722/7578/8085/products/CLEAN-Packshot-Huile-Resize.jpg?v=1695205576",
"id": "46854315442485",
"price": 7.9,
"category": "cosmeto",
"name": "Huile Démaquillante Éclair",
"revenues_last_30_days": 23.7,
"catalog_page_path": ""
},
{
"img_link": "https://cdn.shopify.com/s/files/1/0722/7578/8085/products/BODY-creme-corps-Packshot.jpg?v=1695205578",
"id": "46854315770165",
"price": 34.9,
"category": "cosmeto",
"name": "Crème Corps Raffermissante",
"revenues_last_30_days": 34.9,
"catalog_page_path": ""
},
{
"img_link": "https://cdn.shopify.com/s/files/1/0722/7578/8085/products/TDM_W23_POCKETS_0065_FONTAINE-DU-LION.png?v=1695213737",
"id": "46855642644789",
"price": 12,
"category": "maroquinerie",
"name": "Pochette Fontaine du Lion L",
"revenues_last_30_days": 180,
"catalog_page_path": ""
},
{
"img_link": "https://cdn.shopify.com/s/files/1/0722/7578/8085/products/chargeur-de-batterie-et-maintien-de-charge-sc.jpg?v=1695223277",
"id": "46857735438645",
"price": 30,
"category": "auto-moto",
"name": "Chargeur de batterie et maintien de charge Sc Power 12v 800ma",
"revenues_last_30_days": 630,
"catalog_page_path": ""
},
{
"img_link": "https://cdn.shopify.com/s/files/1/0722/7578/8085/products/3701328303367_007_c9048288-25e1-42ff-b62b-6ad6521aa427.jpg?v=1695206660",
"id": "46854474531125",
"price": 99,
"category": "maroquinerie",
"name": "Reykjavik - Sac à dos - Maxi",
"revenues_last_30_days": 1881,
"catalog_page_path": ""
},
{
"img_link": "https://cdn.shopify.com/s/files/1/0722/7578/8085/products/77d773f1-c2f9-4a1c-856e-608718daf8d1.png?v=1695214298",
"id": "46855739441461",
"price": 35,
"category": "maroquinerie",
"name": "Creamy Gin Noir",
"revenues_last_30_days": 490,
"catalog_page_path": ""
}
]
}
}You can now use this data to display the products anywhere in your website or application — e.g. through a front-end component, mobile app, or CMS block.
Tips
You can cache the API response to reduce load times.
Always include contextual parameters (e.g., product category, user segment) to improve recommendation relevance.
Combine the Recommendations API with your analytics setup to track impressions and clicks for full performance visibility.
Last updated
Was this helpful?

