{"data":{"elements":[{"x":471,"image_url":"https:\/\/ai-result-rapidapi.ailabtools.com\/cutout\/segmentHair\/2024-06-13\/122108-5d6c46f6-bf35-7f1d-d606-f17d08a30164-1718281268.png","y":0,"height":604,"width":674}]},"error_code":0,"error_detail":{"status_code":200,"code":"","code_message":"","message":""},"log_id":"523E6370-C04C-53A6-B6CF-471337E2B22B","request_id":"523E6370-C04C-53A6-B6CF-471337E2B22B"}
curl --location 'https://zylalabs.com/api/4407/hairstyle+extraction+api/5416/hairstyle+extraction' \
--header 'Content-Type: application/json' \
--form 'image=@"FILE_PATH"'
After signing up, every developer is assigned a personal API access key, a unique combination of letters and digits provided to access to our API endpoint. To authenticate with the Hairstyle Extraction API simply include your bearer token in the Authorization header.
| Header | Description |
|---|---|
Authorization
|
Required
Should be Bearer access_key. See "Your API Access Key" above when you are subscribed.
|
No long-term commitment. Upgrade, downgrade, or cancel anytime.
Trusted by leading companies
The Hairstyle Extraction API offers advanced image recognition capabilities to accurately identify and isolate hairstyles from images. By focusing on the head region of the person in the image, this API precisely extracts the hairstyle and outputs it as a PNG file with a transparent background. This functionality is ideal for applications in virtual try-ons, fashion analysis, and digital content creation. Integrate the Hairstyle Extraction API to provide users with the ability to effortlessly separate hairstyles from their images, facilitating a wide range of creative and professional uses.


The Hairstyle Extraction API offers advanced image recognition capabilities to accurately identify and isolate hairstyles from images. By focusing on the head region of the person in the image, this API precisely extracts the hairstyle and outputs it as a PNG file with a transparent background.
Virtual Hairstyling Apps: Providing users with the ability to try on different hairstyles virtually by extracting and overlaying various haircuts onto their photos. Beauty and Fashion Industry: Assisting hairstylists, salons, and beauty professionals in showcasing different hairstyles and trends through virtual makeovers and consultations. E-commerce Platforms: Enhancing the visual representation of hair products, such as wigs, extensions, and hair accessories, by extracting and showcasing the hairstyles on models or mannequins.
Precision and Detail: Ensures accurate extraction of hairstyles, preserving intricate details and textures for realistic visualizations. Time Efficiency: Streamlines the hairstyling process, saving time for both users and professionals during consultations or virtual makeovers. Versatility: Applicable to a wide range of hairstyles, including short, long, curly, and straight, catering to diverse user preferences and needs. Visual Realism: Provides lifelike representations of hairstyles, allowing users to visualize how different looks will complement their facial features and overall appearance.
The Hairstyle Extraction API returns a JSON object containing the extracted hairstyle data, including the image URL, dimensions (width and height), and coordinates (x and y) for the extracted hairstyle.
The key fields in the response data include `image_url` (URL of the extracted hairstyle), `width` (width of the image), `height` (height of the image), `x` (top left x-coordinate), and `y` (top left y-coordinate).
The response data is structured as a JSON object with a `data` field containing an `elements` array. Each element in the array represents an extracted hairstyle with its associated properties.
The primary parameter for the Hairstyle Extraction endpoint is the `image`, which must be a file in supported formats (JPEG, JPG, BMP, PNG) and meet size and resolution requirements.
Users can utilize the returned data by accessing the `image_url` to download the extracted hairstyle image. The width and height can help in displaying the image correctly in applications, while the coordinates assist in positioning the hairstyle overlay.
Typical use cases include virtual wig try-ons, barbershop consultations, and fashion analysis, where users can visualize different hairstyles on their images for better decision-making.
Data accuracy is maintained through advanced image recognition algorithms that focus on precise segmentation of hairstyles, ensuring realistic and high-quality extractions from user-uploaded images.
If users receive partial or empty results, they should check the input image for compliance with the API's requirements (format, size, resolution) and ensure that the head region is clearly visible for optimal extraction.
To obtain your API key, first sign in to your account and navigate to the API you want to use. From the API's Pricing section, choose a plan and complete the subscription process. Once subscribed, return to the API page and you will see your API Access Key displayed at the top of the documentation page. You can use this key to authenticate your requests.
You can’t switch APIs during the free trial. If you subscribe to a different API, your trial will end and the new subscription will start as a paid plan.
The free trial lasts for 7 days and allows you to make up to 50 API requests.
No, the free trial is available only once, so we recommend using it on the API that interests you the most. Most of our APIs offer a free trial, but some may not include this option.
Yes. If the API offers a free trial, you will see a "Free 7-Day Trial" option in its Pricing section. The trial lasts for 7 days and allows up to 50 API requests, enabling you to evaluate the API before subscribing to a paid plan.
Zyla API Hub is like a big store for APIs, where you can find thousands of them all in one place. We also offer dedicated support and real-time monitoring of all APIs. Once you sign up, you can pick and choose which APIs you want to use. Just remember, each API needs its own subscription. But if you subscribe to multiple ones, you'll use the same key for all of them, making things easier for you.
You can monitor your API usage through the response headers included with every request:
x-zyla-api-calls-monthly-used: Shows the total number of API requests you have used during the current billing period.
x-zyla-api-calls-monthly-remaining: Shows the number of API requests you have remaining for the current billing period.
Yes, you can cancel your subscription at any time. Simply go to the Pricing section of the API you're subscribed to and click the "Unsubscribe" button.
Please note that upgrades, downgrades, and cancellations take effect immediately. Once your subscription is canceled, access to the service will end immediately, regardless of any remaining API calls in your quota.
Please have a look at our Refund Policy: https://zylalabs.com/terms#refund