DigitalCoding API
Programmatic access to SSL analysis, security scanning, media conversion, and more.
Overview
The DigitalCoding API provides programmatic access to our suite of developer tools. Submit jobs for SSL certificate analysis, security header checks, image conversion, and more through simple REST endpoints.
Free Tier: Every API key includes 500 free credits per month, automatically reset on the 1st of each month. No credit card required.
Authentication
All API requests require authentication using an API key. You can authenticate using either method:
Bearer Token (Recommended)
Authorization: Bearer dc_live_your_api_key_here X-API-Key Header
X-API-Key: dc_live_your_api_key_here Security: Keep your API key secret. Never expose it in client-side code or public repositories. Use environment variables in production.
Base URL
https://api.digitalcoding.com/v1 All endpoints are relative to this base URL.
Endpoints
/api/jobs Submit a new job for processing.
Request Body
{
"toolType": "ssl-metrics",
"options": {
"domain": "example.com"
}
} Response
{
"success": true,
"jobId": "job_abc123def456",
"status": "QUEUED",
"creditsUsed": 1,
"creditsRemaining": {
"free": 499,
"paid": 0
}
} /api/jobs/{jobId} Get the status and results of a job.
Response (Completed)
{
"success": true,
"job": {
"jobId": "job_abc123def456",
"toolType": "ssl-metrics",
"status": "COMPLETED",
"createdAt": "2024-01-15T10:30:00Z",
"completedAt": "2024-01-15T10:30:05Z",
"result": {
"domain": "example.com",
"grade": "A+",
"certificate": { ... },
"protocols": [ ... ]
}
}
} Job Statuses
QUEUED- Job is waiting to be processedPROCESSING- Job is currently runningCOMPLETED- Job finished successfullyFAILED- Job encountered an error
Credit Costs
Each API call consumes credits based on the tool's computational requirements:
| Tool | Credits | Description |
|---|---|---|
ssl-metrics | 1 | SSL certificate analysis |
security-headers | 1 | HTTP security headers check |
favicon-generator | 2 | Generate favicons from image |
file-metadata | 2 | Extract file metadata |
image-converter | 3 | Convert images between formats |
metadata-stripper | 3 | Remove metadata from files |
url-screenshot | 5 | Capture website screenshot |
web-vitals | 5 | Core Web Vitals analysis |
network-analyzer | 5 | Network performance analysis |
audio-converter | 8 | Convert audio files |
video-converter | 15 | Convert video files |
Credit Deduction Order
Free credits are always used first. Paid credits are only consumed after free credits are exhausted. Credits are deducted when a job is submitted, not when it completes.
Rate Limits
API requests are rate-limited to ensure fair usage. Limits are applied per API key:
| Tier | Per Minute | Per Hour | Per Day |
|---|---|---|---|
| Free | 10 requests | 100 requests | 500 requests |
| Starter | 30 requests | 500 requests | 5,000 requests |
| Pro | 100 requests | 2,000 requests | 20,000 requests |
Rate limit headers are included in API responses:
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 95
X-RateLimit-Reset: 1705312800 Error Handling
The API uses standard HTTP status codes and returns structured error responses:
{
"success": false,
"error": "INSUFFICIENT_CREDITS",
"message": "Not enough credits to process this request",
"details": {
"required": 5,
"available": 2
}
} Common Error Codes
INVALID_API_KEY API key is missing, invalid, or revoked
IP_NOT_WHITELISTED Request IP is not in the API key's whitelist
INSUFFICIENT_CREDITS Not enough credits available for this request
RATE_LIMIT_EXCEEDED Too many requests, please slow down
INVALID_TOOL_TYPE The specified tool type doesn't exist
Code Examples
cURL
# Submit a job
curl -X POST https://api.digitalcoding.com/v1/api/jobs \
-H "Authorization: Bearer dc_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{"toolType": "ssl-metrics", "options": {"domain": "example.com"}}'
# Check job status
curl https://api.digitalcoding.com/v1/api/jobs/job_abc123 \
-H "Authorization: Bearer dc_live_your_api_key" Python
import requests
import time
API_KEY = "dc_live_your_api_key"
BASE_URL = "https://api.digitalcoding.com/v1"
headers = {
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json"
}
# Submit a job
response = requests.post(
f"{BASE_URL}/api/jobs",
headers=headers,
json={
"toolType": "ssl-metrics",
"options": {"domain": "example.com"}
}
)
job = response.json()
job_id = job["jobId"]
print(f"Job submitted: {job_id}")
# Poll for results
while True:
status_response = requests.get(
f"{BASE_URL}/api/jobs/{job_id}",
headers=headers
)
result = status_response.json()
if result["job"]["status"] == "COMPLETED":
print("Results:", result["job"]["result"])
break
elif result["job"]["status"] == "FAILED":
print("Job failed:", result["job"]["error"])
break
time.sleep(2) # Wait 2 seconds before polling again JavaScript / Node.js
const API_KEY = 'dc_live_your_api_key';
const BASE_URL = 'https://api.digitalcoding.com/v1';
async function analyzeSSL(domain) {
// Submit job
const submitResponse = await fetch(`${BASE_URL}/api/jobs`, {
method: 'POST',
headers: {
'Authorization': `Bearer ${API_KEY}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
toolType: 'ssl-metrics',
options: { domain }
})
});
const { jobId } = await submitResponse.json();
console.log('Job submitted:', jobId);
// Poll for results
while (true) {
const statusResponse = await fetch(
`${BASE_URL}/api/jobs/${jobId}`,
{ headers: { 'Authorization': `Bearer ${API_KEY}` } }
);
const { job } = await statusResponse.json();
if (job.status === 'COMPLETED') {
return job.result;
} else if (job.status === 'FAILED') {
throw new Error(job.error);
}
await new Promise(resolve => setTimeout(resolve, 2000));
}
}
// Usage
analyzeSSL('example.com')
.then(result => console.log('SSL Grade:', result.grade))
.catch(error => console.error('Error:', error)); Tool Reference
ssl-metrics
Analyze SSL/TLS certificates and security configuration.
Options
{
"domain": "example.com" // Required: domain to analyze
} security-headers
Check HTTP security headers configuration.
Options
{
"url": "https://example.com" // Required: URL to check
} image-converter
Convert images between formats (JPEG, PNG, WebP, AVIF, etc.).
Options
{
"fileKey": "uploads/abc123.png", // S3 key from upload
"outputFormat": "webp", // Target format
"quality": 85 // Optional: 1-100
} url-screenshot
Capture a screenshot of any webpage.
Options
{
"url": "https://example.com", // Required: URL to capture
"width": 1280, // Optional: viewport width
"height": 720, // Optional: viewport height
"fullPage": false // Optional: capture full page
} For complete documentation on all tools and their options, visit the individual tool pages.
Need Help?
If you have questions or run into issues, we're here to help: