Documentation / Quickstart

Deepfake Detection API Quickstart

Get up and running with deepfake detection in 5 minutes. This guide walks you through getting your API key, installing the SDK, and analyzing your first media file.

1. Get Your API Key

Sign up for a free account to get your API key. The free tier includes 500 media scans per month — no credit card required.

Your API key will look like: df_live_abc123...

2. Install the SDK

Install the official SDK for your language, or use the REST API directly with cURL.

Python
pip install deepfake-detection
JavaScript
npm install deepfake-detection

3. Detect a Deepfake Image

Submit an image for deepfake analysis. The API returns a confidence score, manipulation type, and optional heatmap overlay.

Python
import requests

response = requests.post(
    "https://deepfakedetectionapi.com/v1/detect",
    headers={"Authorization": "Bearer df_live_your_key"},
    files={"media": open("suspect_image.jpg", "rb")}
)

result = response.json()
print(result["score"])       # 0.97
print(result["manipulation"]) # "face_swap"
print(result["confidence"])   # "very_high"
JavaScript
const form = new FormData();
form.append("media", fs.createReadStream("suspect_image.jpg"));

const response = await fetch(
  "https://deepfakedetectionapi.com/v1/detect",
  {
    method: "POST",
    headers: { Authorization: "Bearer df_live_your_key" },
    body: form,
  }
);

const result = await response.json();
console.log(result.score);        // 0.97
console.log(result.manipulation); // "face_swap"
cURL
curl -X POST https://deepfakedetectionapi.com/v1/detect \
  -H "Authorization: Bearer df_live_your_key" \
  -F "media=@suspect_image.jpg"

4. Analyze a Video

Video analysis provides frame-by-frame deepfake probability scores and temporal consistency analysis. Use the frame_analysis mode for detailed per-frame results.

Python — Video Analysis
response = requests.post(
    "https://deepfakedetectionapi.com/v1/detect",
    headers={"Authorization": "Bearer df_live_your_key"},
    files={"media": open("suspect_video.mp4", "rb")},
    data={"mode": "frame_analysis"}
)

result = response.json()
print(result["score"])          # 0.94
print(result["frames_analyzed"]) # 842
print(result["manipulation"])    # "lip_sync"

# Per-frame scores available in result["frames"]
for frame in result["frames"][:5]:
    print(f"Frame {frame['index']}: {frame['score']}")

5. Understand the Response

Every detection response includes a structured JSON payload with the following fields:

Response Schema
{
  "id": "det_abc123",
  "score": 0.97,           // 0 (authentic) to 1 (deepfake)
  "label": "deepfake",     // "authentic" | "deepfake" | "uncertain"
  "confidence": "very_high", // "low" | "medium" | "high" | "very_high"
  "manipulation": "face_swap", // detected manipulation type
  "media_type": "image",   // "image" | "video" | "audio"
  "heatmap_url": "https://...", // manipulation heatmap (optional)
  "frames_analyzed": null,  // frame count (video only)
  "processing_time_ms": 342
}