Facebook script

API documentation

LookSize API v2.1

The method is called via an HTTPS request to the URL: https://www.looksize.com/api.php

Input data is accepted in both GET and POST requests, in case of simultaneous GET and POST requests, GET data takes precedence. All data should be sent in UTF-8 encoding

Output data in JSON format

Input data
    for all methods
  • api_key - API access key (required), you can get the key in the Cabinet / Widget settings

    api_key is bound to a domain, if you need to specify multiple domains, contact the LookSize manager

  • act - name of the method (required)
  • lang - language ua - Ukrainian, en - English (optional)
  • secret - private API access key for requests via cURL
The output data
    for all methods
  • time - timestamp
  • run_time - run time
  • result :success/error - success/error
  • error - message
Example answer

success:
{"size":{...},...,"response":"success","run_time":0.059,"time":1600249590}

error:
{"error":"empty param api_key","response":"error","run_time":0.005,"time":1600250319}

 

List of methods

 

getData - get the measurement result

Input data
    {
  • category - category identifier in the store (must match the LookSize clothing category) (one of the category or category_id parameters is required)
  • category_id - LookSize clothing category identifier (one of the category or category_id parameters is required)
  • brand - brand name (required)
  • gender - gender (must be specified if the category does not specify gender)
  • page_url - url of the product page encoded with base64encode
  • userKey - user profile identifier
  • userSize - data of the current profile, if changed
    {"userSize":{"name":"test","gender":"male",.....}}
  • profile - profile data (when creating or editing)
      {
    • act - operations with the profile, valid values: save, delete
    • userKey - user profile identifier
    • name - profile name (required)
    • gender - gender, valid values: female, male (required)
    • fit - fit, valid values: norm, tight, wide, too_tight, too_wide (default: norm)
    • new:1 - a sign of a new profile
    • bust:90 - body measurements, cm
    • ...
    • }
    }
Initial data
  • size - Object list of measurements
    {"size":{
    {"bust":{"id":"bust","name":"bust","caption":"Обхват грудей","min_val":"50","max_val":"190","size_id":"2","figure":"","hide2gender":"0","video":{"url":"https://www.looksize.intelexcanada.com/UserFiles/sc_size/bust_female.gif","title":"How to measure your chest circumference correctly"}}}
    ....
    }
    }
  • profile_list - list of user profiles
    {"profile_list":{
    "LS.....":{"name":"test","gender":"male"},
    "LS.....":{"name":"test2","gender":"female"},
    .....
    }}
  • userKey - identifier of the current user profile
  • userSize - data of the current user profile
    {"userSize":{"name":"test","gender":"male",.....}}
  • shop_gender - default figure/gender in the store for the new profile
  • base_figure - base figure/gender
  • category - store clothing category
  • category_id - ID of the defined LookSize category (type of clothing)
  • category_name - Name of the defined LookSize category
  • brand - store brand
  • brand_name - Name of the defined LookSize brand
  • brand_file - brand logo
  • brandSize - brand size chart
    {"brandSize":{
    "type_id":"3",
    "available_standart":{"world":"International standard","ua":"Ukrainian standard","us":"American standard","eu":"European standard"},
    "standart":"world",
    "need":{"bust":"2","waist":"5","hips":"6"},
    "size_brand":{"_2":{ "standart":{"world":"XS","ua":"40","us":"6","eu":"34"}, "size":{"bust":{"min_val":78,"max_val":81},"waist":{"min_val":63,"max_val":65},"hips":{"min_val":88,"max_val":91}} },
    ......
    }
    }}
  • current:"_2" - ID of the defined size brandSize.size_brand["_2"]
  • userBrandSize - the defined size according to standards
    {"userBrandSize":{"world":"XS","ua":"40","us":"6","eu":"34"}}
  • user_size_standart - - a specific size in the selected standard
  • different - size deviation in body measurements
    {"different":{
    "_2":{
    "total":0.078,
    "bust":{"fit":3,"dev":-4,"diff":0,"sign":"0","points":0.035},
    "waist":{"fit":3,"dev":0,"diff":0,"sign":"0","points":0.018},
    "hips":{"fit":3,"dev":0,"diff":0,"sign":"0","points":0.025},"avg":0.026},
    ....
    }}
  • fit - fit (reference for different.bust.fit)
    {"fit":{"1":"Very loose","2":"Loose","3":"Normal","4":"Tight","5":"Very tight"}}
  • nearest - ID of the defined nearest size
  • nearestSize - the nearest defined size according to standards
  • nearestSize_standart - the nearest defined size in the selected standard
  • showSize - ID of the size to display
  • actionKey - the key of the measurement results, used to bind the measurement results to the order or view the results by the store
  • btn_user_size - measurement result for display
  • figure - a list of shapes to display
    {"figure":{"shop":"male","base":"female","user":"female","category":""}}
  • user_fit
    {"user_fit":{"norm":"normal","tight":"tight","wide":"wide","too_tight":"too tight","too_wide":"too wide"}}
  • LANG - language variables
List of body measurements
  • head_circ - Head circ.
  • shoulders_width - Shoulders width
  • shoulder_circ - Shoulders circ.
  • neck_circ - Neck circ.
  • above_bust - Above bust
  • chest_circ - Chest circ.
  • underbust - Under bust
  • waist - Waist
  • waist_lower_belt - Lower waist (Belt)
  • hips - Hips
  • thigh_circ - Thigh circ.
  • arm_length_neck - Arm length (from neck)
  • arm_length_shoulder - Arm length (from shoulder)
  • inner_arm_length - Inner arm length
  • elbow_circ - Elbow circ.
  • forearm_circ - Forearm circ.
  • forearm_length - Forearm length
  • arm_circ - Arm circ.
  • wrist_circ - Wrist circ.
  • palm_width - Palm width
  • palm_circ - Palm circ.
  • hand_length - Hand length
  • middle_finger_length - Middle finger length
  • back_length - Back length
  • leg_length_belt - Leg length (from belt)
  • inseam - Inseam
  • above_knee_circ - Above knee circ.
  • knee_circ - Knee circ.
  • under_knee_circ - Under knee circ.
  • calf_circ - Calf circ.
  • ankle_circ - Ankle circ.
  • foot_length - Foot length
  • foot_width - Foot width
  • foot_arch - Foot arch
  • insole_length - Insole length
  • trouser_length - Leg length
  • crotch - Crotch:
  • thing_length - Product length
  • height - Height
  • weight - Weight
  • birth_year - Year of birth
  • age - Age

 

setData - data recording

Input data
  • userKey - identifier of the current user profile
  • userSize - data of the current user profile
    {"userSize":{"name":"test","gender":"male",.....}}
  • profile - profile data (when creating or editing)
Initial data
  • userKey - the ID of the user's current profile
  • userSize - current user profile data
    {"userSize":{"name":"test","gender":"male",.....}}

 

checkIsFilter - checking the availability of data for the "My size"

functionality
Input data
  • category - identifier of the category in the store (must match the LookSize clothing category) (one of the category or category_id parameters is required)
  • category_id - identifier of the LookSize clothing category (one of the category or category_id parameters is required)
  • userKey - identifier of the current user profile
Initial data
  • isFilter:1 - there is data for the "My size" functionality

 

getDataByBrand - get measurements by brand in a category. Used when implementing the "My size"functionality

To make a request, use cURL with the additional parameter secret

Input data
  • category - identifier of the category in the store (must match the LookSize clothing category) (one of the category or category_id parameters is required)
  • category_id - identifier of the LookSize clothing category (one of the category or category_id parameters is required)
  • userKey - identifier of the current user profile
Initial data
  • userSizeByBrand - a list of brands with specific user sizes
    "userSizeByBrand":{
    "9":{"brand":"adidas","ls_brand":"Adidas","size":{"world":"XS"}, "nearest":{"world":"S"} },
    "11":{"brand":"Nike","ls_brand":"Nike","size":{"world":"XS","eu":"32/34","us":"0/2","ua":"40/42"}},
    .....
    }