← Back to APIAPI Reference
All endpoints are REST, return JSON, and require an API key. Base URL: https://pegcheck.uk
Authentication
Pass your API key as a Bearer token in the Authorization header on every request.
// Every request needs this header
Authorization: Bearer YOUR_API_KEY
Missing or invalid keys return 401 Unauthorized.
Supported stablecoins
Use these slugs in any endpoint that accepts a [slug] parameter.
usdt
usdc
usds
ethena
pyusd
fdusd
rlusd
tusd
frax
gho
crvusd
lusd
usdp
usdd
mkusd
eurc
dola
alusd
bold
GET/api/v1/coins
List all coins
Returns the latest price, deviation, and depeg status for all 8 stablecoins.
Request
fetch
("https://pegcheck.uk/api/v1/coins", {
headers: {
Authorization: "Bearer YOUR_API_KEY"
}
})
Response
{
"coins": [
{
"slug": "usdt",
"price": 0.9998,
"deviation": -0.02,
"status": "stable",
"updated_at": "2024-01-15T10:30:00Z"
},
{
"slug": "usdc",
"price": 1.0001,
"deviation": 0.01,
"status": "stable",
"updated_at": "2024-01-15T10:30:00Z"
}
],
"total": 8
}
GET/api/v1/coins/[slug]
Get single coin
Returns the latest price and status for one stablecoin.
Request
fetch
("https://pegcheck.uk/api/v1/coins/usdc", {
headers: {
Authorization: "Bearer YOUR_API_KEY"
}
})
Response
{
"slug": "usdc",
"price": 1.0001,
"deviation": 0.01,
"status": "stable",
"updated_at": "2024-01-15T10:30:00Z"
}
Response fields
pricenumberCurrent USD price
deviationnumberPercentage deviation from $1.00 (negative = below peg)
statusstring"stable" | "warning" (≥1%) | "depegged" (≥3%)
GET/api/v1/coins/[slug]/history
Price history
Returns up to 100 price snapshots for a coin. Filter by date range with optional query parameters.
Query parameters
fromoptionalISO 8601 start date — e.g. 2024-01-01T00:00:00Z
tooptionalISO 8601 end date
intervaloptionalLabel for the range (default: "24h") — informational only, does not affect filtering
Request
fetch
("https://pegcheck.uk/api/v1/coins/usdt/history
?from=2024-01-01T00:00:00Z&to=2024-01-02T00:00:00Z
", {
headers: {
Authorization: "Bearer YOUR_API_KEY"
}
})
Response
{
"slug": "usdt",
"interval": "24h",
"history": [
{
"timestamp": "2024-01-15T10:30:00Z",
"price": 0.9998,
"deviation": -0.02,
"status": "stable"
},
{
"timestamp": "2024-01-15T09:30:00Z",
"price": 0.9701,
"deviation": -2.99,
"status": "warning"
}
],
"depeg_events": [],
"total": 2
}
GET/api/v1/alerts/status
Active alerts
Returns all coins currently off-peg by 1% or more. Empty array means everything is stable.
Request
fetch
("https://pegcheck.uk/api/v1/alerts/status", {
headers: {
Authorization: "Bearer YOUR_API_KEY"
}
})
Response
{
"alerts": [
{
"coin": "USDT",
"price": 0.9650,
"deviation": -3.5,
"severity": "depegged",
"triggered_at": "2024-01-15T10:30:00Z"
}
],
"all_stable": false
}
Response fields
severitystring"warning" (≥1%) | "depegged" (≥3%)
all_stablebooleanTrue when alerts array is empty — safe to use as a health check
POST/api/v1/webhooks
Register a webhook
Subscribe your endpoint to depeg, caution, and/or recovery events. PegCheck will POST a JSON payload to your URL on each trigger.
Request body
urlstringrequiredHTTPS URL to receive POST payloads
eventsstring[]optionalEvents to subscribe to — default: ["depeg","caution","recovery"]
Request
fetch
("https://pegcheck.uk/api/v1/webhooks", {
method: "POST",
headers: {
Authorization: "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({
url: "https://your-app.com/webhook",
events: ["depeg", "recovery"]
})
})
Response
{
"webhook": {
"id": 42,
"url": "https://your-app.com/webhook",
"events": ["depeg", "recovery"],
"active": true,
"fail_count": 0,
"last_fired": null,
"created_at": "2026-01-15T10:30:00Z"
}
}
GET/api/v1/webhooks
List webhooks
Returns all webhooks registered under your API key.
Request
fetch
("https://pegcheck.uk/api/v1/webhooks", {
headers: {
Authorization: "Bearer YOUR_API_KEY"
}
})
Response
{
"webhooks": [
{
"id": 42,
"url": "https://your-app.com/webhook",
"events": ["depeg", "recovery"],
"active": true,
"fail_count": 0,
"last_fired": "2026-01-15T10:30:00Z",
"created_at": "2026-01-10T08:00:00Z"
}
]
}
Response fields
activebooleanFalse after 3 consecutive delivery failures — re-register to resume
fail_countnumberConsecutive failed deliveries; resets to 0 on success
last_firedstringISO 8601 timestamp of the last successful delivery
DELETE/api/v1/webhooks?id=X
Delete a webhook
Permanently removes a webhook. Only webhooks belonging to your API key can be deleted.
Query parameters
idrequiredThe numeric webhook ID returned when it was registered
Request
fetch
("https://pegcheck.uk/api/v1/webhooks?id=42", {
method: "DELETE",
headers: {
Authorization: "Bearer YOUR_API_KEY"
}
})
Response
{
"message": "Webhook deleted"
}
Webhook payload
PegCheck sends a POST request with this JSON body. Respond with any 2xx status to acknowledge. After 3 failed deliveries the webhook is automatically deactivated.
{
"event": "depeg",
"coin": "usdc",
"price": 0.9610,
"peg": 1.0,
"deviation_pct": -3.9,
"triggered_at": "2026-01-15T10:30:00Z"
}
eventstring"depeg" (≥2.5% off peg) | "caution" (1–2.5%) | "recovery" (returned to within 2.5%)
coinstringStablecoin slug — e.g. usdc, usdt
pricenumberMedian price at time of trigger
pegnumberTarget peg value (1.0 for USD-pegged; EUR/USD rate for EURC)
deviation_pctnumberPercentage deviation from peg; negative = below peg
triggered_atstringISO 8601 UTC timestamp
Error codes
401UnauthorizedMissing or invalid API key
400Bad RequestMissing required field or invalid parameter
404Not FoundSlug not recognised or no data available
500Server ErrorSomething went wrong on our end — try again