Client.get_followers() & Client.get_follows() don't return number of followers/follows reported by profile #660
Unanswered
RedactedCode
asked this question in
Questions
Replies: 1 comment
|
Hi, that's definitely not SDK side problem. Maybe some kind filtering/applying of blocked lists, etc etc. You always can dig into the backend server code to find out https://github.com/bluesky-social/atproto If you need just a count for follows I would suggest to use aggregate view under Something like this: from atproto import Client
client = Client()
client.login('your-handle.bsky.social', 'your-password')
profile = client.app.bsky.actor.get_profile(
params={"actor": "your-handle.bsky.social"}
)
print(f"Posts count: {profile.posts_count}")
print(f"Followers count: {profile.followers_count}")
print(f"Follows count: {profile.follows_count}")Also, keep in mind that Something like this: from atproto import Client
client = Client()
client.login('your-handle.bsky.social', 'your-password')
def count_records(repo: str, collection: str) -> int:
count = 0
cursor = None
while True:
response = client.com.atproto.repo.list_records(
params={
"repo": repo,
"collection": collection,
"limit": 100, # max per page
"cursor": cursor,
}
)
count += len(response.records)
if not response.cursor:
break
cursor = response.cursor
return count
total = count_records("your-handle.bsky.social", "app.bsky.graph.follow")
print(f"Total records: {total}")The example above uses |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This is probably not this SDK's problem, but worth flagging and asking the question I hope.
Trying a simple bit of code like:
... the number of follower objects returned is almost always fewer than the 100 limit passed (if, of course, the subject has >= 100 followers)
Making this into a loop to get all followers, I've never seen the total number returned the same as the total number given by a profile enquiry, whether via the API or by simply looking at the subject's account in the Bluesky web or app client.
This issue also occurs with get_follows() btw.
I'm presuming that either Bluesky are suppressing some accounts from being returned (maybe part of their bot or other inauthentic activity moderation), or that there's a problem with how they are reporting follower (and follow) counts.
All reactions