Size recommendation API
In order to provide size recommendations you need to get the product ID and device ID before requesting the size recommendations.
Get the product ID
In order to get your product ID, you need to send a GET
request to the following endpoint:
https://api.robosize.com/api/v1/widget/product/details/?business=DOMAIN&product=STORE_ID
where DOMAIN
is your domain and STORE_ID
is the ID of the product in your store.
You will receive a JSON object with the following structure:
{
"status": 200,
"data": {
"version": 1,
"product": {
"id": "PRODUCT_ID",
"store_id": "STORE_ID"
}
}
}
where PRODUCT_ID
is the ID of the product that you will need to use in the subsequent API calls.
Get the device ID
You are supposed to send a request once in order to get the device ID and store it for all future requests. Please refer to the tracking integration on how to get the device ID and send it with the subsequent requests.
Get size recommendations
Now you can get the required information from the user in order to get the size recommendations. In order to get the size recommendations, you will need to provide the following information:
height
- height of the user in centimetersweight
- weight of the user in kilogramsage
- age of the user in yearsgender
- gender of the user (male
orfemale
)bustOffset
- bust offset of the user (-1
,0
,1
depending on if the user has a smaller, normal or bigger bust)waistOffset
- waist offset of the user (-1
,0
,1
depending on if the user has a smaller, normal or bigger waist)hipOffset
- hip offset of the user (-1
,0
,1
depending on if the user has a smaller, normal or bigger hip)fitPreference
- fit preference of the user (-1
,0
,1
meaningtight
,normal
,loose
)product
- product ID of the product that you received in the previous steprs_id
- device ID that you received in the previous stepbusiness
- domain of your store
You have two options to get the size recommendations. You can either get the size recommendations with measurements on how the garment will fit the user in each area or you can get the size recommendations with only scores for each size.
Get size recommendations with measurements
In order to get the size recommendations with measurements, you need to send a GET
request to the following endpoint:
https://api.robosize.com/api/v1/widget/recommend/measures/?business=DOMAIN&product=PRODUCT_ID&rs_id=DEVICE_ID&height=HEIGHT&weight=WEIGHT&age=AGE&gender=GENDER&bustOffset=BUST_OFFSET&waistOffset=WAIST_OFFSET&hipOffset=HIP_OFFSET&fitPreference=FIT_PREFERENCE
Below is an example of a request:
https://api.robosize.com/api/v1/widget/recommend/measures/?business=robosize.com&product=81e29b31a34ece8&rs_id=123456789&height=175&weight=75&age=35&gender=female&bustOffset=1&waistOffset=0&hipOffset=-1&fitPreference=0
The response will be a JSON like the following:
{
"status": 200,
"data": {
"recommendation": {
"sizes": [
{
"name": "XS",
"value": {
"bust": -0.66,
"waist": -0.78,
"hip": -0.07
}
},
{
"name": "S",
"value": {
"bust": -0.09,
"waist": -0.21,
"hip": 0.12
}
},
{
"name": "M",
"value": {
"bust": 0.16,
"waist": 0.1,
"hip": 0.69
}
},
{
"name": "L",
"value": {
"bust": 0.79,
"waist": 0.84,
"hip": 0.97
}
},
{
"name": "XL",
"value": null
}
],
"best_size": "S",
"best_size_avg": 8.61
}
}
}
where each size has a value
field that contains fit information for each measurement.
The values for each measurement are in the range from -1
to 1
where -1
means that the garment will be too small for the user,
0
means that the garment will fit the user and 1
means that the garment will be too big for the user.
If the value is null
, it means that the size cannot be fitted to the user.
The best_size
field contains the name of the best size for the user. If none of the sizes fit the user, this field will be null
.
Get size recommendations with sizes
In order to get the size recommendations with sizes, you need to send a GET
request to the following endpoint:
https://api.robosize.com/api/v1/widget/recommend/sizes/?business=DOMAIN&product=PRODUCT_ID&rs_id=DEVICE_ID&height=HEIGHT&weight=WEIGHT&age=AGE&gender=GENDER&bustOffset=BUST_OFFSET&waistOffset=WAIST_OFFSET&hipOffset=HIP_OFFSET&fitPreference=FIT_PREFERENCE
Below is an example of a request:
https://api.robosize.com/api/v1/widget/recommend/sizes/?business=robosize.com&product=81e29b31a34ece8&rs_id=123456789&height=175&weight=75&age=35&gender=female&bustOffset=1&waistOffset=0&hipOffset=-1&fitPreference=0
The response will be a JSON like the following:
{
"status": 200,
"data": {
"recommendation": {
"sizes": [
{
"size": "38",
"score": 0.74
},
{
"size": "36",
"score": 0.66
}
],
"best_size": "38",
"best_size_avg": 0.21
}
}
}
where each size has a value
field that contains the score for the size.
The scores are in the range from 0
to 1
where 1
means that the garment will fit the user and 0
means that the garment will not fit the user.
You will only get the top 2 sizes for the user.