API Documentation
Overview
301check.com provides a free HTTP redirect chain API that you can integrate directly into your own applications. No registration, no API key — just make a POST request and get results.
✨ API features
- Completely free, no signup required
- Supports all HTTP redirect types (301/302/303/307/308)
- Returns the full redirect chain
- Includes response times, server IPs, and TLS certificate details
- JSON responses, easy to parse
- Bilingual error messages via
langparameter
Endpoint
POST
https://www.301check.com/check.php
Request format
Headers
Content-Type: application/json
Body
{
"url": "https://example.com",
"lang": "en"
}
Parameters
url(required) — the URL to check; HTTP and HTTPS both supportedlang(optional) — language for error messages:enorzh. Defaults to auto-detection viaAccept-Language.
⚠️ URL format
The URL must include a scheme (http:// or https://). If you pass a bare domain like example.com, the API will prepend http:// automatically.
Response format
Success
{
"success": true,
"timestamp": "2026-02-22T10:00:00+08:00",
"inputUrl": "https://example.com",
"finalUrl": "https://www.example.com",
"totalRedirects": 1,
"totalTime": 0.390,
"loopDetected": false,
"maxRedirectsReached": false,
"redirects": [
{
"hop": 1,
"statusCode": 301,
"statusMessage": "Moved Permanently",
"type": "permanent",
"from": "https://example.com",
"to": "https://www.example.com",
"duration": 0.234,
"ip": "93.184.216.34",
"server": "nginx/1.18.0",
"tlsInfo": {
"protocol": "TLSv1.3",
"subject": "example.com",
"issuer": "Let's Encrypt",
"expires": "2026-04-01"
},
"headers": {
"server": "nginx/1.18.0",
"location": "https://www.example.com"
}
}
]
}
Error
{
"success": false,
"error": "Invalid URL. Please enter a valid HTTP or HTTPS URL."
}
Code examples
cURL
curl -X POST https://www.301check.com/check.php \
-H "Content-Type: application/json" \
-d '{"url":"https://example.com","lang":"en"}'
Python
import requests
resp = requests.post(
"https://www.301check.com/check.php",
json={"url": "https://example.com", "lang": "en"}
)
data = resp.json()
if data["success"]:
print(f"Hops: {data['totalRedirects']}, Final: {data['finalUrl']}")
for hop in data["redirects"]:
print(f" {hop['hop']}. {hop['statusCode']} {hop['from']}")
else:
print("Error:", data["error"])
JavaScript
const res = await fetch('https://www.301check.com/check.php', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ url: 'https://example.com', lang: 'en' })
});
const data = await res.json();
if (data.success) {
console.log(`${data.totalRedirects} hops → ${data.finalUrl}`);
data.redirects.forEach(h => console.log(` ${h.hop}. ${h.statusCode} ${h.from}`));
}
PHP
<?php
$ch = curl_init('https://www.301check.com/check.php');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => json_encode(['url' => 'https://example.com', 'lang' => 'en']),
CURLOPT_HTTPHEADER => ['Content-Type: application/json'],
]);
$data = json_decode(curl_exec($ch), true);
curl_close($ch);
echo $data['success'] ? $data['totalRedirects'] . " hops\n" : $data['error'] . "\n";
?>
Rate limits
- Per IP: 5 requests per 10 seconds
- When exceeded: HTTP 429 with a bilingual error message
Error handling
Always check the success field. Possible error conditions:
- Invalid or missing URL
- Rate limit exceeded
- Connection timeout (15s)
- DNS resolution failure
- Private/internal IP address blocked
💡 Tip
Need higher rate limits or enterprise support? Reach out: api@301check.com