Skip to main content

Introduction to RealAPI

Build Reality Defender into your stack. Learn how to access and authenticate, understand versioning and visibility, explore sample code, and see how the API differs from the web app, plus details on performance, scaling, and volume.

Emily Essig avatar
Written by Emily Essig
Updated over a week ago

๐Ÿ“˜ Full API documentation can be found at docs.realitydefender.com

RealScan vs RealAPI

The Reality Defender Web App is ideal for:

  • Immediate, one-off scans

  • Manual upload of up to 10 files at a time

  • Instant, color-coded results and downloadable PDF report cards

The Reality Defender API is ideal for:

  • Large-scale, automated detection

  • Integrating deepfake detection directly into your backend, CMS, or verification flow

  • Scanning thousands (or millions) of assets in real time

If you have access to our web app, you already have access to the API. Both use the same credentials and authentication layer.


Quickstart: Upload & Retrieve via API (Python)

1. Upload a file

import requests, os, sys

def get_signed_url(filename, token):

url = "https://api.prd.realitydefender.xyz/api/files/aws-presigned"

filesize = os.path.getsize(filename)

payload = {"fileName": filename, "fileSize": filesize}

headers = {"x-api-key": token, "Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

return response.json()

def upload_file(filename, token, signed_url):

with open(filename, 'rb') as file:

file_data = file.read()

response = requests.put(signed_url, data=file_data)

response.raise_for_status()

print(f"โœ… Upload successful: {filename}")

token = "ENTER_API_KEY_HERE"

path = sys.argv[1]

signed_url = get_signed_url(path, token)["response"]["signedUrl"]

upload_file(path, token, signed_url)

2. Retrieve analysis results

import requests, sys

def get_media_detail(request_id, token):

url = f"https://api.prd.realitydefender.xyz/api/media/users/{request_id}"

headers = {"x-api-key": token, "Content-Type": "application/json"}

response = requests.get(url, headers=headers)

return response.json()

token = "ENTER_API_KEY_HERE"

request_id = sys.argv[1] if len(sys.argv) == 2 else ""

print(get_media_detail(request_id, token))

๐Ÿ“˜ Full API documentation: docs.realitydefender.com


A few key detailsโ€ฆ

  • Versioning: Every API authentication returns a version number. This number increments with each update to ensure compatibility and prevent breaking changes.
    โ€‹

  • Access Tokens: Each account needs its own API token. Tokens should not be shared between users.
    โ€‹

  • Performance & Scaling: The Reality Defender platform automatically scales up and down based on system load.
    โ€‹

  • Access by Plan Type:

    • Free API:

      • Any user with a Reality Defender can process up to 50 scans (image, audio, text) on our Free API. Social media link downloads are not supported for free users.

    • Developer Plan:

      • Developer Plan subscribers can process up to 1000 scans a month (image, audio, text, or video), on our API, and can use social media link sources.

    • Enterprise Plan:

      • Enterprise subscribers with custom plans have full access to our API to scan media from all modalities and social link sources.

Did this answer your question?