Hair Length Detection API

Power personalized hair care experiences with an API that classifies hair length into five stages, helping brands, salons, and retailers deliver relevant product recommendations.

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.

Woman with a cropped haircut above the ears, the shortest hair length the API detects
Above-Ear Length
Woman with a bob cut at ear level, detected as ear-length hair
Ear-Length
Woman with a chin-length bob, detected as short hair
Short Hair
Woman with shoulder-length hair above the chest, detected as medium-length hair
Medium-Length
Woman with long hair falling past the chest, detected as long hair
Long Hair

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
One model shown at all five hair length stages with matching hair silhouette icons and stage labels

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
Woman spraying a hair care product on long hair, with a long hair detection result and product inset

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
Hair length detection showing a medium-length result, linked through MCP to Claude, Cursor, Copilot, and VS Code

Where Brands Deploy AI Hair Length Analysis

Two shoppers tagged with medium-length and above-ear hair results beside matching hair care products
Hair Care E-Commerce

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

Stylist showing a client hair length options on a salon screen during a consultation
Salon Consultations

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

Shopper browsing hair extension and wig lengths on a tablet with a store associate
Extension and Wig Retail

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.

STEP1
step icon
Upload the Photo

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

STEP2
step icon
Start the Detection

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

STEP3
step icon
Read the Result

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

JavaScript & Java

Flutter

Flutter

Python

Python

PHP

PHP

Node.js

Node.js

cURL

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
Developer at a dual monitor setup reviewing hair length detection results and code

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.