The Hair Changer API offers developers a versatile tool to seamlessly integrate hair modification capabilities into their applications.
Developer Portal: https://api.market/store/magicapi/hair
This API supports essential functionalities such as changing hairstyles, modifying hair colors, and trying virtual haircuts. Developers can integrate these features into a wide range of applications, including virtual makeover apps, beauty salon booking platforms, or fashion styling tools.
Users can access the Hair Changer API securely through authentication using API keys, ensuring data privacy and security. Additionally, the API incorporates rate limits to manage usage and prevent abuse, promoting fair and efficient utilization.
Top Three Use Cases for Hair Changer API with Real Examples
Virtual Makeover Apps: Use Case:
- Individuals looking to experiment with new hairstyles without committing to a change can use virtual makeover apps powered by the Hair Changer API. This is particularly useful for people who are unsure about how a new style or color might look on them.
- Imagine Sarah, a busy professional who is considering a drastic hair color change. She’s unsure if she wants to go from blonde to a vibrant red. By using a virtual makeover app like “StyleMyHair,” she uploads her photo and instantly tries on various shades of red. This helps her visualize the potential change and make a confident decision before visiting the salon.
E-commerce Platforms for Hair Products: Use Case:
- Online stores selling hair extensions, wigs, or hair dye can integrate the Hair Changer API to allow customers to virtually try on products. This feature helps customers make more informed purchasing decisions, reducing returns and increasing satisfaction.
- John runs an online wig store called “GlamourLocks.” By integrating the Hair Changer API, customers can upload their photos and see themselves in different wig styles and colors. Lisa, a customer preparing for a costume party, uses this feature to find the perfect purple wig that matches her outfit, ensuring she’s happy with her purchase before it arrives.
Beauty and Salon Industry: Use Case:
- Salons can offer virtual consultations using the Hair Changer API, allowing clients to preview different hairstyles and colors before committing. This service enhances customer experience and helps stylists better understand client preferences.
- “Chic & Sleek Salon” integrates the Hair Changer API into their website. Emma, a first-time visitor, books a virtual consultation to explore potential hairstyles for her upcoming wedding. She uploads her photo and tries out various bridal hairstyles. The virtual preview helps her and the stylist agree on the perfect look for her big day, ensuring a stress-free salon visit.
Create a Hair Change Request
Submit an image to apply a specified hairstyle and color.
HTTP Request
POST /hair/hair
Request Headers
Header | Value |
---|---|
accept | application/json |
x-magicapi-key | YOUR_API_KEY |
Content-Type | application/json |
Request Body
Parameter | Type | Description |
---|---|---|
image | string | URL of the image to be edited |
editing_type | string | Type of editing: “both”, “color”, or “style” |
color_description | string | Description of the desired hair color |
hairstyle_description | string | Description of the desired hairstyle |
Example Request
curl -X 'POST' \
'https://api.magicapi.dev/api/v1/magicapi/hair/hair' \
-H 'accept: application/json' \
-H 'x-magicapi-key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"image": "https://replicate.delivery/mgxm/b8be17a7-abcb-4421-80f2-e6a1e3fe38c7/MarkZuckerberg.jpg",
"editing_type": "both",
"color_description": "blond",
"hairstyle_description": "hi-top fade hairstyle"
}'
Response
The response will contain a unique request ID used to track the status of the hair change request.
{
"request_id": "unique_request_id",
"status": "processing"
}
2. Get Hair Change Result
Retrieve the result of the hair change request using the request ID.
HTTP Request
GET /hair/predictions/REQUEST_ID
Request Headers
Header | Value |
---|---|
accept | application/json |
x-magicapi-key | YOUR_API_KEY |
Path Parameters
Parameter | Type | Description |
---|---|---|
REQUEST_ID | string | The unique request ID received after creating the hair change request |
Example Request
curl -X 'GET' \
'https://api.magicapi.dev/api/v1/magicapi/hair/predictions/unique_request_id' \
-H 'accept: application/json' \
-H 'x-magicapi-key: YOUR_API_KEY'
Parameters
color_description
would be – purple, red, orange, yellow, green, blue, gray, brown, black, white, blond, pink
hairstyle_description
would be these:
afro hairstyle
bob cut hairstyle
bowl cut hairstyle
braid hairstyle
caesar cut hairstyle
chignon hairstyle
cornrows hairstyle
crew cut hairstyle
crown braid hairstyle
curtained hair hairstyle
dido flip hairstyle
dreadlocks hairstyle
extensions hairstyle
fade hairstyle
fauxhawk hairstyle
finger waves hairstyle
french braid hairstyle
frosted tips hairstyle
full crown hairstyle
harvard clip hairstyle
high and tight hairstyle
hime cut hairstyle
hi-top fade hairstyle
jewfro hairstyle
jheri curl hairstyle
liberty spikes hairstyle
marcel waves hairstyle
mohawk hairstyle
pageboy hairstyle
perm hairstyle
pixie cut hairstyle
psychobilly wedge hairstyle
quiff hairstyle
regular taper cut hairstyle
ringlets hairstyle
shingle bob hairstyle
short hair hairstyle
slicked-back hairstyle
spiky hair hairstyle
surfer hair hairstyle
taper cut hairstyle
the rachel hairstyle
undercut hairstyle
updo hairstyle
No Comments
Leave a comment Cancel