LogoSignature Detection API

How to Use the Signature Detection API

How to Use the Signature Detection API

Signature Detection Team

Signature Detection Team

@Signature Detection Team

Getting started with the Signature Detection API is straightforward. This guide will walk you through everything from your first API call to production best practices.

Quick Start

Step 1: Get Your API Key

Sign up for an account and generate your API key from the dashboard. Keep this key secure - it's used to authenticate all your requests.

Step 2: Make Your First Request

The API accepts publicly accessible image URLs. Here's a simple example:

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',
    confidenceThreshold: 0.1
  })
});
 
const data = await response.json();
console.log('Signatures found:', data.result.count);

Step 3: Process the Results

The API returns detected signatures with bounding box coordinates and confidence scores:

{
  "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": 9999,
  "detectionId": "clxxxx..."
}

Integration Examples

Python

import requests
 
# Make the API request with image URL
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',
        'confidenceThreshold': 0.1
    }
)
 
data = response.json()
print(f"Signatures found: {data['result']['count']}")

Node.js

const axios = require('axios');
 
const detectSignatures = async (imageUrl) => {
  const response = await axios.post(
    'https://signature-detector.com/api/detect',
    {
      imageUrl: imageUrl,
      confidenceThreshold: 0.1
    },
    {
      headers: {
        'Content-Type': 'application/json',
        'x-api-key': process.env.API_KEY
      }
    }
  );
 
  return response.data;
};
 
// Usage
detectSignatures('https://example.com/document.jpg')
  .then(data => {
    console.log('Signatures found:', data.result.count);
  });

Advanced Usage

Adjusting the Threshold

The confidenceThreshold parameter (0.01 to 1.0) controls detection sensitivity:

  • High threshold (0.8-1.0): Fewer false positives, may miss some signatures
  • Medium threshold (0.5-0.7): Balanced approach for most use cases
  • Low threshold (0.01-0.4): Catches more signatures, but may include false positives (default: 0.1)

Batch Processing

For processing multiple documents, make concurrent requests:

const imageUrls = [
  'https://example.com/doc1.jpg',
  'https://example.com/doc2.jpg',
  'https://example.com/doc3.jpg'
];
 
const results = await Promise.all(
  imageUrls.map(url => detectSignatures(url))
);

Error Handling

Always implement proper error handling:

try {
  const response = await fetch('/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',
      confidenceThreshold: 0.1
    })
  });
 
  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');
  } else if (response.status === 400) {
    console.error('Invalid request:', data.error);
  } else {
    console.error('Detection failed:', data.error);
  }
} catch (error) {
  console.error('Network error:', error.message);
}

Best Practices

  1. Image URLs: Ensure your image URLs are publicly accessible - the API needs to fetch the image
  2. Image Quality: Higher resolution images generally produce better results
  3. Caching: Cache results for documents you process multiple times
  4. Security: Never expose your API key in client-side code - keep it server-side
  5. Monitoring: Track API usage via the dashboard to optimize costs and performance
  6. Credits: Each detection costs 1 credit - monitor your balance to avoid service interruptions

Playground

Visit our interactive playground to test the API with your own documents and see real-time results. You can adjust thresholds, try different document types, and generate code snippets in your preferred language.

Next Steps

  • Check out the full API documentation for advanced features
  • Join our Discord community for support and updates
  • Explore integration examples in our GitHub repository

Ready to get started? Sign up for a free account and start detecting signatures in minutes.

Ready to build your next AI agent?

How to Use the Signature Detection API | Signature Detection API