Skip to main content

dokaz-api

The official Python client for the Dokaz API: invoice PDFs, Markdown to PDF, QR codes and barcodes, CSV/JSON/Excel conversion, calendar (.ics) files, photo metadata removal, email verification, website intel and text AI, all from one key.

  • Standard library only (urllib). No dependencies.
  • Python 3.9+, fully typed (py.typed, TypedDicts for requests and responses).
  • One method per API endpoint. PDFs, PNGs, JPEGs and spreadsheets come back as bytes; SVG, CSV and iCalendar as str; everything else as parsed JSON.
pip install dokaz-api
from dokaz_api import Dokaz

Free tier and plans

100 calls a day are free with no key and no signup. Just call it. For more, get a key at api.dokaz.net/#pricing: Starter $9/month (10,000 calls), Pro $29/month (100,000), Business $79/month (500,000). Every plan covers every endpoint. The key is shown straight after checkout.

dokaz = Dokaz()               # uses DOKAZ_API_KEY if set, else the free tier
dokaz = Dokaz("dk_...")       # or pass the key

Quick start

Invoice PDF

pdf = dokaz.invoice_pdf({
    "number": "INV-2026-0142",
    "date": "2026-09-06",
    "due": "2026-10-06",
    "from": {"name": "Northwind Studio LLC", "address": ["1200 Market Street", "San Francisco, CA 94102"]},
    "to": {"name": "Acme Robotics Inc.", "email": "ap@acme-robotics.example"},
    "items": [
        {"description": "Brand identity design", "qty": 1, "unit_price": 2400},
        {"description": "Front-end implementation (hourly)", "qty": 32, "unit_price": 110},
    ],
    "tax_rate": 8.25,
})
open("invoice.pdf", "wb").write(pdf)

totals = dokaz.invoice_preview(same_body)   # {"subtotal", "tax", "total", "line_items", ...}

Markdown to PDF

pdf = dokaz.pdf_markdown("# 2.4\n\n- Faster **exports**", title="Release notes", page_size="a4")

QR codes and barcodes

svg = dokaz.qr("https://example.com", size=256, ec="Q")        # str
png = dokaz.qr("https://example.com", format="png")            # bytes
wifi = dokaz.qr_wifi("Cafe Guest", password="latte123", format="png")
card = dokaz.qr_vcard("Ada Lovelace", email="ada@example.com")
ean = dokaz.barcode("400638133393", type="ean13", text=True)    # SVG str

CSV, JSON and Excel

rows = dokaz.convert_csv_to_json('name,city\n"Hopper, Grace",Arlington')   # [{"name": ..., "city": ...}]
csv = dokaz.convert_json_to_csv([{"name": "Ada", "born": 1815}])           # RFC 4180 text
xlsx = dokaz.convert_json_to_xlsx({"rows": [{"order": "A-1001", "total": 129.5}], "sheet_name": "Orders"})

Calendar (.ics) files

ics = dokaz.calendar_ics_post({
    "title": "Kitchen remodel consult",
    "start": "2026-10-05T14:00:00-07:00",
    "end": "2026-10-05T15:00:00-07:00",
    "reminder_minutes": 60,
})
# An "Add to calendar" link for an email, with no request made and no key in it:
link = dokaz.calendar_ics_link("Webinar", "2026-10-08T17:00:00Z")

Strip photo metadata (EXIF, GPS, XMP)

clean = dokaz.image_strip(open("photo.jpg", "rb").read())   # same pixels, no metadata
no_icc = dokaz.image_strip(data, keep_icc=False)

Email verification and website intel

r = dokaz.email_verify("sales@gmial.com")        # r["valid"], r["score"], r["checks"]["typo_suggestion"]
batch = dokaz.email_verify_batch(["a@example.org", "b@mailinator.com"])   # up to 50, one call
site = dokaz.site_intel("https://example.com")    # title, OpenGraph, tech, contacts, socials

Text AI

dokaz.text_summarize(text, sentences=2, style="bullets")
dokaz.text_sentiment(text)
dokaz.text_keywords(text, max=10)
dokaz.text_classify(text, ["billing", "bug report", "other"])
dokaz.text_extract(text, ["name", "company", "phone"])
dokaz.text_rewrite(text, "professional")

Errors

Every non-2xx response raises DokazError carrying the API's error body:

from dokaz_api import DokazError

try:
    dokaz.invoice_pdf(body)
except DokazError as e:
    e.status        # 400, 401, 404, 413, 429, 503 ...
    e.error         # the API's message (e.body is the whole JSON)
    e.errors        # every validation problem, when listed
    e.upgrade       # on 429: where to upgrade
    e.retry_after   # on 503 (text AI capacity): seconds to wait

A request that gets no response at all (DNS, connection, timeout) raises DokazConnectionError, a DokazError with status 0.

Quota, options and raw responses

dokaz = Dokaz(
    "dk_...",              # default: DOKAZ_API_KEY; None forces the anonymous free tier
    timeout=30,            # seconds, default 60
    on_response=lambda i: print(i.operation, i.status, i.quota),   # Quota(plan, limit, used)
)

# Any call with its status and headers (x-pdf-pages, x-csv-rows, x-metadata-removed ...):
r = dokaz.request("pdf_markdown", json={"markdown": "# Hi"})
r.headers["x-pdf-pages"], r.data

Methods

Method Endpoint Returns
invoice_pdf(invoice) POST /v1/invoice/pdf bytes (PDF)
invoice_preview(invoice) POST /v1/invoice/preview totals
invoice_sample() GET /v1/invoice/sample bytes (PDF)
email_verify(email) GET /v1/email/verify result
email_verify_post(email) POST /v1/email/verify result
email_verify_batch(emails) POST /v1/email/verify/batch {"count", "results"}
site_intel(url) GET /v1/site/intel dict
site_intel_post(url) POST /v1/site/intel dict
text_summarize text_sentiment text_keywords text_classify text_extract text_rewrite POST /v1/text/* dict
qr(data, ...) / qr_post(data, ...) GET / POST /v1/qr SVG str, PNG bytes or matrix
qr_wifi(ssid, ...) GET /v1/qr/wifi as qr
qr_vcard(name, ...) GET /v1/qr/vcard as qr
barcode(data, ...) GET /v1/barcode SVG str
pdf_markdown(markdown, ...) POST /v1/pdf/markdown bytes (PDF)
convert_csv_to_json(csv, ...) POST /v1/convert/csv-to-json rows
convert_json_to_csv(rows, ...) POST /v1/convert/json-to-csv CSV str
convert_json_to_xlsx(body) POST /v1/convert/json-to-xlsx bytes (.xlsx)
calendar_ics(title, start, ...) GET /v1/calendar/ics iCalendar str
calendar_ics_post(event) POST /v1/calendar/ics iCalendar str
image_strip(data, ...) POST /v1/image/strip bytes (image)

Field names are the API's own, so the guides at api.dokaz.net/docs and the OpenAPI document apply unchanged.

License

MIT

Release files for dokaz-api 0.1.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 dokaz-api 0.1.0
File Size Uploaded
dokaz_api-0.1.0.tar.gz 12.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dokaz-api 0.1.0
File Interpreter ABI Platform
dokaz_api-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 26.5 kB

Release files / dokaz_api-0.1.0.tar.gz

Download URL dokaz_api-0.1.0.tar.gz
Size 12.2 kB
Tags Source
SHA-256 checksum
How to use checksums
835def438837c7ef6622f0527f0b0a744712d668afb25ff741cf3b53806e5211
BLAKE2b-256 checksum
How to use checksums
ea71e177e5d87b986270dda7bacc8923ca4e19789f637e3d9ab43a219de8fa81
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Release files / dokaz_api-0.1.0-py3-none-any.whl

Download URL dokaz_api-0.1.0-py3-none-any.whl
Size 14.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e976616eef124eca5363e09a6926825a406474a25221d4a49295d14456d902c9
BLAKE2b-256 checksum
How to use checksums
b16994491a4316ebce0cae767fb0c409103b6f4501d5625dd8f3920593615ff1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

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