Signature detection for contracts
Record whether a contract page contains a visual signature mark, and where the box sits, before the agreement is filed. The API does not decide that the contract is executed.
A new account starts with 10 detection credits. The playground asks you to sign in, then calls the same API.
Presence first
Contract operations teams lose time on files that were attached but never signed. A detection count answers that narrow question. It does not replace legal review, and it does not know your signature-block template. Pair it with a checklist of pages that must contain a mark.
The sample uses the PDF body. Field names and the page grouping are specified on PDF signature detection.
import base64
import requests
def detect_contract(path: str, api_key: str) -> dict:
with open(path, "rb") as handle:
pdf_base64 = base64.b64encode(handle.read()).decode("ascii")
response = requests.post(
"https://signature-detector.com/api/detect",
headers={
"Content-Type": "application/json",
"x-api-key": api_key,
},
json={"pdfBase64": pdf_base64},
timeout=120,
)
response.raise_for_status()
data = response.json()
return {
"detection_id": data.get("detectionId"),
"signed": data["signed"],
"total_marks": data["count"],
"credits_used": data["creditsUsed"],
"pages": [
{
"page": page["page"],
"count": page["count"],
"boxes": [mark["bbox"] for mark in page["detections"]],
}
for page in data["pages"]
],
}Two boxes is not two parties
A signature page often has a company block and a counterparty block. You might sort boxes by y1 and assume the lower one is the customer. That is a layout guess. Write it down as a guess, show both crops to the clerk who files the contract, and correct it when the template changes. Cropping is local. The request does not return image bytes. See crop signatures from bounding boxes.
Workflow shape
- Receive the executed-copy PDF from email or the CLM.
- Detect, then list pages where
countis 0. - If a required page is empty, bounce the file. The longer version of this queue is automating signed-contract checks.
- If marks exist, store
detectionId, page numbers, and boxes next to the contract record. - For a no-code team, the same POST fits an HTTP step in n8n or Zapier.
Credits
- $10 per 100,000 credits, which is $0.0001 each. An image that is not served from cache spends 1 credit. A PDF spends 1 credit per page.
- 10 credits are added when the account is created.
- $1 minimum purchase. That is 10,000 credits. There is no subscription.
- Credits do not expire. The balance stays on the account until a detection spends it. A failed detection puts the credit back. Repeating an image or an identical PDF returns
cached: trueand does not spend a credit. On a PDF that hit iscreditsUsed: 0. - Buy credits from the dashboard or estimate a volume on the pricing page.
Sending the same PDF bytes again returns cached: true and creditsUsed: 0. The balance does not change. Re-encoding the file changes the hash, so that copy is charged at 1 credit per page.
FAQ
Will this tell vendor signature from customer signature?
No. Every detection uses the same class name, signature. Which party a box belongs to is something you infer from position, such as the lower of two blocks on a signature page, and then confirm by eye. The API does not take party names.
What about DocuSign or a PAdES certificate?
A platform certificate can make a PDF signed with no ink on the page, and a scanned contract can show ink with no certificate. This API looks for visible marks. It does not validate a digital signature. An empty detection list does not mean the PDF signature panel is empty.
Is a detected mark enough to file the contract as executed?
No. You still need your own rules: all required parties present, dates filled, no missing pages. Use the detector to catch files that have no mark at all, and to attach boxes for the person who checks the rest.
How do I send the contract?
Send pdfUrl or pdfBase64 to POST https://signature-detector.com/api/detect. Results are grouped by 1-based page. A single exported signature page can instead use imageUrl or imageBase64.
What does it cost to scan a contract archive?
A PDF spends 1 credit per page, and an image spends 1 credit, when the file is not cached. 50,000 pages is 50,000 credits, which is $5. A repeated identical PDF returns creditsUsed 0. Credits do not expire, so a backlog can be purchased once. The minimum purchase is $1. New accounts start with 10 credits. A balance below the page count is HTTP 402 and the file is not charged.
Related reading
- PDF signature detection
Send pdfUrl or pdfBase64. pages, count, and creditsUsed are top-level.
- Check if a document is signed
Turn a detection count into a review decision without treating it as identity proof.
- Automating signed-contract checks
A review queue for visual signature marks, separate from digital certificates.
- Crop signatures from boxes
The API returns coordinates. Pillow or sharp writes the crop.
- n8n and Zapier
Call the API from an HTTP Request step. No custom app required.
- Signature detection API
Request fields, response boxes, credits, and the errors the endpoint actually returns.
Try it on your own file
Upload an image in the playground, or create an API key from the dashboard after signup. Read the API docs for the request fields.
