Authentication and API keys
Every request to /v1 and /mcp needs an API key, sent as a Bearer token or in the X-API-Key header. This page covers the key format, rotation, what the sandbox allows and how to keep keys safe.
How do I send my API key?#
Use either header. They are equivalent; if both are present, Authorization wins.
GET /v1/signals HTTP/1.1
Host: app.disruptapi.com
Authorization: Bearer dk_live_...GET /v1/signals HTTP/1.1
Host: app.disruptapi.com
X-API-Key: dk_live_...Keys are never accepted in the query string. The only /v1 routes that work without a key are GET /v1/plans, GET /v1/public/status and GET /v1/public/gnss-interference.
curl "https://app.disruptapi.com/v1/me" \
-H "Authorization: Bearer $DISRUPT_KEY"// Node.js 18+ (built-in fetch), saved as an .mjs file
const res = await fetch("https://app.disruptapi.com/v1/me", {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.DISRUPT_KEY}`,
},
signal: AbortSignal.timeout(30_000),
});
const json = await res.json();
if (!res.ok) {
throw new Error(`${res.status} ${json.error.code}: ${json.error.message}`);
}
console.log(JSON.stringify(json.data, null, 2));import os
import requests
resp = requests.get(
"https://app.disruptapi.com/v1/me",
headers={"Authorization": f"Bearer {os.environ['DISRUPT_KEY']}"},
timeout=30,
)
if not resp.ok:
err = resp.json()["error"]
raise SystemExit(f"{resp.status_code} {err['code']}: {err['message']}")
print(resp.json()["data"])import os
import httpx
with httpx.Client(
base_url="https://app.disruptapi.com",
headers={"Authorization": f"Bearer {os.environ['DISRUPT_KEY']}"},
timeout=30,
) as client:
resp = client.get("/v1/me")
if resp.is_error:
err = resp.json()["error"]
raise SystemExit(f"{resp.status_code} {err['code']}: {err['message']}")
print(resp.json()["data"])package main
import (
"fmt"
"io"
"log"
"net/http"
"os"
"time"
)
func main() {
req, err := http.NewRequest(http.MethodGet, "https://app.disruptapi.com/v1/me", nil)
if err != nil {
log.Fatal(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("DISRUPT_KEY"))
client := &http.Client{Timeout: 30 * time.Second}
resp, err := client.Do(req)
if err != nil {
log.Fatal(err)
}
defer resp.Body.Close()
out, err := io.ReadAll(resp.Body)
if err != nil {
log.Fatal(err)
}
fmt.Println(resp.StatusCode, string(out))
}require "json"
require "net/http"
require "uri"
uri = URI("https://app.disruptapi.com/v1/me")
req = Net::HTTP::Get.new(uri)
req["Authorization"] = "Bearer #{ENV.fetch("DISRUPT_KEY")}"
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true, open_timeout: 10, read_timeout: 30) do |http|
http.request(req)
end
json = JSON.parse(res.body)
abort "#{res.code} #{json["error"]["code"]}: #{json["error"]["message"]}" unless res.is_a?(Net::HTTPSuccess)
puts JSON.pretty_generate(json["data"])<?php
$ch = curl_init("https://app.disruptapi.com/v1/me");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer " . getenv("DISRUPT_KEY"),
],
]);
$raw = curl_exec($ch);
if ($raw === false) {
exit("request failed: " . curl_error($ch) . PHP_EOL);
}
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
curl_close($ch);
$json = json_decode($raw, true);
if ($status >= 400) {
exit("{$status} {$json['error']['code']}: {$json['error']['message']}" . PHP_EOL);
}
print_r($json["data"]);// Java 17+. Run with: java Main.java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.time.Duration;
public class Main {
public static void main(String[] args) throws Exception {
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://app.disruptapi.com/v1/me"))
.timeout(Duration.ofSeconds(30))
.header("Authorization", "Bearer " + System.getenv("DISRUPT_KEY"))
.GET()
.build();
HttpClient client = HttpClient.newBuilder().connectTimeout(Duration.ofSeconds(10)).build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode());
System.out.println(response.body());
}
}// .NET 7+ console app (top-level statements, C# 11 raw strings)
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using var http = new HttpClient { Timeout = TimeSpan.FromSeconds(30) };
http.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("DISRUPT_KEY"));
using var response = await http.GetAsync("https://app.disruptapi.com/v1/me");
Console.WriteLine((int)response.StatusCode);
Console.WriteLine(await response.Content.ReadAsStringAsync());What does a key look like?#
A key is dk_live_ followed by 32 random letters and digits. It is shown once, when you create it in the console. DisruptAPI stores only a SHA-256 hash and the first 14 characters, which the console shows so you can tell keys apart. If you lose a key, create a new one.
There is a single key type. There are no separate test keys or test hosts: a Sandbox key reads the same live data as a paid key, with smaller limits.
What happens when authentication fails?#
| Status | Code | Cause |
|---|---|---|
| 401 | missing_api_key | No Authorization: Bearer and no X-API-Key header. |
| 401 | invalid_api_key | The key is unknown, revoked, or its organisation has been disabled. Keys that do not start with dk_live_ are always invalid. |
{
"error": {
"code": "invalid_api_key",
"message": "this API key is not valid or has been revoked"
}
}The MCP endpoint answers a missing or bad key with HTTP 401, a JSON-RPC error and a WWW-Authenticate: Bearer header. See MCP server.
How do I rotate a key?#
Keys do not expire. Rotate them on a schedule and whenever someone who had access leaves. Keys are managed in the console only; there is no API for creating or revoking keys.
- Create a second key in the console. An organisation can hold up to 20 active keys.
- Deploy the new key to your services and confirm traffic with
GET /v1/me, which returns the key'sidandname. The console shows when each key was last used. - Revoke the old key. Revocation takes effect on the next request: the old key gets
401 invalid_api_key.
Rate limits, quotas and daily record budgets are counted per organisation, across all its keys, so adding keys does not add capacity. Name keys by service or environment (for example booking-api-prod) so usage by key is readable in GET /v1/usage.
Sandbox and paid plans#
New organisations start on the Sandbox plan (id free), which is meant for trying the API. Exposure checks and forecasts are included on every plan. The limits by plan, from GET /v1/plans:
| Plan | Requests a month | Per minute | Watched items | Webhooks | Max page size | Records a day |
|---|---|---|---|---|---|---|
Sandbox (free) | 100 | 10 | 5 | 0 | 50 | 500 |
Starter (starter) | 50,000 | 60 | 2,500 | 3 | 200 | 50,000 |
Pro (pro) | 500,000 | 300 | 50,000 | 20 | 500 | 500,000 |
Enterprise (enterprise) | Unlimited | 1,200 | Unlimited | 100 | 500 | Unlimited |
Upgrades are made in the console and apply to existing keys right away. Rate limits and quotas explains how each limit is counted.
How should I keep keys safe?#
- Server side only. Do not put a key in browser JavaScript, a mobile app or anything you ship to users. Call DisruptAPI from your backend and pass on only what users need. There is no CORS access to
/v1for browsers. - Secrets manager or environment variables. Never commit keys. The examples in these docs read
DISRUPT_KEYfrom the environment. - One key per service and environment, so you can revoke one without touching the others.
- Keep keys out of logs. Redact the
AuthorizationandX-API-Keyheaders in request logging and error trackers. - MCP clients: put the key in an environment variable the client reads, not in a config file you share. See Connect a client.
- If a key leaks, create a replacement and revoke the leaked key in the console. Then check
GET /v1/usagefor traffic you do not recognise.
Last updated 2026-11-18. Questions or a mistake on this page? Contact us.