mirror of
https://github.com/plexguide/Huntarr.io.git
synced 2026-02-08 07:09:12 -06:00
376 lines
18 KiB
HTML
376 lines
18 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>API Documentation - Huntarr.io</title>
|
|
<link rel="stylesheet" href="css/main.css">
|
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/styles/atom-one-dark.min.css">
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/highlight.min.js"></script>
|
|
<script src="js/main.js" defer></script>
|
|
<style>
|
|
.endpoint-section {
|
|
background: rgba(30, 41, 59, 0.6);
|
|
border: 1px solid rgba(100, 116, 139, 0.3);
|
|
border-radius: 12px;
|
|
padding: 24px;
|
|
margin: 24px 0;
|
|
}
|
|
|
|
.endpoint-header {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 12px;
|
|
margin-bottom: 16px;
|
|
}
|
|
|
|
.http-method {
|
|
padding: 6px 12px;
|
|
border-radius: 6px;
|
|
font-weight: 600;
|
|
font-size: 14px;
|
|
font-family: 'Courier New', monospace;
|
|
}
|
|
|
|
.http-method.get {
|
|
background: rgba(34, 197, 94, 0.2);
|
|
color: #4ade80;
|
|
border: 1px solid rgba(34, 197, 94, 0.4);
|
|
}
|
|
|
|
.http-method.post {
|
|
background: rgba(59, 130, 246, 0.2);
|
|
color: #60a5fa;
|
|
border: 1px solid rgba(59, 130, 246, 0.4);
|
|
}
|
|
|
|
.endpoint-path {
|
|
font-family: 'Courier New', monospace;
|
|
font-size: 16px;
|
|
color: #94a3b8;
|
|
}
|
|
|
|
.endpoint-description {
|
|
color: #cbd5e1;
|
|
margin-bottom: 20px;
|
|
line-height: 1.7;
|
|
}
|
|
|
|
.code-block {
|
|
background: #1e293b;
|
|
border: 1px solid rgba(100, 116, 139, 0.3);
|
|
border-radius: 8px;
|
|
padding: 16px;
|
|
margin: 16px 0;
|
|
overflow-x: auto;
|
|
}
|
|
|
|
.code-block pre {
|
|
margin: 0;
|
|
color: #e2e8f0;
|
|
font-family: 'Courier New', monospace;
|
|
font-size: 14px;
|
|
}
|
|
|
|
.code-label {
|
|
font-weight: 600;
|
|
color: #3b82f6;
|
|
margin-bottom: 8px;
|
|
display: block;
|
|
}
|
|
|
|
.auth-badge {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: 6px;
|
|
padding: 6px 12px;
|
|
border-radius: 6px;
|
|
font-size: 13px;
|
|
font-weight: 600;
|
|
}
|
|
|
|
.auth-badge.public {
|
|
background: rgba(34, 197, 94, 0.2);
|
|
color: #4ade80;
|
|
border: 1px solid rgba(34, 197, 94, 0.4);
|
|
}
|
|
|
|
.auth-badge.protected {
|
|
background: rgba(245, 158, 11, 0.2);
|
|
color: #fbbf24;
|
|
border: 1px solid rgba(245, 158, 11, 0.4);
|
|
}
|
|
|
|
.use-cases {
|
|
background: rgba(59, 130, 246, 0.1);
|
|
border-left: 4px solid #3b82f6;
|
|
padding: 16px;
|
|
margin: 16px 0;
|
|
border-radius: 4px;
|
|
}
|
|
|
|
.use-cases h4 {
|
|
margin-top: 0;
|
|
color: #60a5fa;
|
|
}
|
|
|
|
.use-cases ul {
|
|
margin: 0;
|
|
padding-left: 20px;
|
|
}
|
|
|
|
.use-cases li {
|
|
color: #cbd5e1;
|
|
margin: 8px 0;
|
|
}
|
|
|
|
.alert-info {
|
|
background: rgba(59, 130, 246, 0.1);
|
|
border: 1px solid rgba(59, 130, 246, 0.3);
|
|
border-radius: 8px;
|
|
padding: 16px;
|
|
margin: 20px 0;
|
|
}
|
|
|
|
.alert-info strong {
|
|
color: #60a5fa;
|
|
}
|
|
|
|
.alert-info p {
|
|
margin: 8px 0 0 0;
|
|
color: #cbd5e1;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="sidebar">
|
|
<div class="sidebar-logo">
|
|
<img src="images/huntarr-logo.png" alt="Huntarr Logo">
|
|
<h2>Huntarr.io</h2>
|
|
</div>
|
|
|
|
<nav class="sidebar-nav">
|
|
<div class="sidebar-section">
|
|
<h3 class="sidebar-section-title">Getting Started</h3>
|
|
<ul>
|
|
<li><a href="donate.html"><i class="fas fa-heart" style="color: #e91e63; font-size: 18px; width: 24px; height: 24px; margin-right: 8px; display: inline-flex; align-items: center; justify-content: center;"></i> Donate</a></li>
|
|
<li><a href="getting-started/installation.html"><svg class="svg-icon" viewBox="0 0 24 24" fill="currentColor"><path d="M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z"></path></svg> Installation</a></li>
|
|
</ul>
|
|
</div>
|
|
|
|
<div class="sidebar-section">
|
|
<h3 class="sidebar-section-title">Core</h3>
|
|
<ul>
|
|
<li><a href="index.html"><svg class="svg-icon" viewBox="0 0 24 24" fill="currentColor"><path d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"></path></svg> Home</a></li>
|
|
<li><a href="apps/index.html"><svg class="svg-icon" viewBox="0 0 24 24" fill="currentColor"><path d="M4 8h4V4H4v4zm6 12h4v-4h-4v4zm-6 0h4v-4H4v4zm0-6h4v-4H4v4zm6 0h4v-4h-4v4zm6-10v4h4V4h-4zm-6 4h4V4h-4v4zm6 6h4v-4h-4v4zm0 6h4v-4h-4v4z"></path></svg> Apps</a></li>
|
|
<li><a href="settings/settings.html"><svg class="svg-icon" viewBox="0 0 24 24" fill="currentColor"><path d="M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z"></path></svg> Settings</a></li>
|
|
<li><a href="features/index.html"><i class="fas fa-star" style="width: 24px; height: 24px; margin-right: 8px; display: inline-flex; align-items: center; justify-content: center;"></i> Features</a></li>
|
|
<li><a href="faq.html"><i class="fas fa-question-circle" style="width: 24px; height: 24px; margin-right: 8px; display: inline-flex; align-items: center; justify-content: center;"></i> FAQ</a></li>
|
|
<li class="active"><a href="api.html"><i class="fas fa-code" style="width: 24px; height: 24px; margin-right: 8px; display: inline-flex; align-items: center; justify-content: center;"></i> API</a></li>
|
|
</ul>
|
|
</div>
|
|
|
|
<div class="sidebar-section">
|
|
<h3 class="sidebar-section-title">Resources</h3>
|
|
<ul>
|
|
<li><a href="https://github.com/plexguide/Huntarr.io" target="_blank"><svg class="svg-icon" viewBox="0 0 24 24" fill="currentColor"><path d="M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.30 3.297-1.30.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z"></path></svg> GitHub</a></li>
|
|
<li><a href="https://discord.com/invite/PGJJjR5Cww" target="_blank"><i class="fab fa-discord" style="color: #5865F2; font-size: 18px; width: 24px; height: 24px; margin-right: 8px; display: inline-flex; align-items: center; justify-content: center;"></i> Discord</a></li>
|
|
<li><a href="https://www.reddit.com/r/huntarr/" target="_blank"><i class="fab fa-reddit-alien" style="color: #FF4500; font-size: 18px; width: 24px; height: 24px; margin-right: 8px; display: inline-flex; align-items: center; justify-content: center;"></i> Reddit</a></li>
|
|
</ul>
|
|
</div>
|
|
</nav>
|
|
</div>
|
|
|
|
<div class="main-content">
|
|
<div class="container">
|
|
<h1><i class="fas fa-code" style="margin-right: 12px; color: #3b82f6;"></i>API Documentation</h1>
|
|
|
|
<p style="font-size: 18px; color: #94a3b8; margin-bottom: 32px;">
|
|
Huntarr provides public API endpoints for integration with external monitoring tools, automation scripts, and third-party applications.
|
|
</p>
|
|
|
|
<div class="alert-info">
|
|
<strong><i class="fas fa-info-circle"></i> Base URL</strong>
|
|
<p>All API endpoints are relative to your Huntarr installation URL. For example, if Huntarr is running at <code>http://localhost:9705</code>, the full endpoint would be <code>http://localhost:9705/api/version</code>.</p>
|
|
<p><strong>Note:</strong> Endpoints marked as "Public" do not require authentication and work with reverse proxy configurations (BASE_URL).</p>
|
|
</div>
|
|
|
|
<h2 style="margin-top: 48px; margin-bottom: 24px; color: #e2e8f0;">Public Endpoints</h2>
|
|
|
|
<!-- Version Endpoint -->
|
|
<div class="endpoint-section">
|
|
<div class="endpoint-header">
|
|
<span class="http-method get">GET</span>
|
|
<span class="endpoint-path">/api/version</span>
|
|
<span class="auth-badge public"><i class="fas fa-globe"></i> Public</span>
|
|
</div>
|
|
|
|
<p class="endpoint-description">
|
|
Returns the currently running Huntarr version. This endpoint is useful for monitoring tools, version checks in deployment scripts, and tracking versions across multiple Huntarr instances.
|
|
</p>
|
|
|
|
<div class="code-label">Response (200 OK)</div>
|
|
<div class="code-block">
|
|
<pre><code class="language-json">{
|
|
"version": "9.1.7"
|
|
}</code></pre>
|
|
</div>
|
|
|
|
<div class="use-cases">
|
|
<h4><i class="fas fa-lightbulb"></i> Use Cases</h4>
|
|
<ul>
|
|
<li><strong>Version Monitoring:</strong> Integrate with tools like <a href="https://github.com/release-argus/Argus" target="_blank" style="color: #60a5fa;">Argus</a> to track version updates</li>
|
|
<li><strong>Deployment Automation:</strong> Verify successful deployments after updates</li>
|
|
<li><strong>Multi-Instance Management:</strong> Track versions across multiple Huntarr instances</li>
|
|
<li><strong>Health Checks:</strong> Include version info in system health dashboards</li>
|
|
</ul>
|
|
</div>
|
|
|
|
<div class="code-label">Example: cURL</div>
|
|
<div class="code-block">
|
|
<pre><code class="language-bash">curl http://your-huntarr-instance:9705/api/version</code></pre>
|
|
</div>
|
|
|
|
<div class="code-label">Example: Python</div>
|
|
<div class="code-block">
|
|
<pre><code class="language-python">import requests
|
|
|
|
response = requests.get('http://your-huntarr-instance:9705/api/version')
|
|
version_data = response.json()
|
|
print(f"Huntarr version: {version_data['version']}")</code></pre>
|
|
</div>
|
|
|
|
<div class="code-label">Example: JavaScript</div>
|
|
<div class="code-block">
|
|
<pre><code class="language-javascript">fetch('http://your-huntarr-instance:9705/api/version')
|
|
.then(response => response.json())
|
|
.then(data => console.log(`Huntarr version: ${data.version}`))
|
|
.catch(error => console.error('Error:', error));</code></pre>
|
|
</div>
|
|
|
|
<div class="code-label">Example: PowerShell</div>
|
|
<div class="code-block">
|
|
<pre><code class="language-powershell">$response = Invoke-RestMethod -Uri "http://your-huntarr-instance:9705/api/version"
|
|
Write-Host "Huntarr version: $($response.version)"</code></pre>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Health Check Endpoint -->
|
|
<div class="endpoint-section">
|
|
<div class="endpoint-header">
|
|
<span class="http-method get">GET</span>
|
|
<span class="endpoint-path">/api/health</span>
|
|
<span class="auth-badge public"><i class="fas fa-globe"></i> Public</span>
|
|
</div>
|
|
|
|
<p class="endpoint-description">
|
|
Health check endpoint that returns HTTP 200 if the application is running. Useful for container orchestration, load balancers, and monitoring systems.
|
|
</p>
|
|
|
|
<div class="code-label">Response (200 OK)</div>
|
|
<div class="code-block">
|
|
<pre><code class="language-json">{
|
|
"status": "healthy"
|
|
}</code></pre>
|
|
</div>
|
|
|
|
<div class="use-cases">
|
|
<h4><i class="fas fa-lightbulb"></i> Use Cases</h4>
|
|
<ul>
|
|
<li><strong>Container Health:</strong> Docker/Kubernetes health check probes</li>
|
|
<li><strong>Load Balancers:</strong> Backend health checks for reverse proxies</li>
|
|
<li><strong>Uptime Monitoring:</strong> UptimeRobot, Better Uptime, etc.</li>
|
|
<li><strong>Deployment Verification:</strong> Confirm service is running post-deployment</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
|
|
<h2 style="margin-top: 48px; margin-bottom: 24px; color: #e2e8f0;">Notes & Best Practices</h2>
|
|
|
|
<div class="endpoint-section">
|
|
<h3><i class="fas fa-network-wired" style="margin-right: 8px; color: #3b82f6;"></i>Reverse Proxy / BASE_URL Support</h3>
|
|
<p class="endpoint-description">
|
|
All endpoints respect the <code>BASE_URL</code> configuration. If you're running Huntarr behind a reverse proxy at a subpath (e.g., <code>https://domain.com/huntarr/</code>), the endpoints will work correctly:
|
|
</p>
|
|
<div class="code-block">
|
|
<pre><code class="language-bash"># Standard deployment
|
|
curl http://localhost:9705/api/version
|
|
|
|
# With BASE_URL=/huntarr
|
|
curl http://localhost:9705/huntarr/api/version
|
|
|
|
# Behind reverse proxy with SSL
|
|
curl https://domain.com/huntarr/api/version</code></pre>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="endpoint-section">
|
|
<h3><i class="fas fa-shield-alt" style="margin-right: 8px; color: #3b82f6;"></i>Security Considerations</h3>
|
|
<p class="endpoint-description">
|
|
Public endpoints are intentionally unauthenticated to enable external monitoring without requiring credentials. However, consider:
|
|
</p>
|
|
<ul style="color: #cbd5e1; line-height: 1.8;">
|
|
<li><strong>Exposure:</strong> Version information is not sensitive, but be aware it's publicly accessible</li>
|
|
<li><strong>Rate Limiting:</strong> No rate limiting is applied to public endpoints</li>
|
|
<li><strong>Firewall Rules:</strong> If security is a concern, use firewall rules to restrict access to monitoring IPs</li>
|
|
</ul>
|
|
</div>
|
|
|
|
<div class="endpoint-section">
|
|
<h3><i class="fas fa-wrench" style="margin-right: 8px; color: #3b82f6;"></i>Integration Examples</h3>
|
|
|
|
<h4 style="color: #60a5fa; margin-top: 20px;">Docker Health Check</h4>
|
|
<div class="code-block">
|
|
<pre><code class="language-yaml">services:
|
|
huntarr:
|
|
image: ghcr.io/plexguide/huntarr:latest
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:9705/api/health"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 40s</code></pre>
|
|
</div>
|
|
|
|
<h4 style="color: #60a5fa; margin-top: 20px;">Kubernetes Liveness Probe</h4>
|
|
<div class="code-block">
|
|
<pre><code class="language-yaml">livenessProbe:
|
|
httpGet:
|
|
path: /api/health
|
|
port: 9705
|
|
initialDelaySeconds: 30
|
|
periodSeconds: 10</code></pre>
|
|
</div>
|
|
|
|
<h4 style="color: #60a5fa; margin-top: 20px;">Argus Configuration</h4>
|
|
<div class="code-block">
|
|
<pre><code class="language-yaml">service:
|
|
huntarr:
|
|
type: url
|
|
url: "http://your-huntarr-instance:9705/api/version"
|
|
url_commands:
|
|
- type: "json"
|
|
key: "version"
|
|
notify:
|
|
discord:
|
|
webhook_id: "your-webhook"</code></pre>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="alert-info" style="margin-top: 32px;">
|
|
<strong><i class="fas fa-comments"></i> Need Help?</strong>
|
|
<p>If you have questions about the API or need additional endpoints, join our <a href="https://discord.com/invite/PGJJjR5Cww" target="_blank" style="color: #60a5fa;">Discord community</a> or open an issue on <a href="https://github.com/plexguide/Huntarr.io/issues" target="_blank" style="color: #60a5fa;">GitHub</a>.</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
// Initialize syntax highlighting
|
|
document.addEventListener('DOMContentLoaded', () => {
|
|
hljs.highlightAll();
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|