API.Market
Go to API.market
  • Welcome to API.market
  • What are API Products?
  • How to subscribe to a SaaS API Product?
  • Managing Subscriptions
  • Analytics & Logs
  • How can I cancel my Subscription?
  • How do I add payment details?
  • How does API.market charges me?
  • Error Codes
  • Seller Docs
    • API Seller Console
    • What is an API Product?
    • What is a Pricing Plan
    • Importing an API Source
    • Creating a Product using the Wizard
    • Testing Your APIs & Products
    • Analytics & Logs
    • Custom Usage
    • Overriding Custom Usage on Result Retrieval
  • FUNDAMENTALS
    • Convert Postman Collection to OpenAPI Yaml
    • Create OpenAPI spec using ChatGPT
  • About Us
  • API Product Docs
    • MagicAPI
      • Screenshot API
      • Domain Availability Checker API
      • WhoIS API
      • PDF Conversion API
      • Image Upscale API
      • DNS Checker API
      • Ageify API
      • Image Restoration API
      • Toon Me API
      • Coding Assistant
      • 🎭 FaceSwap API: Instantaneous replaces face with one another
      • 🏞️ Image Upload API
      • Deblurer API
      • Hair Changer API
      • 🤳🏻🤖AI Qr Code Generator API
      • Whisper API
      • Image Colorizer API
      • OpenJourney API
      • Object Remover API
      • Image Captioner API
      • Object Detector API
      • NSFW API
      • Crunchbase API
      • Pipfeed's Extract API Developer Documentation
      • Migrating from Capix FaceSwap API to magicapi/faceswap-capix API
    • BridgeML
      • Meta-Llama-3-8B-Instruct
      • Meta-Llama-3-70B-Instruct
      • Mistral-7B-Instruct-v0.1
      • Mixtral-8x22B-Instruct-v0.1
      • Meta-Llama-2-7b
      • Meta-Llama-2-13b
      • Meta-Llama-2-70b
      • Gemma-7b-it
      • NeuralHermes-2.5-Mistral-7B
      • BAAI/bge-large-en-v1.5
      • CodeLlama-70b-Instruct-hf
      • 🤖🧗Text-to-Image API
      • 📝🎧 Text to Audio API
    • Capix AI
      • FaceSwap Image and Video Face Swap API
      • MakeUp
      • Photolab.me
      • AI Picture Colorizer
      • AI Picture Upscaler
      • AI Background Remover
      • Object Remover
      • TTS Universal
      • Home GPT
      • AI & Plagiarism Checker
      • AI Story Generator
      • AI Essay Generator
      • Book Title Generator
    • Trueway
      • ⛕ 🗺️ Trueway Routing API
      • 🌐📍Trueway Geocoding API: Forward and Reverse Geocoding
      • 🛤️ ⏱️Trueway Matrix API: Travel Distance and Time
      • 🏛️ Trueway Places API
    • AILabTools
      • Cartoon-Yourself
    • SharpAPI
      • 📄 AI-Powered Resume/CV Parsing API
      • 🛩️ Airports Database & Flight Duration API
    • Text to Speech
      • Turn your text into Magical-sounding Audio
Powered by GitBook
On this page
  • About
  • Curl Requests and Responses
  • Parameters
  1. API Product Docs
  2. MagicAPI

Hair Changer API

The Hair Changer API offers developers a versatile tool to seamlessly integrate hair modification capabilities into their applications.

PreviousDeblurer APINext🤳🏻🤖AI Qr Code Generator API

Last updated 1 year ago

About

This API empowers users to effortlessly explore various hairstyles, experiment with hair colors, and virtually try out different haircuts, all through simple API endpoints.

With the Hair Changer API, developers can enable users to upload their images and apply desired changes to their hairstyles or hair colors in real-time. By leveraging this API, developers can enhance user experiences by providing them with personalized and interactive features related to hair styling.

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.

For developers seeking to enhance their applications with hair modification capabilities, the Hair Changer API offers comprehensive documentation, error handling support, and dedicated customer assistance. Get started today and bring dynamic hair styling functionalities to your applications with ease.

Developer Portal:

image

Curl Requests and Responses

Process the image

curl -X 'POST' \
  'https://api.magicapi.dev/api/v1/magicapi/hair/hair' \
  -H 'accept: application/json' \
  -H 'x-magicapi-key: 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"
}'
import requests

headers = {
    'accept': 'application/json',
    'x-magicapi-key': 'API_KEY',
    'Content-Type': 'application/json',
}

json_data = {
    '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 = requests.post('https://api.magicapi.dev/api/v1/magicapi/hair/hair', headers=headers, json=json_data)
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.magicapi.dev/api/v1/magicapi/hair/hair');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'accept: application/json',
    'x-magicapi-key: API_KEY',
    'Content-Type: application/json',
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, "{\n  \"image\": \"https://replicate.delivery/mgxm/b8be17a7-abcb-4421-80f2-e6a1e3fe38c7/MarkZuckerberg.jpg\",\n  \"editing_type\": \"both\",\n  \"color_description\": \"blond\",\n  \"hairstyle_description\": \"hi-top fade hairstyle\"\n}");

$response = curl_exec($ch);

curl_close($ch);
import axios from 'axios';

const response = await axios.post(
  'https://api.magicapi.dev/api/v1/magicapi/hair/hair',
  {
    'image': 'https://replicate.delivery/mgxm/b8be17a7-abcb-4421-80f2-e6a1e3fe38c7/MarkZuckerberg.jpg',
    'editing_type': 'both',
    'color_description': 'blond',
    'hairstyle_description': 'hi-top fade hairstyle'
  },
  {
    headers: {
      'accept': 'application/json',
      'x-magicapi-key': 'API_KEY',
      'Content-Type': 'application/json'
    }
  }
);
fetch('https://api.magicapi.dev/api/v1/magicapi/hair/hair', {
  method: 'POST',
  headers: {
    'accept': 'application/json',
    'x-magicapi-key': 'API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    'image': 'https://replicate.delivery/mgxm/b8be17a7-abcb-4421-80f2-e6a1e3fe38c7/MarkZuckerberg.jpg',
    'editing_type': 'both',
    'color_description': 'blond',
    'hairstyle_description': 'hi-top fade hairstyle'
  })
});
{
  "request_id": REQUEST_ID
}

Get the result

curl -X 'GET' \
  'https://api.magicapi.dev/api/v1/magicapi/hair/predictions/REQUEST_ID' \
  -H 'accept: application/json' \
  -H 'x-magicapi-key: API_KEY'
import requests

headers = {
    'accept': 'application/json',
    'x-magicapi-key': 'API_KEY',
}

response = requests.get('https://api.magicapi.dev/api/v1/magicapi/hair/predictions/REQUEST_ID', headers=headers)
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.magicapi.dev/api/v1/magicapi/hair/predictions/REQUEST_ID');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'accept: application/json',
    'x-magicapi-key: API_KEY',
]);

$response = curl_exec($ch);

curl_close($ch);
import axios from 'axios';

const response = await axios.get('https://api.magicapi.dev/api/v1/magicapi/hair/predictions/REQUEST_ID', {
  headers: {
    'accept': 'application/json',
    'x-magicapi-key': 'API_KEY'
  }
});
fetch('https://api.magicapi.dev/api/v1/magicapi/hair/predictions/REQUEST_ID', {
  headers: {
    'accept': 'application/json',
    'x-magicapi-key': 'API_KEY'
  }
});
{
  "status": "succeeded",
  "result": "RESULT_URL"
}

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
https://api.market/store/magicapi/hair