Currently, the api.php?action=query&meta=notifications outputs some structured data, but not enough for frontend code to be able to render the notifications. You have to pass in notformat=flyout and that gets you pre-rendered HTML with an icon baked in.
To render notifications, we'd at least need: (please update this list as needed)
- Body text
- Primary link hrefs
- Secondary actions
- Whether they are "explicit" (rendered outside of the more menu when the notif is rendered non-compressed) or "implicit" (rendered inside of the more menu)