appBskyFeedSearchPosts function

Future<XRPCResponse<FeedSearchPostsOutput>> appBskyFeedSearchPosts({
  1. required String q,
  2. FeedSearchPostsSort? sort,
  3. String? since,
  4. String? until,
  5. String? mentions,
  6. String? author,
  7. String? lang,
  8. String? domain,
  9. String? url,
  10. List<String>? tag,
  11. int? limit,
  12. String? cursor,
  13. required ServiceContext $ctx,
  14. Map<String, String>? $headers,
  15. Map<String, String>? $unknown,
})

Find posts matching search criteria, returning views of those posts. Note that this API endpoint may require authentication (eg, not public) for some service providers and implementations.

Implementation

Future<XRPCResponse<FeedSearchPostsOutput>> appBskyFeedSearchPosts({
  required String q,
  FeedSearchPostsSort? sort,
  String? since,
  String? until,
  String? mentions,
  String? author,
  String? lang,
  String? domain,
  String? url,
  List<String>? tag,
  int? limit,
  String? cursor,
  required ServiceContext $ctx,
  Map<String, String>? $headers,
  Map<String, String>? $unknown,
}) async => await $ctx.get(
  ns.appBskyFeedSearchPosts,
  headers: $headers,
  parameters: {
    ...?$unknown,
    'q': q,
    if (sort != null) 'sort': sort.toJson(),
    if (since != null) 'since': since,
    if (until != null) 'until': until,
    if (mentions != null) 'mentions': mentions,
    if (author != null) 'author': author,
    if (lang != null) 'lang': lang,
    if (domain != null) 'domain': domain,
    if (url != null) 'url': url,
    if (tag != null) 'tag': tag,
    if (limit != null) 'limit': limit,
    if (cursor != null) 'cursor': cursor,
  },
  to: const FeedSearchPostsOutputConverter().fromJson,
);