Observatory /

Your first API call in five minutes

Create a key, call the API and understand access, responses and limits.

curl --fail-with-body -H "Authorization: Bearer YOUR_API_KEY" \
  'https://mothlight.ai/api/v1/stats/overview'
curl --fail-with-body -H "Authorization: Bearer YOUR_API_KEY" \
  'https://mothlight.ai/api/v1/events/recent?limit=10'
import requests

base = "https://mothlight.ai/api/v1"
headers = {"Authorization": "Bearer YOUR_API_KEY"}
for endpoint in ("/stats/overview", "/events/recent?limit=10"):
    response = requests.get(base + endpoint, headers=headers, timeout=30)
    response.raise_for_status()
    print(response.json())
const base = "https://mothlight.ai/api/v1";
for (const endpoint of ["/stats/overview", "/events/recent?limit=10"]) {
  const response = await fetch(base + endpoint, {
    headers: { Authorization: "Bearer YOUR_API_KEY" },
  });
  if (!response.ok) throw new Error(`HTTP ${response.status}`);
  console.log(await response.json());
}