The API is one endpoint. This guide uses the fields the route reads today: imageUrl or imageBase64, header x-api-key, and an optional threshold from 0 to 1. Omit threshold and the cutoff is 0.1.
1. Create a key
Sign up, open the dashboard, and create an API key. A new account has 10 credits. Keep the key on a server. The playground calls the same route with your signed-in session and does not require you to paste the key into browser JavaScript.
2. Send one image
The body must include exactly one of imageUrl or imageBase64. imageUrl is fetched by the API with no extra credentials.
const response = await fetch("https://signature-detector.com/api/detect", {
method: "POST",
headers: {
"x-api-key": "your_api_key_here",
"Content-Type": "application/json",
},
body: JSON.stringify({
imageUrl: "https://example.com/document.jpg",
}),
});
const data = await response.json();
console.log("Signatures found:", data.result.count);Base64, for a file that is not public:
body: JSON.stringify({
imageBase64: imageBuffer.toString("base64"),
}),Do not send both fields. A data:image/...;base64, prefix is stripped if you include one.
3. Read the result
{
"success": true,
"result": {
"detections": [
{
"bbox": {
"x1": 321.23,
"y1": 373.39,
"x2": 647.21,
"y2": 501.68
},
"confidence": 0.192,
"class": 0,
"class_name": "signature"
}
],
"count": 1,
"confidenceThreshold": 0.1
},
"creditsRemaining": 9,
"detectionId": "clxxxx"
}confidenceThreshold in the response is the cutoff that was applied. Send threshold as a number from 0 to 1 to change it. The default is 0.1. A value outside that range is HTTP 400. PDF detection always uses 0.1. Coordinates in this sample are absolute pixel positions on the submitted image, with the origin at the top-left.
If the same image bytes were already detected, the JSON includes "cached": true and creditsRemaining does not decrease.
Python
import requests
response = requests.post(
"https://signature-detector.com/api/detect",
headers={
"Content-Type": "application/json",
"x-api-key": "your_api_key_here",
},
json={"imageUrl": "https://example.com/document.jpg"},
timeout=60,
)
data = response.json()
print(f"Signatures found: {data['result']['count']}")Several images
There is no batch field. Send one request per image. Each uncached image spends 1 credit.
async function detectSignatures(imageUrl) {
const response = await fetch("https://signature-detector.com/api/detect", {
method: "POST",
headers: {
"Content-Type": "application/json",
"x-api-key": "your_api_key_here",
},
body: JSON.stringify({ imageUrl }),
});
const data = await response.json();
if (!response.ok) {
throw new Error(data.error || `HTTP ${response.status}`);
}
return data;
}
const imageUrls = [
"https://example.com/doc1.jpg",
"https://example.com/doc2.jpg",
"https://example.com/doc3.jpg",
];
const results = await Promise.all(imageUrls.map((imageUrl) => detectSignatures(imageUrl)));Stop if you receive HTTP 402. Further calls will fail the same way until the balance is at least 1.
Errors
const response = await fetch("https://signature-detector.com/api/detect", {
method: "POST",
headers: {
"Content-Type": "application/json",
"x-api-key": "your_api_key_here",
},
body: JSON.stringify({
imageUrl: "https://example.com/document.jpg",
}),
});
const data = await response.json();
if (response.ok) {
console.log(`Found ${data.result.count} signatures`);
} else if (response.status === 401) {
console.error("Invalid API key");
} else if (response.status === 402) {
console.error("Insufficient credits", data.credits);
} else if (response.status === 400) {
console.error("Invalid request:", data.error);
} else {
console.error("Detection failed:", data.error);
}401 is an unknown key, or no session when you omit the key. 402 includes needsPurchase: true. 503 means the detector did not accept the call. The credit for a failed detection is refunded.
Practical limits
imageUrlmust be publicly fetchable by the API.- Boxes are in the pixel space of the file you sent. Crop that file, not a resized preview. See Extract signature crops from bounding boxes.
- The API locates visual marks. It does not verify identity, and it does not validate a PDF certificate.
- One credit is $0.0001. An image spends 1 credit. A PDF spends 1 credit per page. Signup includes 10 credits. The minimum purchase is $1 (10,000 credits). Credits do not expire. Images accept an optional
thresholdfrom 0 to 1 (default 0.1). PDFs use 0.1.

