Classify 5 Hair Lengths Instantly with Structured AI Output
The Hair Length Detection API is a hair analysis API that classifies a person's hair length from one photo. It sorts each detection into one of five stages, from above the ears to long hair. Hair care brands, salons, and retailers use that result to drive product recommendations and consultations.





One API for Five Hair Length Results You Can Act On
Upload a front facing photo and the API returns the detected hair length as a single named value. Everything runs over standard REST, so the result drops straight into your recommendation logic.
- Returns a named hair length result based on five length categories
- Accepts a JPG or PNG photo uploaded through the file endpoint
- Asynchronous task model with a documented polling endpoint
Hair Length Classification in Every Response
Every detection resolves to a named stage, so your catalog logic always receives a value it can map.
- Five stages: above the ears, ear length, short hair, above chest, and long hair
- Supports “or longer” results when the exact result falls between two lengths
- Returns a simple value your app can use for recommendation logic

Turn Hair Length Analysis Into Personalized Product Recommendations
A detected stage is a clean key for the merchandising rules your team already maintains.
- Route each of the five stages to its own product set, bundle, or routine
- Pair the result with hair type or frizziness detection for a fuller hair profile
- Reuse the same mapping across web, mobile, and in store screens

Call the Hair Length Detection API From Any MCP Client
The capability is exposed through the YouCam MCP servers, so AI assistants and agents can run a detection directly.
- Available as the AI Hair Length Detection tool on the You Cam Beauty MCP server
- Works with Claude Desktop, Cursor, Copilot in VS Code, and other MCP clients
- Uses the same console API key as a Bearer token, so there is no second credential


Where Brands Deploy AI Hair Length Analysis

Recommend shampoos, treatments, and bundles that suit the shopper's detected hair length.

Give stylists a consistent starting point for hair length before a cut, color, or treatment plan.

Match shoppers to the extension or wig length that suits their current hair.
How to Use the Hair Length Detection API
Three calls take you from a user photo to a hair length your app can act on.

Send a photo to the file endpoint and keep the file ID it returns.

Post that file ID to the hair length detection endpoint and store the task ID.

Poll the task endpoint until it completes, then read the hair length result.

Hair Length Detection API Supports All Major Frameworks
Call the API from the stack you already run, or connect through the YouCam MCP servers, using the code snippets in the documentation.

JavaScript & Java

Flutter

Python

PHP

Node.js

cURL
Part of the Perfect Corp. AI & AR Ecosystem for Beauty and Fashion
Hair Length Detection draws on more than a decade of AI and AR development at Perfect Corp., trusted by over 800 beauty and fashion brand partners worldwide. Pair it with hair type, hair color, and hairstyle try-on APIs to build a complete hair experience.
Everything Developers Need to Ship Hair Length Detection Fast
For engineering teams, the API behaves the same way on every call, which is what makes it easy to build around.
- A fixed set of return values, so your mapping logic never meets a surprise string
- Named error codes that map cleanly to retry and retake handling
- Documented image limits and automatic resizing, plus code snippets in the docs

Flexible Hair Length API Plans for Every Scale
Start with free trial access and move into a plan as your traffic grows.
- Free credits included when you create your first API key for testing and integration
- Usage based plans that scale from pilot traffic through to full production
- Developer tools, sample code, SDKs, and the JS Camera Kit included
Hair Length Detection API FAQs
Bring AI Hair Length Analysis to Your Digital Experience
Talk to our team about rolling hair length detection out across your brand's web and mobile experiences.
