Fetch and view the complete source code from any website URL
Fetching source code...
POST/GET /api/fetch-source
All API requests require authentication with an API key. Provide your API key in one of these ways:
Authorization: Bearer YOUR_API_KEYX-API-Key: YOUR_API_KEY?api_key=YOUR_API_KEY
curl "https://your-app.replit.app/api/fetch-source?url=https://example.com&api_key=YOUR_API_KEY"
curl -X POST "https://your-app.replit.app/api/fetch-source" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{"url": "https://example.com"}'
curl -X POST "https://your-app.replit.app/api/fetch-source" \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-d '{"url": "https://example.com"}'
fetch('/api/fetch-source', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-API-Key': 'YOUR_API_KEY'
},
body: JSON.stringify({ url: 'https://example.com' })
}).then(response => response.json())
{
"success": true,
"url": "https://example.com",
"source_code": "...",
"metadata": {
"status_code": 200,
"content_type": "text/html",
"content_length": 1024,
"encoding": "utf-8",
"response_time_ms": 150.5,
"final_url": "https://example.com",
"headers": {...}
}
}