I’m working on a Python script to find a snappy Lemmy instance, as the one I was using (not dbzer0) has recently slowed down to about 5 seconds per page load. I have a rough version of the script, but I need to fetch a list of available Lemmy instances through their API.
Could anyone guide me on how to access the Lemmy API to retrieve a list of instances?
https://piefed.social/auth/instance_chooser sorts the list of instances by performance.
https://fediverse.observer/ has an api
Not what you’re asking, but I can probably do better.
I’d give decent odds that the issue you’re hitting is the thing that many Fediverse instances are hitting. There have been a lot of badly-written and very aggressive scraper-bots hammering servers all over (the Web, not just the Threadiverse) to try to find text to train AI models. If you’ve seen discussion on Anubis recently, that was aimed at trying to mitigate the load from that.
Many instances dealt with this by disallowing anonymous access. This sucks, because it’d be nice to let people use an instance without logging in, but it did apparently drastically reduce the bot load.
You can probably just pick an instance that doesn’t provide for anonymous access.
This may be what you’re looking for, tools such as this are watching the (meta)data flows: https://data.lemmyverse.net/