Skip to main content

markproof

Python client for the Markproof API — EU AI Act Article 50 watermarking and verification in one call. Thin wrapper over requests.

Is your AI output Article 50-ready? Drop a file into the free checker (no signup) to see whether it carries a watermark and signed Content Credentials.

Install

pip install markproof

Usage

from markproof import Markproof

client = Markproof(api_key="lt_live_...")

marked = client.mark("generated.png", generator_name="my-app", model_name="my-model-v1")
print(marked.watermark_code, marked.verify_url)
with open("generated-marked.png", "wb") as f:
    f.write(marked.file)

result = client.verify("generated-marked.png")
print(result.summary)

API

  • Markproof(api_key, base_url=DEFAULT_BASE_URL) — base_url defaults to the production API; override for local dev.
  • client.mark(file, filename=None, generator_name=None, model_name=None, response_format="file", visible_label=None, label_position=None) → MarkResult — file is a path (str/os.PathLike) or raw bytes (in which case filename is required). response_format="file" (default) returns the marked bytes inline (result.file/result.content_type); "url" returns a short-lived signed download URL instead (result.file_url, ~1 hour — download promptly rather than caching it). Either way you also get asset_id, watermark_code, verify_url, c2pa_manifest_label. visible_label (images only): True draws a visible "AI-generated" label (EU AI Act Art. 50(4)) before marking, or pass your own text (max 40 characters); label_position picks the corner ("bottom-right" default, "bottom-left", "top-right", "top-left").
  • client.verify(file, filename=None) or client.verify(url=...) → VerifyResult — watermark/c2pa detection results, matched_asset if the watermark matches a record in Markproof's database, and a human-readable summary. Direct uploads are limited to about 4.5 MB; pass a public url (up to 25 MB) for bigger files, such as marked audio, which comes back as WAV (e.g. a batch item's file_url).
  • client.get_asset(asset_id) → Asset — requires an API key on the same project that created the asset.

All methods raise MarkproofError (with .status and .body) on a non-2xx response.

Batches and webhooks

For volume, queue many files at once instead of calling mark per file. Each item counts as one mark.

created = client.create_batch(
    urls=["https://cdn.example.com/1.png", "https://cdn.example.com/2.png"],  # and/or files=["a.png", (data, "b.wav")]
    generator_name="your-app",
    webhook_url="https://your-app.example.com/hooks/markproof",  # optional
)
batch = client.wait_for_batch(created.batch_id)  # or get_batch(...), or wait for the webhook
for item in batch.items:
    print(item.index, item.status, item.file_url or item.error)
  • client.create_batch(files=None, urls=None, generator_name=None, model_name=None, webhook_url=None) → CreatedBatch — files go up in one multipart request (keep the total under ~4.5 MB; use urls for more). Max items per batch: 10 Free, 100 Indie, 1,000 Pro.
  • client.get_batch(batch_id) → Batch — status (queued/processing/completed/partial/failed), counts, and items with asset_id, watermark_code, verify_url, file_url (signed, ~1 hour; call again for a fresh one) or error.
  • client.wait_for_batch(batch_id, interval=3.0, timeout=900, on_progress=None) — polls until the batch is final.

Verify webhooks with the raw request body and your signing secret from the dashboard:

from markproof import verify_webhook_signature

ok = verify_webhook_signature(
    request.get_data(),  # the exact bytes received, not re-serialized JSON
    request.headers.get("Markproof-Signature"),
    os.environ["MARKPROOF_WEBHOOK_SECRET"],
)

parse_webhook_event(...) does the same and returns the batch.completed event, raising WebhookSignatureError if the signature doesn't match. Event ids are stable across retries, so use them to drop duplicates.

Metadata

Release files for markproof 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for markproof 0.3.0
File Size Uploaded Provenance Actions
markproof-0.3.0.tar.gz 15.0 kB Without provenance Details for markproof-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for markproof 0.3.0
File Interpreter ABI Platform Actions
markproof-0.3.0-py3-none-any.whl Python 3 none any Details for markproof-0.3.0-py3-none-any.whl

Total release size: 26.1 kB

Release files / markproof-0.3.0.tar.gz

Download URL markproof-0.3.0.tar.gz
Size 15.0 kB
Tags Source
SHA-256 checksum
How to use checksums
28fe37621f14e4a09644d477e3dba2412c791ecc7dcc6611e8e3e46db11c4daa
BLAKE2b-256 checksum
How to use checksums
ba3bb0743c1b515e4c903b8faa220d1ef4ea88b2c12afacca25322f45378eb83
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Release files / markproof-0.3.0-py3-none-any.whl

Download URL markproof-0.3.0-py3-none-any.whl
Size 11.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bb93d4d2b8f9b4f0209716c66ae2ee4696000c3dfa3796e1a265260e9ebbfc8b
BLAKE2b-256 checksum
How to use checksums
593537a85fb53f460029bb2048a41d87ac40ee5d0a0d3a2cb6d672253b0560fd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Security for markproof 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page