Rather than a kbin/lemmy instance, I'm thinking of a separate codebase altogether.
As I understand, both kbin and lemmy implement the activitypub protocol, similar to how gmail/outlook implement SMTP.
So having an activitypub-compliant app would be sufficient to read the data from kbin/lemmy/etc.
This would be a side project for myself to learn a new language, e.g. golang backend.
Thanks for the link, it answers a bunch of my questions