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=None, 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" (the default for small images and audio) 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.

Video and large files (launches with video)

mark and verify also take url= (https, up to 25 MB) or upload_id= instead of file. Video, and any file over about 4 MB, is sent through a direct upload automatically: the SDK asks the API for a signed upload URL, PUTs the file straight to storage (up to 100 MB), then marks or verifies it by id. For these, response_format defaults to "url", because the marked file is too big to come back inline. Call client.upload(file, filename=None) → upload_id to do the upload yourself; each upload can be used once. result.calls_used says how many quota calls a mark used: 1 per image or audio file, one per started second of video. Until video launches, the upload step fails with a 404 MarkproofError saying so; pass url= for big files meanwhile.

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.4.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.4.0
File Size Uploaded Provenance Actions
markproof-0.4.0.tar.gz 17.9 kB Without provenance Details for markproof-0.4.0.tar.gz

Built distribution (wheel)

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

Total release size: 30.7 kB

Release files / markproof-0.4.0.tar.gz

Download URL markproof-0.4.0.tar.gz
Size 17.9 kB
Tags Source
SHA-256 checksum
How to use checksums
6834b790b2eae0ae4cb97d8eb56ce41d787cb27f7c3690ca325675f3c9aa821d
BLAKE2b-256 checksum
How to use checksums
d3a97ce0caa6297c5bb3f5d1b60e7265cd11f38ee4c9cf547df4bb42646cd31d
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.4.0-py3-none-any.whl

Download URL markproof-0.4.0-py3-none-any.whl
Size 12.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4dae4a3f2714dc347b516fabeee9c17c54c20a8c810a19566a6490a4f6db4ce1
BLAKE2b-256 checksum
How to use checksums
63fcd171848c988da3d2ebf07eb473a441211ea8ea3d010b4533bc99414c21ca
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.4.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