API reference
Attack-data is labeled, real and AI-generated media built to stress-test deepfake detectors. You pull it here, organized into benchmarks that you select and filter by type. Authenticated with an API key and metered in credits. Test keys pull a free fixed sample. For the why behind attack-data, see the attack-data overview.
Getting started
The Python SDK is the quickest way to start: install it, paste in your key, and run it from a notebook cell or a script. Create a key in the portal first.
1!pip install margen2from margen import Margen3from margen.ergonomics import iter_items, download_selection # notebook helpers45client = Margen(bearer_auth="mgn_test_...") # <- paste your key from the portal67# Browsing the corpus is free: list benchmarks, then pick a few images.8benchmarks = client.list_benchmarks().data9items = client.list_items(10benchmark="synthetic-face-v1", kind="fake", skin_tone="dark", limit=3,11).result.data1213# Download one image. Test keys are free; live keys debit one credit.14dl = client.download_item(item_id=items[0].id)15print(dl.url) # short-lived signed URL, fetch it directly with no auth header
The typed operations are list_benchmarks, get_catalog, list_items, download_item, and get_usage; a list value for any filter is sent as a comma-separated list. list_items returns a paginated wrapper you read through .result (so .result.data), while the others return the object directly. For notebooks, margen.ergonomics adds iter_items / iter_lineages (paginate the whole result set) and download_selection (one-call bulk download to a folder). Other languages can call the REST endpoints directly (see the curl tab on each endpoint below).
Base URL
The base URL is https://www.margensoftware.com/api/v1/data; every endpoint is a path under it (for example /benchmarks or /items). Responses are JSON. Image bytes are never returned inline: a download returns a short-lived signed URL you fetch directly. The unversioned /api/data prefix is a permanent alias, so older integrations keep running.
1https://www.margensoftware.com/api/v1/data