Skip to content

htpbe/python-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

htpbe — Python client

Python client for the HTPBE API — structural PDF tamper & forgery detection. It analyses a PDF's byte-level structure (xref tables, incremental updates, signatures, object streams) to detect whether a document was modified after creation. No original copy needed.

Not a KYC/identity platform — it's the structural PDF-forensics layer. Full API reference: https://htpbe.tech/api

Install

pip install htpbe

Quickstart

from htpbe import Client

client = Client(api_key="htpbe_live_...")  # get a key at https://htpbe.tech/api

result = client.analyze_and_wait("https://example.com/invoice.pdf")

print(result["status"])               # "intact" | "modified" | "inconclusive"
print(result["modification_markers"]) # e.g. ["HTPBE_POST_SIGNATURE_EDIT"]

The API works on any publicly accessible PDF URL (≤ 10 MB), downloadable without authentication.

Two-step flow

analyze_and_wait is shorthand for the underlying two calls:

check_id = client.analyze("https://example.com/contract.pdf")
result = client.get_result(check_id)

List your checks

page = client.list_checks(limit=50)
for check in page["data"]:
    print(check["id"], check["status"])
print(page["total"])  # total number of checks

Error handling

from htpbe import HtpbeAPIError

try:
    result = client.analyze_and_wait(url)
except HtpbeAPIError as exc:
    print(exc.status, exc.code, exc.message)  # e.g. 402 payment_required ...

Testing without spending credits

Test keys (htpbe_test_...) return deterministic synthetic results and only accept the documented test URLs — see the API docs. Live keys (htpbe_live_...) accept any public PDF URL and draw from your credit balance.

What you can detect

The verdict is intact, modified, or inconclusive, with named modification_markers. Common use cases:

Links

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages