POST /v1/watches · free

Watch a page

Tell us a page and your URL. Each time the page is edited, moved or removed, we send a signed POST to your URL. No polling.

Request

curl https://wikivectors.com/v1/watches \
  -H "Authorization: Bearer $WIKIVECTORS_KEY" \
  -H "Content-Type: application/json" \
  -d '{"page": "Ada Lovelace", "callback_url": "https://example.com/hook"}'

Reply (201)

{
  "watch": {
    "id": 42,
    "page_id": 974,
    "title": "Ada Lovelace",
    "url": "https://en.wikipedia.org/wiki/Ada_Lovelace",
    "callback_url": "https://example.com/hook",
    "secret": "whsec_…",
    "status": "active",
    "created_at": "2026-11-26T01:00:00Z"
  },
  "request_id": "req_…"
}

What you send

FieldWhat it is
pageA page title, or an en.wikipedia.org link. Required.
callback_urlYour public https URL. Required.

Up to 100 watches per key. GET /v1/watches lists yours. DELETE /v1/watches/{id} stops one.

What we send you

POST https://example.com/hook
X-WikiVectors-Signature: t=1764118800,v1=5f2b…

{
  "type": "page.changed",
  "watch_id": 42,
  "page": { "page_id": 974, "title": "Ada Lovelace", "url": "https://…" },
  "change": { "change_id": 25001, "kind": "edited", "old_revision_id": 1381003492,
              "new_revision_id": 1387600000, "changed_at": "…", "recorded_at": "…",
              "diff_url": "https://en.wikipedia.org/w/index.php?diff=…" }
}

Reply with any 2xx within 10 seconds. If you don't, we retry for 24 hours. After that the watch shows status: failing.

Check it's really us

v1 is an HMAC-SHA256 of <t>.<raw body>, keyed with your watch's secret, in hex. Use the raw body bytes, before any JSON parsing.

import hashlib, hmac, time

def verify(secret, header, raw_body):
    parts = dict(p.split("=", 1) for p in header.split(","))
    msg = parts["t"].encode() + b"." + raw_body
    want = hmac.new(secret.encode(), msg, hashlib.sha256).hexdigest()
    fresh = abs(time.time() - int(parts["t"])) < 300
    return fresh and hmac.compare_digest(want, parts["v1"])

If it fails

CodeWhy
invalid_callback_urlNot a public https URL
page_not_foundNo page has that name
watch_existsYou already watch that page with that URL
too_many_watches100 per key. Delete one first.
watch_not_foundNo watch with that id on your key