MbinOrg / mbin

Mbin: a federated content aggregator, voting, discussion and microblogging platform (By the community, for the community)
https://joinmbin.org
GNU Affero General Public License v3.0
235 stars 17 forks source link

API endpoint for federated instances #447

Closed ornato-t closed 2 months ago

ornato-t commented 9 months ago

Is your feature request related to a problem? Please describe. I am the author of a tool that maps federation (and defederation) activity throughout the Fediverse and am working on adding Mbin compatibility to it. I was able to gather a list of defederated instances thanks to the GET /api/defederated endpoint, but unfortunately lack something equally effective for federated instances.

Describe the solution you'd like Similarly to the existing endpoint for defeds, I would like a GET /api/federated (or GET /api/peers, the Mastodon way) endpoint returning an array of the domains of federated instances. If possible these could also include extra information, such as monthly active users or software of the instance, like Lemmy does, but it wouldn't be strictly required.

Describe alternatives you've considered @BentiGorlich on Matrix suggested scraping the already existing /federation page and parsing the resulting HTML, but that would take bit too long for mine and likely other applications, especially because of how long that list tends to get.

rimu commented 9 months ago

FYI lemmy provides /api/v3/federated e.g. https://lemmy.world/api/v3/federated_instances

If Mbin offers the same json structure at the same url it could be more compatible with other software in future.

BentiGorlich commented 2 months ago

This will be solved with #939