|
Hello, I'm just getting started with the ATProtocol (thanks so much MarshalX for what you're doing for developers and the community btw), I'm trying to retrieve data from the public Bluesky API but having some trouble retrieving the like count for a post. It took me a bit to figure out the base URL when you make a client isn't the public endpoint, but now when I ping it for the likes of a post it returns an empty list for the likes? Example of my script: Which prints something like: likes=[] uri='at://did:plc:wgatllsz7dfjnxlafoaqvalf/app.bsky.feed.post/3linbk7enpc2f' cid='bafyreie4m4vgh4ej3auwmhc7t7y5nmomuwra3f2vya3kl2baebqp3drala' cursor=None I've tried finding a post that I can confirm on Bluesky does indeed have likes and querying for that post, so I don't believe the post having no likes to be the issue. |
Replies: 1 comment 1 reply
|
Hello! My pleasure! import .....
client = .....
post = client.get_posts(['at://did:plc:kvwvcn5iqfooopmyzvb4qzba/app.bsky.feed.post/3k2yihcrp6f2c']).posts[0]
print('likes:', post.like_count)so the diff between this is aggregated post (AKA post view) which you will get via |
Hello! My pleasure!
so the diff between
get_postandget_postsis that the first one uses atproto method, which will return raw PDS record; and the second one uses bsky api which is populated by some aggregated data like total likes count. also, the nice to know, is that you can fetch many posts in only 1 request and get count of likes for all of themthis is aggregated post (AKA post view) which you will get via
get_posts: https://atproto.blue/en/latest/atproto/atproto_client.models.app.bsky.feed.defs.html#atproto_clien…