Views
No views yet
1import requests
2
3url = "https://www.face-swap.co/api/generate"
4payload = {
5 "key": "YOUR_API_KEY",
6 "input_image_url": "https://tinyurl.com/elonmusk-faceswap",
7 "input_video_url": "https://tinyurl.com/ironman-faceswap",
8 "duration": 120, # required: 4 | 60 | 120 | 180 (use 4 for trial credits)
9 "gender": "all", # optional: all | female | male (default: all)
10}
11
12r = requests.post(url, json=payload, timeout=60)
13r.raise_for_status()
14print(r.json())| Parameter | Type | Required | Description |
|---|---|---|---|
key | string | ✅ | Your API key |
input_image_url | string | ✅ | Public URL to a face image |
input_video_url | string | ✅ | Public URL to a target video |
duration | int | ✅ | Allowed: 4, 60, 120, 180 seconds (use 4 for trial credits) |
gender | string | ❌ | all | female | male (default: all) |
1import requests
2
3url = "https://www.face-swap.co/api/generate"
4payload = {
5 "key": "YOUR_API_KEY",
6 "input_image_url": "https://tinyurl.com/elonmusk-faceswap",
7 "input_video_url": "https://tinyurl.com/ironman-faceswap",
8 "duration": 120, # required: 4|60|120|180 (use 4 for trial credits)
9 "gender": "all", # optional: all|female|male (default: all)
10}
11
12r = requests.post(url, json=payload, timeout=60)
13r.raise_for_status()
14print(r.json())1import requests
2
3job_id = "0c1449fc0e764b5ebdfe24a52bd8f8fa"
4r = requests.get(f"https://www.face-swap.co/api/status/{job_id}", timeout=30)
5r.raise_for_status()
6print(r.json())1import requests
2
3api_key = "YOUR_API_KEY"
4r = requests.get(f"https://www.face-swap.co/api/credits/{api_key}", timeout=30)
5r.raise_for_status()
6print(r.json())1import requests
2
3api_key = "YOUR_API_KEY"
4r = requests.get(f"https://www.face-swap.co/api/jobs/{api_key}", timeout=30)
5r.raise_for_status()
6print(r.json())
7