$ memescore docs webhooks
Webhooks: connect your bot
API docs
Instead of polling, let MemeScore push to your bot. On the account page, paste your bot's https URL and click Connect your bot. You get a signing secret (shown once) and, on plans with API keys, a key for /v1/check if you don't have one yet.
Endpoints per plan: Trader + Bot 1, API 5, Enterprise 20.
Events
| Type | When | data fields |
|---|---|---|
score.high | A new pump.fun graduate is scored (at graduation, then 15, 60 and 180 min after) and its score is at or above your endpoint's minimum (default 70; higher = lower risk). | mint, score, band, model, minutes_after_graduation, scored_at, p_rug_6h, p_collapse_24h, p_double_24h, check |
trader.buy | A wallet we track buys a coin. | wallet, mint, ts, signature, solscan, copy_links |
ping | You press Send test. | message |
Events are batched (up to 50 per POST, checked every ~20 s):
{"id":"evt_3f9c2a","created":1795000000,"events":[
{"type":"score.high","data":{"mint":"<mint>","score":82,"band":"lower","model":"v2","minutes_after_graduation":15,
"scored_at":1795000000,"p_rug_6h":0.04,"p_collapse_24h":0.18,"p_double_24h":0.11,"check":"https://memescore.io/v1/check?mint=<mint>"}},
{"type":"trader.buy","data":{"wallet":"<wallet>","mint":"<mint>","ts":1795000000,"signature":"<tx signature>",
"solscan":"https://solscan.io/tx/<tx signature>","copy_links":{"axiom":"https://axiom.trade/@memescore"}}}]}Headers and signature
Content-Type: application/json X-MemeScore-Timestamp: 1795000000 X-MemeScore-Signature: sha256=<hex HMAC-SHA256(secret, "<timestamp>.<raw body>")> X-MemeScore-Delivery: evt_…
Compute the HMAC over the raw request body (before JSON parsing), compare in constant time, and reject timestamps more than 5 minutes from your clock. Retries reuse the same id, so skip ids you've already handled.
Receivers
Python (Flask)
# pip install flask
import hashlib, hmac, json, os, time
from flask import Flask, abort, request
SECRET = os.environ["MEMESCORE_WEBHOOK_SECRET"].encode()
seen = set() # delivery ids already handled (retries reuse the id)
app = Flask(__name__)
@app.post("/memescore")
def memescore():
ts = request.headers.get("X-MemeScore-Timestamp", "")
sig = request.headers.get("X-MemeScore-Signature", "")
body = request.get_data()
if not ts.isdigit() or abs(time.time() - int(ts)) > 300:
abort(400) # stale or missing timestamp: possible replay
want = "sha256=" + hmac.new(SECRET, ts.encode() + b"." + body, hashlib.sha256).hexdigest()
if not hmac.compare_digest(want, sig):
abort(401)
msg = json.loads(body)
if msg["id"] in seen:
return "", 204
seen.add(msg["id"])
for ev in msg["events"]:
if ev["type"] == "score.high":
print("lower-risk coin", ev["data"]["mint"], ev["data"]["score"])
elif ev["type"] == "trader.buy":
print("tracked wallet bought", ev["data"]["wallet"], ev["data"]["mint"])
return "", 204
app.run(port=3000)Node (Express)
// npm install express
const crypto = require("crypto");
const express = require("express");
const app = express();
const seen = new Set(); // delivery ids already handled (retries reuse the id)
app.post("/memescore", express.raw({ type: "application/json" }), (req, res) => {
const ts = req.get("X-MemeScore-Timestamp") || "";
const sig = req.get("X-MemeScore-Signature") || "";
if (!/^\d+$/.test(ts) || Math.abs(Date.now() / 1000 - Number(ts)) > 300) return res.sendStatus(400);
const want = "sha256=" + crypto.createHmac("sha256", process.env.MEMESCORE_WEBHOOK_SECRET)
.update(ts + ".").update(req.body).digest("hex");
if (want.length !== sig.length || !crypto.timingSafeEqual(Buffer.from(want), Buffer.from(sig))) return res.sendStatus(401);
const msg = JSON.parse(req.body);
if (seen.has(msg.id)) return res.sendStatus(204);
seen.add(msg.id);
for (const ev of msg.events) {
if (ev.type === "score.high") console.log("lower-risk coin", ev.data.mint, ev.data.score);
if (ev.type === "trader.buy") console.log("tracked wallet bought", ev.data.wallet, ev.data.mint);
}
res.sendStatus(204);
});
app.listen(3000);curl: simulate a signed delivery
# Simulate a signed MemeScore delivery to your own endpoint (the account page's Test button sends a real one).
BODY='{"id":"evt_test","created":0,"events":[{"type":"ping","data":{}}]}'
TS=$(date +%s)
SIG=$(printf '%s.%s' "$TS" "$BODY" | openssl dgst -sha256 -hmac "$MEMESCORE_WEBHOOK_SECRET" | sed 's/^.* //')
curl -X POST "https://your-bot.example.com/memescore" \
-H "Content-Type: application/json" -H "X-MemeScore-Timestamp: $TS" \
-H "X-MemeScore-Signature: sha256=$SIG" -d "$BODY"Delivery rules
- Answer with any 2xx within 5 seconds. Redirects aren't followed.
- Failed deliveries retry after 30 s, 2 min, 10 min, 30 min and 2 h, then are dropped.
- After 15 failures in a row the endpoint is turned off; fix it, then press Turn on on the account page.
- URLs must be public
https://addresses. Localhost, private and link-local networks are refused. - Webhooks stop if the plan drops to Free; endpoints are kept and resume on upgrade.
A webhook is a data feed, not a trade signal or advice. Most new memecoins lose money.