SDK Integration Guide
Start contributing real-time API health signals with a single line of code.
Getting Started
Get up and running with APIdown in three steps:
Sign up at apidown.net/login and generate an API key from your dashboard.
Run npm install apidown-monitor (JavaScript) or pip install apidown (Python).
Call apidown.init({ key: 'YOUR_KEY' }) in your app entry point. All outbound HTTP calls are automatically monitored.
JavaScript / Node.js
Install
npm install apidown-monitorInitialize
import apidown from 'apidown-monitor';
apidown.init({ key: 'YOUR_SDK_KEY' });
// That's it — all fetch() and axios calls are automatically monitored.Express / Node.js
const apidown = require('apidown-monitor');
apidown.init({ key: process.env.APIDOWN_KEY });
const express = require('express');
const app = express();
// All outbound API calls are now monitoredNext.js
// lib/apidown.js
import apidown from 'apidown-monitor';
if (typeof window === 'undefined') {
if (!global._apidownInit) {
apidown.init({ key: process.env.APIDOWN_KEY });
global._apidownInit = true;
}
}SvelteKit
// src/hooks.server.js
import apidown from 'apidown-monitor';
apidown.init({ key: import.meta.env.APIDOWN_KEY });Python
Install
pip install apidownInitialize
import apidown
apidown.init(key='YOUR_SDK_KEY')
# All requests and httpx calls are automatically monitored.Django
# manage.py or wsgi.py
import apidown, os
apidown.init(key=os.environ['APIDOWN_KEY'])
# All requests library calls automatically reportedFastAPI
import apidown, os
apidown.init(key=os.environ['APIDOWN_KEY'])
from fastapi import FastAPI
import httpx
app = FastAPI()
# httpx.Client is auto-patchedConfiguration Options
| Option | Default | Description |
|---|---|---|
key | — | Required. Your SDK key from apidown.net/dashboard |
endpoint | ingest.apidown.net | Override the ingest endpoint |
flushInterval | 30000 | Milliseconds between batched transmissions |
maxBatchSize | 100 | Maximum signals per batch |
allowlist | [] | Only monitor these domains |
denylist | [] | Never monitor these domains |
debug | false | Enable console logging |
Privacy
APIdown never captures request payloads, headers, authentication tokens, or any user data. Only domain, HTTP status code, response duration (ms), and timestamp are transmitted. All data is anonymized at the SDK level before transmission.
REST API Reference
APIdown provides public REST endpoints for programmatic access to status data.
Get API Status
/api-status/{slug}Returns JSON status for a specific API. No authentication required.
Submit Signals
/v1/signalsSubmit a batch of monitoring signals. Requires X-APIdown-Key header with your SDK key.
Generate API Key
/v1/keysGenerate a new SDK key. Requires authentication via bearer token.
Subscribe to Alerts
/v1/subscribeCreate an alert subscription for an API. Supports email, Slack, Discord, PagerDuty, Teams, and webhook channels.
Report an Issue
/v1/reportsSubmit a manual issue report for an API to help the community.
SLA Report (Pro)
/v1/reports/sla?api_slug={slug}Download an SLA compliance report in JSON format. Requires Pro tier.
Manual Recording
For custom HTTP clients not auto-patched by the SDK:
// JavaScript
const start = Date.now();
try {
const res = await myClient.get('https://api.stripe.com/v1/charges');
apidown.record('api.stripe.com', res.statusCode, Date.now() - start);
} catch (e) {
apidown.record('api.stripe.com', 0, Date.now() - start);
throw e;
}# Python
import apidown, time
start = time.time()
try:
resp = await session.get('https://api.stripe.com/v1/charges')
apidown.record('api.stripe.com', resp.status, int((time.time()-start)*1000))
except Exception:
apidown.record('api.stripe.com', 0, int((time.time()-start)*1000))
raiseTroubleshooting
Signals not appearing in dashboard
Ensure your SDK key is correct and active. Check that apidown.init() is called before any HTTP requests. Enable debug: true in the config to see console output.
SDK conflicts with existing interceptors
APIdown patches fetch, axios, and requests at the module level. If you have custom interceptors, ensure APIdown is initialized first. Use the allowlist or denylist config to control which domains are monitored.
High signal volume / rate limiting
The SDK batches signals and respects rate limits automatically. Free tier allows 10,000 signals/day; Pro allows 100,000. Increase flushInterval or use allowlist to reduce volume.
SDK not initializing in serverless environments
In Lambda/Vercel/Cloudflare Workers, call init() outside the handler to avoid re-initialization on each invocation. Use the global guard pattern shown in the Next.js example above.