API Documentation
Integrate our SEO audit capabilities into your own applications
Rate Limits
The API is limited to 5 requests per minute per IP address to ensure service availability for all users.
Getting Started
Our API allows you to perform SEO audits programmatically
The SEO Audit API is free to use with reasonable rate limits. No authentication is required for basic usage.
Base URL:
https://seo-audit-tool.com/api
GET /api/audit
Perform an SEO audit on a specified URL
Parameters
Name | Type | Required | Description |
---|---|---|---|
url | string | Yes | The URL to audit (must include http:// or https://) |
Example Request
GET /api/audit?url=https://example.com
Rate Limits
The API is limited to 5 requests per minute per IP address. If you exceed this limit, you'll receive a 429 Too Many Requests response.
Code Examples
How to use the API in different programming languages
// Using fetch with error handling and rate limit handling
async function auditWebsite(url) {
try {
const response = await fetch(
`https://seo-audit-tool.com/api/audit?url=${encodeURIComponent(url)}`
);
if (response.status === 429) {
const retryAfter = response.headers.get('retry-after') || 60;
console.log(`Rate limit exceeded. Retry after ${retryAfter} seconds.`);
return { error: 'Rate limit exceeded', retryAfter };
}
if (!response.ok) {
throw new Error(`Error: ${response.status}`);
}
const data = await response.json();
return data;
} catch (error) {
console.error('Error:', error);
return { error: error.message };
}
}
// Example usage
auditWebsite('https://example.com')
.then(result => {
if (result.error) {
console.error(result.error);
return;
}
console.log(`Overall SEO score: ${result.score}`);
console.log(`Issues found: ${result.issues.length}`);
// Process issues by severity
const errors = result.issues.filter(issue => issue.severity === 'error');
const warnings = result.issues.filter(issue => issue.severity === 'warning');
const passed = result.issues.filter(issue => issue.severity === 'good');
console.log(`Errors: ${errors.length}`);
console.log(`Warnings: ${warnings.length}`);
console.log(`Passed: ${passed.length}`);
});