To get a product list, you need to call the endpoint
https://client.experiences.get-potions.com/v1/{siteId}/experience/{experienceId}
with these informations :
The experience ID will change for every location, you can find it in the Lab either in Personalized Recommendations or in E-merchandizing.
Quickstart
All it takes is a few lines of code to call the API to retrieve your first list of products. Below you'll find examples in several programming languages.
This endpoint is available both as GET and as POST, the latter is not RESTful but allows to send all parameters in the body of the request, which can be more convenient.
You can try out the examples as they are using our demo shop or adapt them using your own site ID, API key and experience ID.
GET
import requests
import json
SITE_ID = 504
API_KEY = 'Z8gib1CBfF2xQyrYVb0PewD4b7KThm8o'
EXPERIENCE_ID = '70ee825a-6bf9-4d0a-9535-06610ac13563'
query = json.dumps({
"viewing_item": ["8707084648757"],
"cart_items": ["8706997748021", "8707082354997"]
})
res = requests.get(
f'https://client.experiences.get-potions.com/v1/{SITE_ID}/experience/{EXPERIENCE_ID}?variables={query}',
headers={'Authorization': f'Bearer {API_KEY}'}
)
res.raise_for_status()
data = res.json()
# {"name":"PP - Les internautes ont également aimé - 18.1.24 - OK","description":null,"products":[...]}
const SITE_ID = 504;
const API_KEY = 'Z8gib1CBfF2xQyrYVb0PewD4b7KThm8o';
const EXPERIENCE_ID = '70ee825a-6bf9-4d0a-9535-06610ac13563';
const query = JSON.stringify({
"viewing_item": ["8707084648757"],
"cart_items": ["8706997748021", "8707082354997"]
});
const res = await fetch(
`https://client.experiences.get-potions.com/v1/${SITE_ID}/experience/${EXPERIENCE_ID}?variables=${query}`,
{
headers: {
Authorization: `Bearer ${API_KEY}`
}
}
);
const data = await res.json();
curl -X 'GET' \
"https://client.experiences.get-potions.com/v1/$SITE_ID/experience/$EXPERIENCE_ID?variables=$QUERY" \
-H "Authorization: Bearer $API_KEY"
# {"name":"PP - Les internautes ont également aimé - 18.1.24 - OK","description":null,"products":[...]}
POST
import requests
import json
SITE_ID = 504
API_KEY = 'Z8gib1CBfF2xQyrYVb0PewD4b7KThm8o'
EXPERIENCE_ID = '70ee825a-6bf9-4d0a-9535-06610ac13563'
query = {
"viewing_item": ["8707084648757"],
"cart_items": ["8706997748021", "8707082354997"]
}
res = requests.post(
f'https://client.experiences.get-potions.com/v1/{SITE_ID}/experience/{EXPERIENCE_ID}',
headers={'Authorization': f'Bearer {API_KEY}'},
json=query
)
res.raise_for_status()
data = res.json()
# {"name":"PP - Les internautes ont également aimé - 18.1.24 - OK","description":null,"products":[...]}
const SITE_ID = 504;
const API_KEY = 'Z8gib1CBfF2xQyrYVb0PewD4b7KThm8o';
const EXPERIENCE_ID = '70ee825a-6bf9-4d0a-9535-06610ac13563';
const query = JSON.stringify({
"viewing_item": ["8707084648757"],
"cart_items": ["8706997748021", "8707082354997"]
});
const res = await fetch(
`https://client.experiences.get-potions.com/v1/${SITE_ID}/experience/${EXPERIENCE_ID}`,
{
method: "POST",
headers: {
Authorization: `Bearer ${API_KEY}`,
"Content-Type": "application/json"
},
body: query
}
);
const data = await res.json();
curl -X 'POST' \
"https://client.experiences.get-potions.com/v1/$SITE_ID/experience/$EXPERIENCE_ID" \
-H "Authorization: Bearer $API_KEY" \
-H 'Content-Type: application/json' \
-d $QUERY
# {"name":"PP - Les internautes ont également aimé - 18.1.24 - OK","description":null,"products":[...]}
Technical documentation
If you want to dive deeper in our API, you can explore our swagger :
Potions Experiences API - Swagger UI
https://client.experiences.get-potions.com/v1/docs
You need to clic on the “Authorize” button and enter your API key to be able to try all the endpoints.