Hey nostr:nprofile1qqsyvrp9u6p0mfur9dfdru3d853tx9mdjuhkphxuxgfwmryja7zsvhqpzamhxue69uhhv6t5daezumn0wd68yvfwvdhk6tcpz9mhxue69uhkummnw3ezuamfdejj7qgwwaehxw309ahx7uewd3hkctcscpyug

How can I fetch the list of followers of a user in descending order of their followers count?

#AskNostr

Reply to this note

Please Login to reply.

Discussion

You need to build your own index, nostr isn't built for this, for this to work you would need to fetch all contact list (kind 3 events) an npub is mentioned in, then for each npub in those lists you'd need to fetch contact list events they are mentioned in.

Contact list events can be huge,like mb sizes huge, they might follow 1000s of npubs, so good luck,

Best way to do it would be to build your own index where you run this query once per user and then query your own index, managing updates would be another hassle though.

any good open source reference implementations?

Primal does it and is open source I think

Primal does this automatically