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
  1. API Product Docs
  2. MagicAPI

🎭 FaceSwap API: Instantaneous replaces face with one another

The Faceswap API is a testament to the power of artificial intelligence and deep learning.

Seamlessly Swap Faces Between Images in Seconds Instantly create captivating face swaps: Our cutting-edge API lets you seamlessly blend two faces.

About

The FaceSwap API provides a robust and efficient solution for developers looking to integrate face-swapping capabilities into their applications. By simply providing URLs of two images, this API can swap the faces between them, producing a new image that combines elements of both originals.

Key Features:

  • Fast and Reliable: Our API consistently returns results in under 30 seconds, ensuring a smooth and efficient user experience.

  • Cost-Effective: Designed with efficiency in mind, this API offers competitive pricing, making it accessible for projects of all sizes.

  • High-Quality Outputs: Utilize advanced algorithms to ensure high-quality face swaps with natural-looking results.

  • Content Filtering: The API automatically filters out NSFW content, ensuring that it is not processed.

Content Restrictions: Please note that the FaceSwap API does not process nude or NSFW (Not Safe For Work) images. If you encounter any errors or if the API incorrectly flags some of your images as NSFW, please contact our support team for assistance. We are committed to providing accurate and efficient service, and we will help resolve your issues promptly.

Example Use Case: Imagine swapping the face of Elon Musk onto the image of Shahrukh Khan. Provide the API with URLs for both images, and within seconds, receive a new image where Elon Musk's face is seamlessly integrated onto Shahrukh Khan's body.

Example Request:

curl -X 'POST' \
  'https://api.magicapi.dev/api/v1/magicapi/faceswap/' \
  -H 'accept: application/json' \
  -H 'x-magicapi-key: you-api-key' \
  -H 'Content-Type: application/json' \
  -d '{
  "input": {
    "swap_image": "https://blog.api.market/wp-content/uploads/2024/06/Elon_Musk.png",
    "target_image": "https://blog.api.market/wp-content/uploads/2024/06/Shahrukh_khan.png"
  }
}'

Example Response:

{
    "output": "https://blog.api.market/wp-content/uploads/2024/06/face_swap_elon_shahrukh.jpeg"
}

Visual Examples:

Input Images:

Resulting Image:

Why Choose FaceSwap API? Unlike other face-swapping technologies, our API is not only fast but also reliably returns results within a 30-second window, regardless of the server load. This makes it an excellent choice for applications requiring real-time processing and consistent performance. The added security of automatic NSFW content filtering ensures that your application remains appropriate for all users.

Integrate the FaceSwap API into your application today to add a fun and engaging element that impresses your users with both speed and quality!

Curl Requests and Responses

Process the image

curl -X 'POST' \
  'https://api.magicapi.dev/api/v1/magicapi/faceswap/faceswap' \
  -H 'accept: application/json' \
  -H 'x-magicapi-key: API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "swap_image": "SWAP_IMAGE",
  "target_image": "TARGET_IMAGE"
}'
import requests

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

json_data = {
    'swap_image': 'SWAP_IMAGE',
    'target_image': 'TARGET_IMAGE',
}

response = requests.post('https://api.magicapi.dev/api/v1/magicapi/faceswap/faceswap', headers=headers, json=json_data)
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.magicapi.dev/api/v1/magicapi/faceswap/faceswap');
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  \"swap_image\": \"SWAP_IMAGE\",\n  \"target_image\": \"TARGET_IMAGE\"\n}");

$response = curl_exec($ch);

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

const response = await axios.post(
  'https://api.magicapi.dev/api/v1/magicapi/faceswap/faceswap',
  {
    'swap_image': 'SWAP_IMAGE',
    'target_image': 'TARGET_IMAGE'
  },
  {
    headers: {
      'accept': 'application/json',
      'x-magicapi-key': 'API_KEY',
      'Content-Type': 'application/json'
    }
  }
);
fetch('https://api.magicapi.dev/api/v1/magicapi/faceswap/faceswap', {
  method: 'POST',
  headers: {
    'accept': 'application/json',
    'x-magicapi-key': 'API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    'swap_image': 'SWAP_IMAGE',
    'target_image': 'TARGET_IMAGE'
  })
});
{
  "output": "https://d3tx3wg2jy0sui.cloudfront.net/ca645194-a94d-4727-b543-a56ab0cfb76c.jpg"
}
PreviousCoding AssistantNext🏞️ Image Upload API

Last updated 10 months ago

Developer Portal:

image
https://api.market/store/magicapi/faceswap