Quick Start Guide
Make your first successful call in under five minutes.
Make your first successful call in under five minutes. This walkthrough uses the hairline endpoint because it needs only one image.
1. Get your key
Sign in at business.lushair.ai → Keys, create a key and copy it.
2. Pick an image
A JPEG or PNG file of a photo showing the hairline, at most 10 MiB and 4096x3072 pixels. Requirements: front view works best, good lighting, hair fully visible.
3. Call the API
curl -X POST https://api.lushair.ai/functions/v1/v1-hair/analysis_hairline \
-H "X-API-Key: YOUR_API_KEY" \
-F "[email protected]" \
-F 'meta={"gender":2,"age":30,"language":"en"}'Send the photo as a file. A JSON request with an image_url link returns 400 image_url_not_supported, and the call still counts.
Get English back. Put "language":"en" in meta, as in the example above. Leave it out and the response text comes back in Chinese.
4. Read the response
A real production response:
{
"code": 200,
"msg": "Analysis completed",
"data": {
"hair_scan_uuid": null,
"stage": { "value": 4, "conf": 0.152 },
"pattern": { "value": 2, "conf": 0.378 },
"position": { "value": 1, "conf": 1.0 },
"status": "ok",
"source_url": "inline",
"url": "https://api.lushair.ai/storage/v1/object/sign/api-scans/.../hairline.jpg?token=..."
}
}What the fields mean:
stage— hair loss stage on a 1–7 scale aligned to the Norwood reference.valueis the classification,confis the model's confidence in it.pattern— hairline pattern class. Display the label for the value, never the raw number: value meanings were redefined on 2026-07-02, so any mapping written before that date is wrong.position— which capture position the model detected in the image.url— an annotated copy of the input image rendered by the service, useful for showing users what was detected. The link expires after 1 hour: download the image right away if you need to keep it.
Confidence matters. Astagewithconfof 0.15 is a weak classification — the image angle or lighting probably didn't suit the model. Surface low-confidence results differently in your product (for example "possible stage 4" rather than "stage 4"), and prompt for a better photo whenconfis below your threshold.
5. Handle the two errors you'll actually hit
Wrong base URL → 404. Hair endpoints live under https://api.lushair.ai/functions/v1/v1-hair, skin on api.glamskin.ai. This is the most common integration mistake.
Missing field → 400 with the field named. The msg tells you exactly which parameter is absent. Note that some endpoints take other fields. analysis_hair_full takes one file per position and light, such as pos1_led. analysis_hair_spectrum and analysis_follicle_miniappv2 take JSON only, with each image as a base64 data URL (data:image/jpeg;base64,...).
Next steps
- Authentication — error reference, domains, timeouts
- API Reference — every endpoint with schemas and a live console
- Multi-position dermascope analysis: same pattern, more images, up to 21 per call; set a client timeout of at least 60 seconds
Updated 13 days ago
