🔐 Authentication API

API Keys

All API requests require authentication using an API access token. Include your token in every request header:

Authorization: Bearer YOUR_ACCESS_TOKEN
POST /auth/token Generate API access token

Generates a short-lived API access token for secure authentication.

Example Response
{
  "access_token": "sm_live_xxxxxxxxx",
  "expires_in": 3600
}

🔍 Audit API

Run and manage comprehensive AI website audits.

GET /audits Retrieve audit history

Returns a paginated list of all previous audits performed on your account.

POST /audits/run Run a new website audit

Triggers a new, comprehensive AI website audit.

Example Request
{
  "url": "https://example.com"
}
Example Response
{
  "audit_id": "AUD12345",
  "status": "queued"
}
GET /audits/{id} Retrieve complete audit results

Returns the complete results of a specific audit, including:

  • Health Score
  • Audit Summary
  • AI Recommendations
  • Scan Timestamp

📈 SEO API

Extract SEO insights, scores, and metadata analysis.

GET /seo/{audit_id} Get SEO analysis data

Returns detailed SEO data including SEO Score, Meta Tags, Title Analysis, Description Analysis, Heading Structure, Canonical Status, Indexability, and Structured Data Validation.

Example Response
{
  "seo_score": 91,
  "missing_alt_tags": 2,
  "canonical_valid": true,
  "title_length": "optimal"
}

⚡ Performance API

Retrieve load times, Web Vitals, and speed scores.

GET /performance/{audit_id} Get performance data

Returns complete performance metrics including:

  • Performance Score
  • Largest Contentful Paint (LCP)
  • First Contentful Paint (FCP)
  • Cumulative Layout Shift (CLS)
  • Time To Interactive (TTI)
  • Core Web Vitals

🛡️ Security API

Check SSL, headers, and vulnerability issues.

GET /security/{audit_id} Get security analysis

Returns security evaluations including SSL Status, HTTPS Validation, Security Headers, Mixed Content Issues, and Vulnerability Findings.

Example Response
{
  "ssl_valid": true,
  "security_score": 89
}

📡 Monitoring API

Manage continuous monitoring and uptime checks.

GET /monitoring/sites List monitored websites

Retrieves a list of all active websites currently being monitored by SiteMonitor.

POST /monitoring/site Add website for monitoring

Configures a new website URL to be continuously checked for uptime and availability.

GET /monitoring/incidents Retrieve uptime incidents

Returns a historical record of all downtime events and incidents detected across monitored sites.

📊 Reports API

Generate and download audit reports programmatically.

GET /reports List generated reports

Returns a list of all historically generated PDF audit reports available for download.

GET /reports/{id} Download PDF report

Initiates a file download for a specific generated PDF report

POST /reports/generate Generate a new audit report

Triggers the compilation and generation of a new PDF report based on the latest audit data.

📈 Analytics API

Retrieve aggregate platform statistics and trends.

GET /analytics/overview Get analytics overview

Returns high-level statistics including:

  • Total Audits
  • Average Health Score
  • SEO Trends
  • Performance Trends
  • Monitoring Statistics

⚠️ Error Codes

Code Status Description
400 Bad Request The request was malformed or missing required parameters. Check your request body and query parameters.
401 Unauthorized Invalid or missing API key. Ensure your Authorization header is correctly formatted.
403 Forbidden Your API key does not have sufficient permissions for this operation.
404 Not Found The requested resource does not exist. Check the resource ID in your request.
429 Rate Limited Rate limit exceeded. Retry after the period specified in the Retry-After response header.
500 Internal Server Error An unexpected error occurred on our servers. Please try again or contact support if it persists.

🔒 API Security Best Practices

🔐 HTTPS Required

All API requests must be made over HTTPS. Plain HTTP requests will be rejected.

🔑 API Key Authentication

Ensure that all requests include a valid API access token in the Authorization header.

🔄 Token Rotation

Periodically rotate your API keys to minimize risk if a token is accidentally exposed.

⏱️ Rate Limiting

Implement exponential backoff in your code to elegantly handle 429 Rate Limited responses.

🛡️ Secure Credential Storage

Store API keys in environment variables or a secrets manager. Never expose credentials in client-side code or public repositories.

Need Help with the API?

Our developer support team is ready to help you integrate, debug, and get the most out of SiteMonitor's API.