How to read AMB resources (Nostr kind 30142, specified by NIP-AMB) from the Educational Data Pool at amb-relay.edufeed.org and render them in different designs. The write side — publishing, querying, updating — is covered in the Educational Data Pool integration guide; both pages describe the same events.
NIP-AMB is the Edufeed specification for publishing educational resources on Nostr using the German Allgemeines Metadatenprofil für Bildungsressourcen (AMB) — a schema.org-aligned profile for OER and learning materials. It defines event kind 30142: wherever these guides say "kind 30142" or "NIP-AMB", they mean the same thing — the kind number is the on-the-wire format, NIP-AMB the specification behind it. Each event is an addressable AMB resource carrying both human-readable content and structured metadata as tags; the set of all such events on the Edufeed relays is the Educational Data Pool.
d — stable resource id (often the content URL)name — titledescription — short summarycontent — full body (markdown)about:id + about:prefLabel:de — subjectlearningResourceType:id — material typeeducationalLevel:id — target levelaudience:id — target audiencelicense:id — license URL (often CC)creator:name / creator:idisAccessibleForFreedatePublishedimage — preview/thumbnail URLencoding:contentUrl — primary mediaencoding:encodingFormat — MIME typeinLanguage — language codeOpen a Nostr WebSocket, send a REQ filter for kind 30142, and collect events until EOSE:
const ws = new WebSocket("wss://amb-relay.edufeed.org");
ws.onopen = () => {
ws.send(JSON.stringify([
"REQ", "amb-sub",
{ kinds: [30142], limit: 500 }
]));
};
ws.onmessage = (msg) => {
const [type, sub, payload] = JSON.parse(msg.data);
if (type === "EVENT") render(payload);
if (type === "EOSE") ws.send(JSON.stringify(["CLOSE", sub]));
};
Resources are addressable — to read a specific resource by its d tag, add an #d filter:
{ kinds: [30142], "#d": ["my-resource-id"], limit: 1 }
nak)For mirrors and backups across the federation of AMB relays:
nak req --paginate --paginate-interval 1s -k 30142 \
relay-rpi.edufeed.org \
amb-relay.edufeed.org \
relay-stil-amb.edufeed.org \
> amb-events.jsonl
Standalone — no build step, no external scripts. Save this file and open it in a browser.