Initial commit: URL Redirect Tracker application with comprehensive documentation
This commit is contained in:
94
public/api-docs.html
Normal file
94
public/api-docs.html
Normal file
@@ -0,0 +1,94 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>URL Redirect Tracker - API Documentation</title>
|
||||
<link rel="stylesheet" href="styles.css">
|
||||
</head>
|
||||
<body class="dark-mode">
|
||||
<div class="container">
|
||||
<div class="header-container">
|
||||
<h1>URL Redirect Tracker - API Documentation</h1>
|
||||
<p>Programmatically track and analyze URL redirect chains with our public API</p>
|
||||
<div class="back-link" style="margin-top: 15px;">
|
||||
<a href="/" class="button">← Back to Tracker</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="content">
|
||||
<section>
|
||||
<h2>Introduction</h2>
|
||||
<p>The URL Redirect Tracker API allows you to programmatically track and analyze URL redirect chains. The API is rate-limited to 100 requests per hour per IP address.</p>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h2>API Endpoints</h2>
|
||||
|
||||
<div class="card">
|
||||
<h3>POST /api/v1/track</h3>
|
||||
<p>Track a URL and get the full redirect chain using a POST request.</p>
|
||||
|
||||
<h4>Request Parameters (JSON Body)</h4>
|
||||
<ul>
|
||||
<li><strong>url</strong> (string, required): The URL to track</li>
|
||||
<li><strong>method</strong> (string, optional): HTTP method (GET, HEAD, POST). Default: "GET"</li>
|
||||
<li><strong>userAgent</strong> (string, optional): Custom User-Agent header</li>
|
||||
</ul>
|
||||
|
||||
<h4>Example Request</h4>
|
||||
<pre><code>curl -X POST https://urltrackertool.com/api/v1/track \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"url": "github.com",
|
||||
"method": "GET"
|
||||
}'</code></pre>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<h3>GET /api/v1/track</h3>
|
||||
<p>Track a URL and get the full redirect chain using a GET request with query parameters.</p>
|
||||
|
||||
<h4>Request Parameters (Query String)</h4>
|
||||
<ul>
|
||||
<li><strong>url</strong> (string, required): The URL to track</li>
|
||||
<li><strong>method</strong> (string, optional): HTTP method (GET, HEAD, POST). Default: "GET"</li>
|
||||
<li><strong>userAgent</strong> (string, optional): Custom User-Agent header</li>
|
||||
</ul>
|
||||
|
||||
<h4>Example Request</h4>
|
||||
<pre><code>curl "https://urltrackertool.com/api/v1/track?url=github.com&method=GET"</code></pre>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h2>Response Format</h2>
|
||||
<p>Both endpoints return the same JSON response structure:</p>
|
||||
<pre><code>{
|
||||
"success": true,
|
||||
"status": 200,
|
||||
"data": {
|
||||
"url": "http://github.com",
|
||||
"method": "GET",
|
||||
"redirectCount": 1,
|
||||
"finalUrl": "https://github.com/",
|
||||
"finalStatusCode": 200,
|
||||
"redirects": [
|
||||
// Array of redirect objects with detailed information
|
||||
]
|
||||
}
|
||||
}</code></pre>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h2>Error Codes</h2>
|
||||
<ul>
|
||||
<li><strong>400</strong> - Bad Request (missing parameters)</li>
|
||||
<li><strong>429</strong> - Too Many Requests (rate limit exceeded)</li>
|
||||
<li><strong>500</strong> - Server Error</li>
|
||||
</ul>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user