The FaceSwap Image & Video API offers a straightforward solution for replacing faces in images and videos. With over 500% cost savings compared to other services, it is the most affordable and reliable option available. This face swap AI API enables seamless face swapping using simple HTTP POST requests, making it ideal for developers looking to integrate face-swapping functionality into their applications.
Key Features
High-quality face swapping technology: Our API utilizes state-of-the-art algorithms to ensure seamless and realistic face swaps in both images and videos.
Easy integration: Comprehensive documentation and straightforward implementation make integrating our API into your project quick and hassle-free.
Customization options: Tailor the faceswap experience to suit your needs with customizable parameters for face detection, alignment, and blending.
Scalability and reliability: Built to handle high volumes of requests with minimal latency, ensuring a smooth and reliable user experience.
Benefits
Create hilarious memes, captivating social media content, and personalized experiences for your users.
Add fun filters to your mobile app, create entertaining videos for your social media platforms, or enhance your marketing campaigns with interactive experiences.
Description
The FaceSwap Image & Video API provides developers with the ability to perform face swaps in both images and videos with minimal effort. By leveraging the power of HTTP POST requests, this top face-swap API allows you to specify target and swap URLs to perform the face-swapping operation. The service is designed to be highly reliable and affordable, ensuring that developers can integrate face-swapping features without worrying about excessive costs.
Key Features:
Image Face Swap : Replace faces in images using a simple POST request with the best face swap API.
Video Face Swap : Perform face swaps in videos seamlessly with our video face swap API.
Cost-Effective : Over 500% cheaper than other face-swapping APIs.
Easy Integration : Simple HTTP POST requests for quick and easy integration.
Reliable Service : Consistent and dependable performance.
How to Use
Image Face Swap:
Endpoint : https://api.magicapi.dev/api/v1/capix/faceswap/faceswap/v1/image
Headers :
x-magicapi-key: YOUR_API_KEY
Content-Type: application/x-www-form-urlencoded
Data :
target_url
: URL of the image in which the face needs to be swapped.
swap_url
: URL of the image containing the face to be swapped in.
Example Request:
Copy curl -X 'POST' \
'https://api.magicapi.dev/api/v1/capix/faceswap/faceswap/v1/image' \
-H 'accept: application/json' \
-H 'x-magicapi-key: YOUR_API_KEY' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'target_url=https%3A%2F%2Fstorage.ws.pho.to%2Fs2%2F7aa4876bc1f50bc92fc54cb3c326181ac5bbf5ef_m.jpeg&swap_url=https%3A%2F%2Fstorage.ws.pho.to%2Fs2%2F818f3e408ee37c090cf23a3d12e15a08ada80ad9_m.jpeg'
Video Face Swap:
Endpoint : https://api.magicapi.dev/api/v1/capix/faceswap/faceswap/v1/video
Headers :
x-magicapi-key: YOUR_API_KEY
Content-Type: application/x-www-form-urlencoded
Data :
target_url
: URL of the video in which the face needs to be swapped.
swap_url
: URL of the image containing the face to be swapped in.
Example Request:
Copy curl -X 'POST' \
'https://api.magicapi.dev/api/v1/capix/faceswap/faceswap/v1/video' \
-H 'accept: application/json' \
-H 'x-magicapi-key: YOUR_API_KEY' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'target_url=https://storage.ws.pho.to/s2/7e2131eaef5e5cbb0d2c9eef7e2f19343b5a1292.mp4&swap_url=https%3A%2F%2Fstorage.ws.pho.to%2Fs2%2F818f3e408ee37c090cf23a3d12e15a08ada80ad9_m.jpeg'
Retrieve Face Swap Result:
Endpoint : https://api.magicapi.dev/api/v1/capix/faceswap/result/
Headers :
x-magicapi-key: YOUR_API_KEY
Content-Type: application/x-www-form-urlencoded
Data :
request_id
: The unique request ID received after initiating the face swap.
Example Request:
Copy curl -X 'POST' \
'https://api.magicapi.dev/api/v1/capix/faceswap/result/' \
-H 'accept: application/json' \
-H 'x-magicapi-key: YOUR_API_KEY' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'request_id=16bbe697-1323-4ead-9104-30a65ba52149'
Note: The Video Faceswap API is limited to a maximum duration of 4 seconds, even on premium or other plans. Additionally, this API cannot be used for any NSFW content or images, as that violates our policy.
By following these steps, developers can easily integrate face-swapping functionality into their applications using the FaceSwap API. Whether you need an image face swap API, video face swap API, or even a free face swap API for trial purposes, this service provides the most reliable and cost-effective solution on the market.
Image Process
Curl Python PHP NodeJs Javascript
Copy curl -X 'POST' \
'https://api.magicapi.dev/api/v1/capix/faceswap/faceswap/v1/image' \
-H 'accept: application/json' \
-H 'x-magicapi-key: API_KEY' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'target_url=https%3A%2F%2Fstorage.ws.pho.to%2Fs2%2F7aa4876bc1f50bc92fc54cb3c326181ac5bbf5ef_m.jpeg&swap_url=https%3A%2F%2Fstorage.ws.pho.to%2Fs2%2F818f3e408ee37c090cf23a3d12e15a08ada80ad9_m.jpeg'
Copy import requests
headers = {
'accept' : 'application/json' ,
'x-magicapi-key' : 'API_KEY' ,
'Content-Type' : 'application/x-www-form-urlencoded' ,
}
data = {
'target_url' : 'https://storage.ws.pho.to/s2/7aa4876bc1f50bc92fc54cb3c326181ac5bbf5ef_m.jpeg' ,
'swap_url' : 'https://storage.ws.pho.to/s2/818f3e408ee37c090cf23a3d12e15a08ada80ad9_m.jpeg' ,
}
response = requests.post('https://api.magicapi.dev/api/v1/capix/faceswap/faceswap/v1/image', headers=headers, data=data)
Copy <? php
$ch = curl_init () ;
curl_setopt ( $ch , CURLOPT_URL , 'https://api.magicapi.dev/api/v1/capix/faceswap/faceswap/v1/image' ) ;
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/x-www-form-urlencoded' ,
] ) ;
curl_setopt($ch, CURLOPT_POSTFIELDS, 'target_url=https%3A%2F%2Fstorage.ws.pho.to%2Fs2%2F7aa4876bc1f50bc92fc54cb3c326181ac5bbf5ef_m.jpeg&swap_url=https%3A%2F%2Fstorage.ws.pho.to%2Fs2%2F818f3e408ee37c090cf23a3d12e15a08ada80ad9_m.jpeg');
$response = curl_exec ( $ch ) ;
curl_close ( $ch ) ;
Copy import axios from 'axios' ;
const response = await axios .post (
'https://api.magicapi.dev/api/v1/capix/faceswap/faceswap/v1/image' ,
new URLSearchParams ({
'target_url' : 'https://storage.ws.pho.to/s2/7aa4876bc1f50bc92fc54cb3c326181ac5bbf5ef_m.jpeg' ,
'swap_url' : 'https://storage.ws.pho.to/s2/818f3e408ee37c090cf23a3d12e15a08ada80ad9_m.jpeg'
}) ,
{
headers : {
'accept' : 'application/json' ,
'x-magicapi-key' : 'API_KEY'
}
}
);
Copy fetch ( 'https://api.magicapi.dev/api/v1/capix/faceswap/faceswap/v1/image' , {
method : 'POST' ,
headers : {
'accept' : 'application/json' ,
'x-magicapi-key' : 'API_KEY'
} ,
body : new URLSearchParams ({
'target_url' : 'https://storage.ws.pho.to/s2/7aa4876bc1f50bc92fc54cb3c326181ac5bbf5ef_m.jpeg' ,
'swap_url' : 'https://storage.ws.pho.to/s2/818f3e408ee37c090cf23a3d12e15a08ada80ad9_m.jpeg'
})
});
Video Process
Curl Python PHP NodeJs Javascript
Copy curl -X 'POST' \
'https://api.magicapi.dev/api/v1/capix/faceswap/faceswap/v1/video' \
-H 'accept: application/json' \
-H 'x-magicapi-key: API_KEY' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'target_url=https://storage.ws.pho.to/s2/7e2131eaef5e5cbb0d2c9eef7e2f19343b5a1292.mp4&swap_url=https%3A%2F%2Fstorage.ws.pho.to%2Fs2%2F818f3e408ee37c090cf23a3d12e15a08ada80ad9_m.jpeg'
Copy import requests
headers = {
'accept' : 'application/json' ,
'x-magicapi-key' : 'API_KEY' ,
'Content-Type' : 'application/x-www-form-urlencoded' ,
}
data = {
'target_url' : 'https://storage.ws.pho.to/s2/7e2131eaef5e5cbb0d2c9eef7e2f19343b5a1292.mp4' ,
'swap_url' : 'https://storage.ws.pho.to/s2/818f3e408ee37c090cf23a3d12e15a08ada80ad9_m.jpeg' ,
}
response = requests.post('https://api.magicapi.dev/api/v1/capix/faceswap/faceswap/v1/video', headers=headers, data=data)
Copy <? php
$ch = curl_init () ;
curl_setopt ( $ch , CURLOPT_URL , 'https://api.magicapi.dev/api/v1/capix/faceswap/faceswap/v1/video' ) ;
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/x-www-form-urlencoded' ,
] ) ;
curl_setopt($ch, CURLOPT_POSTFIELDS, 'target_url=https://storage.ws.pho.to/s2/7e2131eaef5e5cbb0d2c9eef7e2f19343b5a1292.mp4&swap_url=https%3A%2F%2Fstorage.ws.pho.to%2Fs2%2F818f3e408ee37c090cf23a3d12e15a08ada80ad9_m.jpeg');
$response = curl_exec ( $ch ) ;
curl_close ( $ch ) ;
Copy import axios from 'axios' ;
const response = await axios .post (
'https://api.magicapi.dev/api/v1/capix/faceswap/faceswap/v1/video' ,
new URLSearchParams ({
'target_url' : 'https://storage.ws.pho.to/s2/7e2131eaef5e5cbb0d2c9eef7e2f19343b5a1292.mp4' ,
'swap_url' : 'https://storage.ws.pho.to/s2/818f3e408ee37c090cf23a3d12e15a08ada80ad9_m.jpeg'
}) ,
{
headers : {
'accept' : 'application/json' ,
'x-magicapi-key' : 'API_KEY'
}
}
);
Copy fetch ( 'https://api.magicapi.dev/api/v1/capix/faceswap/faceswap/v1/video' , {
method : 'POST' ,
headers : {
'accept' : 'application/json' ,
'x-magicapi-key' : 'API_KEY'
} ,
body : new URLSearchParams ({
'target_url' : 'https://storage.ws.pho.to/s2/7e2131eaef5e5cbb0d2c9eef7e2f19343b5a1292.mp4' ,
'swap_url' : 'https://storage.ws.pho.to/s2/818f3e408ee37c090cf23a3d12e15a08ada80ad9_m.jpeg'
})
});
Get Result
Curl Python PHP NodeJs Javscript
Copy curl -X 'POST' \
'https://api.magicapi.dev/api/v1/capix/faceswap/result/' \
-H 'accept: application/json' \
-H 'x-magicapi-key: API_KEY' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'request_id=16bbe697-1323-4ead-9104-30a65ba52149'
Copy import requests
headers = {
'accept' : 'application/json' ,
'x-magicapi-key' : 'API_KEY' ,
'Content-Type' : 'application/x-www-form-urlencoded' ,
}
data = {
'request_id' : 'REQUEST_ID' ,
}
response = requests . post ( 'https://api.magicapi.dev/api/v1/capix/faceswap/result/' , headers = headers, data = data)
Copy <? php
$ch = curl_init () ;
curl_setopt ( $ch , CURLOPT_URL , 'https://api.magicapi.dev/api/v1/capix/faceswap/result/' ) ;
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/x-www-form-urlencoded' ,
] ) ;
curl_setopt ( $ch , CURLOPT_POSTFIELDS , 'request_id=REQUEST_ID' ) ;
$response = curl_exec ( $ch ) ;
curl_close ( $ch ) ;
Copy import axios from 'axios' ;
const response = await axios .post (
'https://api.magicapi.dev/api/v1/capix/faceswap/result/' ,
new URLSearchParams ({
'request_id' : 'REQUEST_ID'
}) ,
{
headers : {
'accept' : 'application/json' ,
'x-magicapi-key' : 'API_KEY'
}
}
);
Copy fetch ( 'https://api.magicapi.dev/api/v1/capix/faceswap/result/' , {
method : 'POST' ,
headers : {
'accept' : 'application/json' ,
'x-magicapi-key' : 'API_KEY'
} ,
body : new URLSearchParams ({
'request_id' : 'REQUEST_ID'
})
});