Skip to content

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:

1
Create a free account

Sign up at apidown.net/login and generate an API key from your dashboard.

2
Install the SDK

Run npm install apidown-monitor (JavaScript) or pip install apidown (Python).

3
Initialize and deploy

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-monitor

Initialize

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 monitored

Next.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 apidown

Initialize

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 reported

FastAPI

import apidown, os
apidown.init(key=os.environ['APIDOWN_KEY'])

from fastapi import FastAPI
import httpx

app = FastAPI()

# httpx.Client is auto-patched

Configuration Options

OptionDefaultDescription
keyRequired. Your SDK key from apidown.net/dashboard
endpointingest.apidown.netOverride the ingest endpoint
flushInterval30000Milliseconds between batched transmissions
maxBatchSize100Maximum signals per batch
allowlist[]Only monitor these domains
denylist[]Never monitor these domains
debugfalseEnable 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

GET /api-status/{slug}

Returns JSON status for a specific API. No authentication required.

Submit Signals

POST /v1/signals

Submit a batch of monitoring signals. Requires X-APIdown-Key header with your SDK key.

Generate API Key

POST /v1/keys

Generate a new SDK key. Requires authentication via bearer token.

Subscribe to Alerts

POST /v1/subscribe

Create an alert subscription for an API. Supports email, Slack, Discord, PagerDuty, Teams, and webhook channels.

Report an Issue

POST /v1/reports

Submit a manual issue report for an API to help the community.

SLA Report (Pro)

GET /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))
    raise

Troubleshooting

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.