Introduction
If you've ever spent hours running manual SEO audits—checking meta tags, analyzing header structures, testing mobile responsiveness, examining backlinks—you know how time-consuming it can be. What if I told you that you could automate this entire process with a single API call?
In this tutorial, I'll show you exactly how to build a production-ready SEO audit tool in under 10 minutes using the Instant SEO Audit API. Whether you're a freelancer, agency owner, or developer building tools for clients, this approach will save you hundreds of hours every year.
Why Manual SEO Audits Are Killing Your Productivity
Traditional SEO audits require:
- Manual checking: Opening each page, inspecting the code, reviewing metadata
- Multiple tools: Using Semrush, Ahrefs, Moz (subscription costs: $100-1000+/month)
- Time investment: 30-60 minutes per website audit
- Inconsistency: Human error, missed issues, inconsistent reporting
- Scaling challenges: Nearly impossible to audit multiple sites regularly
The Instant SEO Audit API changes this equation entirely.
What We're Building Today
We'll create a command-line SEO audit tool that:
- Takes a website URL as input
- Calls the Instant SEO Audit API to analyze the site
- Processes the response and extracts key metrics
- Generates a readable report with actionable recommendations
- Exports results in JSON format for further analysis
The best part? The entire application is fewer than 100 lines of code.
Step 1: Get Your API Credentials
Navigate to the Instant SEO Audit API on RapidAPI. Click "Subscribe" and select the free tier. You'll receive:
- Your API Key (found in the dashboard)
- Your API Host (always
instant-seo-audit.p.rapidapi.com)
Step 2: Building the Node.js Version
Create a file called seo-audit.js:
const https = require('https');
const API_KEY = 'YOUR_API_KEY_HERE';
const API_HOST = 'instant-seo-audit.p.rapidapi.com';
const WEBSITE_URL = process.argv[2] || 'https://example.com';
function auditWebsite(url) {
return new Promise((resolve, reject) => {
const options = {
hostname: API_HOST,
path: `/api/audit?url=${encodeURIComponent(url)}`,
method: 'GET',
headers: {
'x-rapidapi-key': API_KEY,
'x-rapidapi-host': API_HOST
}
};
const req = https.request(options, (res) => {
let data = '';
res.on('data', (chunk) => { data += chunk; });
res.on('end', () => {
try { resolve(JSON.parse(data)); }
catch (error) { reject(new Error('Failed to parse response')); }
});
});
req.on('error', reject);
req.end();
});
}
function displayResults(auditData) {
console.log('\n========== SEO AUDIT REPORT ==========\n');
if (auditData.overall_score)
console.log(`Overall SEO Score: ${auditData.overall_score}/100`);
if (auditData.page_title)
console.log(`Page Title: "${auditData.page_title.title}" (${auditData.page_title.length} chars)`);
if (auditData.meta_description)
console.log(`Meta Description: ${auditData.meta_description.length} chars`);
if (auditData.headings)
console.log(`Headings - H1: ${auditData.headings.h1_count}, H2: ${auditData.headings.h2_count}`);
if (auditData.recommendations) {
console.log(`\nTop Recommendations (${auditData.recommendations.length}):`);
auditData.recommendations.slice(0, 5).forEach((rec, i) => {
console.log(` ${i+1}. ${rec.title} (Priority: ${rec.priority})`);
});
}
console.log('\n======================================\n');
}
async function main() {
try {
console.log(`Auditing: ${WEBSITE_URL}\n`);
const results = await auditWebsite(WEBSITE_URL);
displayResults(results);
require('fs').writeFileSync(`audit-${Date.now()}.json`, JSON.stringify(results, null, 2));
console.log('Audit data exported to JSON file');
} catch (error) {
console.error('Audit failed:', error.message);
}
}
main();
Run it:
node seo-audit.js https://yourwebsite.com
Step 3: Python Version
Create seo-audit.py:
import requests, json, sys
from datetime import datetime
API_KEY = 'YOUR_API_KEY_HERE'
API_HOST = 'instant-seo-audit.p.rapidapi.com'
URL = sys.argv[1] if len(sys.argv) > 1 else 'https://example.com'
def audit_website(url):
headers = {
'x-rapidapi-key': API_KEY,
'x-rapidapi-host': API_HOST
}
response = requests.get(
f'https://{API_HOST}/api/audit',
headers=headers,
params={'url': url},
timeout=30
)
response.raise_for_status()
return response.json()
def display_results(data):
print('\n========== SEO AUDIT REPORT ==========')
if 'overall_score' in data:
print(f"Score: {data['overall_score']}/100")
if 'page_title' in data:
print(f"Title: {data['page_title'].get('title')} ({data['page_title'].get('length')} chars)")
if 'headings' in data:
print(f"H1: {data['headings'].get('h1_count')}, H2: {data['headings'].get('h2_count')}")
if 'recommendations' in data:
for i, rec in enumerate(data['recommendations'][:5], 1):
print(f" {i}. {rec['title']} ({rec['priority']})")
print('======================================\n')
if __name__ == '__main__':
print(f'Auditing: {URL}')
results = audit_website(URL)
display_results(results)
with open(f"audit-{int(datetime.now().timestamp())}.json", 'w') as f:
json.dump(results, f, indent=2)
print('Exported to JSON')
Understanding the API Response
| Metric | Optimal Range | Why It Matters |
|---|---|---|
| Overall Score | 90-100 | Excellent SEO foundation |
| Page Title | 50-60 chars | Gets truncated if too long |
| Meta Description | 150-160 chars | Affects click-through rate |
| H1 Tags | Exactly 1 | Defines page topic |
| Page Speed | Under 3 seconds | Core Web Vital ranking factor |
| Mobile Friendly | Yes | Google uses mobile-first indexing |
Batch Auditing Multiple Sites
const sites = ['https://site1.com', 'https://site2.com', 'https://site3.com'];
async function batchAudit(websites) {
const results = {};
for (const site of websites) {
console.log(`Auditing ${site}...`);
results[site] = await auditWebsite(site);
await new Promise(r => setTimeout(r, 1000)); // Rate limiting
}
return results;
}
Pro Tips
- Schedule Regular Audits — Set up monthly audits to catch issues early
- Track Metrics Over Time — Store results in a database for trend analysis
- Automate Client Reports — Use JSON exports to generate automated reports
- Focus on High-Impact Issues — Address Critical and High priority items first
- Combine with Content Tools — Pair with the AI Content Generator API for a complete SEO + content workflow
Conclusion
Building a professional SEO audit tool no longer requires months of development or expensive subscriptions. With the Instant SEO Audit API, you can create a production-ready application in under 10 minutes.
Get started today:
- Subscribe to the Instant SEO Audit API (free tier available)
- Copy one of the code examples above
- Run your first audit
- Integrate into your workflow
Also check out the other Degani Agency APIs on RapidAPI:
- Web Scraper Extractor — Extract data from any website
- AI Text Analyzer — Sentiment analysis, translation, and more
- AI Content Generator — Generate blog posts, social media, email copy
Happy auditing!
Top comments (0)