Can I use API to retrieve a single bluesky post that I specify? #1169
-
Can I use API to retrieve a single bluesky post that I specify? |
Beta Was this translation helpful? Give feedback.
Answered by
myConsciousness
Jan 1, 2024
Replies: 1 comment 1 reply
-
The Bluesky API does not provide an endpoint to get only a specific single post. But instead, we can use an endpoint that gets multiple posts as follows: import 'package:bluesky/bluesky.dart';
Future<void> main() async {
final session = await createSession(
service: 'SERVICE_NAME',
identifier: 'YOUR_HANDLE_OR_EMAIL',
password: 'YOUR_PASSWORD',
);
final bsky = Bluesky.fromSession(session.data);
// Just get only a specific single post
final posts = await bsky.feed.getPosts(uris: [
AtUri('at://did:plc:iijrtk7ocored6zuziwmqq3c/app.bsky.feed.post/3khvrjf2c7v25'),
]);
print(posts.data.posts.first); // And access like this
} |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
e1blue
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@e1blue
The Bluesky API does not provide an endpoint to get only a specific single post. But instead, we can use an endpoint that gets multiple posts as follows: