API Documentation
Start exploring our API with 25 free credits — no credit card required.
All API requests should be made to:
https://api.urlert.com/v1
All API endpoints require authentication using an API key
X-API-Key
headercurl -X GET "https://api.urlert.com/v1/endpoints" \
-H "X-API-Key: your-api-key-here"
const response = await fetch("https://api.urlert.com/v1/endpoints", {
headers: {
"X-API-Key": "your-api-key-here"
}
});
const data = await response.json();
import requests
headers = {
'X-API-Key': 'your-api-key-here'
}
response = requests.get(
'https://api.urlert.com/v1/endpoints',
headers=headers
)
data = response.json()
API requests are rate-limited to ensure fair usage
Rate Limits
- GET requests: 100 requests per minute
- POST/PATCH requests: 10 requests per minute
Response Headers
Header | Description | Example |
---|---|---|
X-RateLimit-Remaining | Number of requests remaining in the current time window | 9 |
X-RateLimit-Reset | Unix timestamp (in seconds) when the rate limit window resets | 1699456800 |
X-RateLimit-Limit | Maximum requests per minute | 10 |
Rate Limit Exceeded (429)
function exponentialBackoff(retries) {
return Math.min(1000 * Math.pow(2, retries), 60000);
}
async function fetchWithRetry(url = "https://api.urlert.com/v1/endpoints", options, maxRetries = 5) {
for (let i = 0; i < maxRetries; i++) {
try {
const response = await fetch(url, options);
if (response.status !== 429) return response;
const backoffMs = exponentialBackoff(i);
await new Promise(resolve => setTimeout(resolve, backoffMs));
} catch (error) {
if (i === maxRetries - 1) throw error;
}
}
}
import time
import math
def exponential_backoff(retries):
return min(1000 * math.pow(2, retries), 60000)
def fetch_with_retry(url = "https://api.urlert.com/v1/endpoints", headers, max_retries=5):
for i in range(max_retries):
try:
response = requests.get(url, headers=headers)
if response.status_code != 429:
return response
backoff_ms = exponential_backoff(i)
time.sleep(backoff_ms / 1000) # Convert to seconds
except Exception as e:
if i == max_retries - 1:
raise e
Learn how to perform a complete scan workflow using our API
Workflow Steps
Create Scan
Check Status
Handle Results
- threatLevel (BENIGN to MALICIOUS)
- confidence score (0.0 - 1.0)
- malicious and non-malicious reasons
- final URL after redirects
import type { Scan, Analysis, ScanStatus, ThreatLevel } from './types';
// 1. Create a new scan
async function createScan(url: string): Promise<Scan> {
const response = await fetch("https://api.urlert.com/v1/scans", {
method: "POST",
headers: {
"X-API-Key": "your-api-key-here",
"Content-Type": "application/json",
},
body: JSON.stringify({ url })
});
return await response.json();
}
// 2. Poll for scan results
async function checkScanStatus(scanId: string): Promise<Scan> {
const response = await fetch(`https://api.urlert.com/v1/scans/${scanId}`, {
headers: { "X-API-Key": "your-api-key-here" }
});
return await response.json();
}
// 3. Complete workflow with polling
async function analyzeSite(url: string) {
// Start the scan
const scan = await createScan(url);
console.log("Scan created:", scan.id);
// Poll for results
while (true) {
const result = await checkScanStatus(scan.id);
if (result.status === "FAILED") {
console.error("Scan failed:", result.error);
break;
}
if (result.status === "ANALYZED") {
console.log("Scan completed!");
console.log("Threat Level:", result.analysis?.threatLevel);
console.log("Confidence:", result.analysis?.confidence);
console.log("Final URL:", result.analysis?.finalUrl);
console.log("Malicious Reasons:", result.analysis?.maliciousReasons);
break;
}
// Wait 2 seconds before next check
await new Promise(resolve => setTimeout(resolve, 2000));
}
}
// Usage
analyzeSite("https://example.com");
from enum import Enum
import time
import requests
from typing import Optional, List, Dict
class ScanStatus(str, Enum):
PENDING = "PENDING"
FAILED = "FAILED"
SCRAPED = "SCRAPED"
ANALYZED = "ANALYZED"
API_KEY = "your-api-key-here"
BASE_URL = "https://api.urlert.com/v1"
def create_scan(url: str) -> Dict:
"""Create a new scan and return the response."""
response = requests.post(
f"{BASE_URL}/scans",
headers={
"X-API-Key": API_KEY,
"Content-Type": "application/json"
},
json={"url": url}
)
return response.json()
def check_scan_status(scan_id: str) -> Dict:
"""Check the status of a scan."""
response = requests.get(
f"{BASE_URL}/scans/{scan_id}",
headers={"X-API-Key": API_KEY}
)
return response.json()
def analyze_site(url: str):
"""Complete workflow to analyze a site."""
# Start the scan
scan = create_scan(url)
print(f"Scan created: {scan['id']}")
# Poll for results
while True:
result = check_scan_status(scan['id'])
if result['status'] == ScanStatus.FAILED:
print("Scan failed:", result.get('error'))
break
if result['status'] == ScanStatus.ANALYZED:
analysis = result.get('analysis', {})
print("Scan completed!")
print("Threat Level:", analysis.get('threatLevel'))
print("Confidence:", analysis.get('confidence'))
print("Final URL:", analysis.get('finalUrl'))
print("Malicious Reasons:", analysis.get('maliciousReasons', []))
break
# Wait 2 seconds before next check
time.sleep(2)
# Usage
analyze_site("https://example.com")
Endpoints
/v1/status
Get API status
Responses
Property | Type | Required | Description | Example |
---|---|---|---|---|
status | string | Yes | The status of the API | "ok" |
string | Yes | The email associated with the API token | "user@example.com" |
Property | Type | Required | Description | Example |
---|---|---|---|---|
statusCode | number | Yes | HTTP status code | 401 |
message | string | Yes | Error message | "API key is required" |
error | string | Yes | Error type | "Unauthorized" |
Property | Type | Required | Description | Example |
---|---|---|---|---|
statusCode | number | Yes | HTTP status code | 401 |
message | string | Yes | Error message | "API key is required" |
error | string | Yes | Error type | "Unauthorized" |
Property | Type | Required | Description | Example |
---|---|---|---|---|
statusCode | number | Yes | HTTP status code | 401 |
message | string | Yes | Error message | "API key is required" |
error | string | Yes | Error type | "Unauthorized" |
/v1/scans
Create a new scan
Creates a new scan for the specified URL. Scan data is automatically deleted after 90 days.
Request Body
Property | Type | Required | Description | Example |
---|---|---|---|---|
url | string | Yes | The URL to scan. Must use HTTPS protocol. Scan results are stored for 90 days. | "https://example.com" |
scanType | enum "STANDARD" | No | Type of AI analysis to perform. STANDARD for standard scan model. | "STANDARD" |
Responses
Property | Type | Required | Description | Example |
---|---|---|---|---|
message | string | Yes | Status message of the scan request | "Scan initiated successfully" |
scanId | string | Yes | Unique identifier for the scan | "507f1f77bcf86cd799439011" |
Property | Type | Required | Description | Example |
---|---|---|---|---|
statusCode | number | Yes | HTTP status code | 401 |
message | string | Yes | Error message | "API key is required" |
error | string | Yes | Error type | "Unauthorized" |
Property | Type | Required | Description | Example |
---|---|---|---|---|
statusCode | number | Yes | HTTP status code | 401 |
message | string | Yes | Error message | "API key is required" |
error | string | Yes | Error type | "Unauthorized" |
Property | Type | Required | Description | Example |
---|---|---|---|---|
statusCode | number | Yes | HTTP status code | 401 |
message | string | Yes | Error message | "API key is required" |
error | string | Yes | Error type | "Unauthorized" |
Property | Type | Required | Description | Example |
---|---|---|---|---|
statusCode | number | Yes | HTTP status code | 401 |
message | string | Yes | Error message | "API key is required" |
error | string | Yes | Error type | "Unauthorized" |
Property | Type | Required | Description | Example |
---|---|---|---|---|
statusCode | number | Yes | HTTP status code | 401 |
message | string | Yes | Error message | "API key is required" |
error | string | Yes | Error type | "Unauthorized" |
/v1/scans/{id}
Get scan results by ID
Returns the scan results. Scan data is automatically deleted after 90 days from creation.
Parameters
Name | Type | Required | Description |
---|---|---|---|
id | string | Yes | - |
Responses
Property | Type | Required | Description | Example | |||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
id | string | Yes | Unique identifier of the scan | "123e4567-e89b-12d3-a456-426614174000" | |||||||||||||||||||||||||||||||||||
url | string | Yes | The URL that was scanned | "https://example.com" | |||||||||||||||||||||||||||||||||||
status | enum "PENDING""FAILED""SCRAPED""ANALYZED" | Yes | Current status of the scan. ANALYZED means scan is completed. FAILED means scan failed. | "ANALYZED" | |||||||||||||||||||||||||||||||||||
error | string | No | Error message if scan failed | "Failed to resolve DNS" | |||||||||||||||||||||||||||||||||||
analysis | object | No | Analysis results if scan is completed | - | |||||||||||||||||||||||||||||||||||
|
Property | Type | Required | Description | Example |
---|---|---|---|---|
statusCode | number | Yes | HTTP status code | 401 |
message | string | Yes | Error message | "API key is required" |
error | string | Yes | Error type | "Unauthorized" |
Property | Type | Required | Description | Example |
---|---|---|---|---|
statusCode | number | Yes | HTTP status code | 401 |
message | string | Yes | Error message | "API key is required" |
error | string | Yes | Error type | "Unauthorized" |
Property | Type | Required | Description | Example |
---|---|---|---|---|
statusCode | number | Yes | HTTP status code | 401 |
message | string | Yes | Error message | "API key is required" |
error | string | Yes | Error type | "Unauthorized" |
Property | Type | Required | Description | Example |
---|---|---|---|---|
statusCode | number | Yes | HTTP status code | 401 |
message | string | Yes | Error message | "API key is required" |
error | string | Yes | Error type | "Unauthorized" |
/v1/reports
Create a new report from scan results
Creates a new report based on scan results. Reports are automatically deleted after 7 days.
Request Body
Property | Type | Required | Description | Example |
---|---|---|---|---|
scanId | string | Yes | The UUID of the scan to create a report for. Reports are automatically deleted after 7 days. | "123e4567-e89b-12d3-a456-426614174000" |
Responses
Property | Type | Required | Description | Example |
---|---|---|---|---|
reportId | string | Yes | The unique identifier for the created report | "123e4567-e89b-12d3-a456-426614174000" |
Property | Type | Required | Description | Example |
---|---|---|---|---|
statusCode | number | Yes | HTTP status code | 401 |
message | string | Yes | Error message | "API key is required" |
error | string | Yes | Error type | "Unauthorized" |
Property | Type | Required | Description | Example |
---|---|---|---|---|
statusCode | number | Yes | HTTP status code | 401 |
message | string | Yes | Error message | "API key is required" |
error | string | Yes | Error type | "Unauthorized" |
Property | Type | Required | Description | Example |
---|---|---|---|---|
statusCode | number | Yes | HTTP status code | 401 |
message | string | Yes | Error message | "API key is required" |
error | string | Yes | Error type | "Unauthorized" |
Property | Type | Required | Description | Example |
---|---|---|---|---|
statusCode | number | Yes | HTTP status code | 401 |
message | string | Yes | Error message | "API key is required" |
error | string | Yes | Error type | "Unauthorized" |
Property | Type | Required | Description | Example |
---|---|---|---|---|
statusCode | number | Yes | HTTP status code | 401 |
message | string | Yes | Error message | "API key is required" |
error | string | Yes | Error type | "Unauthorized" |
/v1/reports/{id}
Get report by ID
Returns the report data. Reports are automatically deleted after 7 days from creation.
Parameters
Name | Type | Required | Description |
---|---|---|---|
id | string | Yes | - |
Responses
Property | Type | Required | Description | Example |
---|---|---|---|---|
id | string | Yes | The UUID of the report | "123e4567-e89b-12d3-a456-426614174000" |
scanId | string | Yes | The UUID of the related scan | "123e4567-e89b-12d3-a456-426614174001" |
status | enum "PENDING""PROCESSING""DONE""FAILED" | Yes | Current status of the report generation process | "DONE" |
error | string | No | Error message in case report generation failed | "Failed to process the scan data" |
report | object | No | The report content, structure may vary over time | {"summary":"This website appears to be legitimate","riskScore":12,"warnings":["Site contains some tracking cookies"],"detailedAnalysis":{}} |
Property | Type | Required | Description | Example |
---|---|---|---|---|
statusCode | number | Yes | HTTP status code | 401 |
message | string | Yes | Error message | "API key is required" |
error | string | Yes | Error type | "Unauthorized" |
Property | Type | Required | Description | Example |
---|---|---|---|---|
statusCode | number | Yes | HTTP status code | 401 |
message | string | Yes | Error message | "API key is required" |
error | string | Yes | Error type | "Unauthorized" |
Property | Type | Required | Description | Example |
---|---|---|---|---|
statusCode | number | Yes | HTTP status code | 401 |
message | string | Yes | Error message | "API key is required" |
error | string | Yes | Error type | "Unauthorized" |
Property | Type | Required | Description | Example |
---|---|---|---|---|
statusCode | number | Yes | HTTP status code | 401 |
message | string | Yes | Error message | "API key is required" |
error | string | Yes | Error type | "Unauthorized" |
/v1/reports/batch
Create multiple reports from scan results in batch
Creates multiple reports based on scan results in a single request. Limit of 50 reports per batch. Reports are automatically deleted after 7 days. This operation counts as 5 operations against your rate limit.
Request Body
Property | Type | Required | Description | Example |
---|---|---|---|---|
scanIds | Array<string> | Yes | Array of scan UUIDs to create reports for. Reports are automatically deleted after 7 days. Maximum 50 scan IDs per request. | ["123e4567-e89b-12d3-a456-426614174000","223e4567-e89b-12d3-a456-426614174001"] |
Responses
Property | Type | Required | Description | Example |
---|---|---|---|---|
reports | Array<object> | Yes | Array of report objects | - |
Property | Type | Required | Description | Example |
---|---|---|---|---|
statusCode | number | Yes | HTTP status code | 401 |
message | string | Yes | Error message | "API key is required" |
error | string | Yes | Error type | "Unauthorized" |
Property | Type | Required | Description | Example |
---|---|---|---|---|
statusCode | number | Yes | HTTP status code | 401 |
message | string | Yes | Error message | "API key is required" |
error | string | Yes | Error type | "Unauthorized" |
Property | Type | Required | Description | Example |
---|---|---|---|---|
statusCode | number | Yes | HTTP status code | 401 |
message | string | Yes | Error message | "API key is required" |
error | string | Yes | Error type | "Unauthorized" |
Property | Type | Required | Description | Example |
---|---|---|---|---|
statusCode | number | Yes | HTTP status code | 401 |
message | string | Yes | Error message | "API key is required" |
error | string | Yes | Error type | "Unauthorized" |
Property | Type | Required | Description | Example |
---|---|---|---|---|
statusCode | number | Yes | HTTP status code | 401 |
message | string | Yes | Error message | "API key is required" |
error | string | Yes | Error type | "Unauthorized" |
/v1/reports/batch/get
Get multiple reports by IDs in batch
Returns multiple report data in a single request. Limit of 50 reports per batch. Reports are automatically deleted after 7 days from creation. This operation counts as 5 operations against your rate limit.
Request Body
Property | Type | Required | Description | Example |
---|---|---|---|---|
reportIds | Array<string> | Yes | Array of report UUIDs to retrieve. Maximum 50 report IDs per request. | ["123e4567-e89b-12d3-a456-426614174000","223e4567-e89b-12d3-a456-426614174001"] |
Responses
Property | Type | Required | Description | Example |
---|---|---|---|---|
reports | Array<object> | Yes | Array of report objects | - |
Property | Type | Required | Description | Example |
---|---|---|---|---|
statusCode | number | Yes | HTTP status code | 401 |
message | string | Yes | Error message | "API key is required" |
error | string | Yes | Error type | "Unauthorized" |
Property | Type | Required | Description | Example |
---|---|---|---|---|
statusCode | number | Yes | HTTP status code | 401 |
message | string | Yes | Error message | "API key is required" |
error | string | Yes | Error type | "Unauthorized" |
Property | Type | Required | Description | Example |
---|---|---|---|---|
statusCode | number | Yes | HTTP status code | 401 |
message | string | Yes | Error message | "API key is required" |
error | string | Yes | Error type | "Unauthorized" |
Property | Type | Required | Description | Example |
---|---|---|---|---|
statusCode | number | Yes | HTTP status code | 401 |
message | string | Yes | Error message | "API key is required" |
error | string | Yes | Error type | "Unauthorized" |
Property | Type | Required | Description | Example |
---|---|---|---|---|
statusCode | number | Yes | HTTP status code | 401 |
message | string | Yes | Error message | "API key is required" |
error | string | Yes | Error type | "Unauthorized" |