appBskyFeedSearchPostsV2 top-level constant

Map<String, dynamic> const appBskyFeedSearchPostsV2

app.bsky.feed.searchPostsV2

Implementation

const appBskyFeedSearchPostsV2 = <String, dynamic>{
  "lexicon": 1,
  "id": "app.bsky.feed.searchPostsV2",
  "defs": {
    "main": {
      "type": "query",
      "description":
          "Find posts matching a search query or filters, returning search hits for matching post records.",
      "parameters": {
        "type": "params",
        "required": [],
        "properties": {
          "cursor": {
            "type": "string",
            "description": "Optional pagination cursor.",
          },
          "limit": {
            "type": "integer",
            "description": "Maximum number of results to return.",
            "default": 25,
            "minimum": 1,
            "maximum": 100,
          },
          "query": {
            "type": "string",
            "description":
                "Search query string. A query or at least one filter is required.",
          },
          "sort": {
            "type": "string",
            "description":
                "Ranking order for results. 'recent' sorts by recency; 'top' uses search ranking.",
            "knownValues": ["recent", "top"],
          },
          "authors": {
            "type": "array",
            "description":
                "Include posts by any of these authors. Handles are resolved to DIDs before searching.",
            "items": {"type": "string", "format": "at-identifier"},
          },
          "mentions": {
            "type": "array",
            "description":
                "Include posts that mention any of these accounts. Handles are resolved to DIDs before searching.",
            "items": {"type": "string", "format": "at-identifier"},
          },
          "domains": {
            "type": "array",
            "description": "Include posts that link to any of these domains.",
            "items": {"type": "string"},
          },
          "urls": {
            "type": "array",
            "description": "Include posts that link to any of these URLs.",
            "items": {"type": "string", "format": "uri"},
          },
          "embeddedAtUris": {
            "type": "array",
            "description": "Include posts that embed any of these AT URIs.",
            "items": {"type": "string", "format": "at-uri"},
          },
          "hashtags": {
            "type": "array",
            "description":
                "Include posts tagged with any of these hashtags. Do not include the hash (#) prefix.",
            "items": {"type": "string", "maxLength": 640, "maxGraphemes": 64},
          },
          "excludeAuthors": {
            "type": "array",
            "description":
                "Exclude posts by any of these authors. Handles are resolved to DIDs before searching.",
            "items": {"type": "string", "format": "at-identifier"},
          },
          "excludeMentions": {
            "type": "array",
            "description":
                "Exclude posts that mention any of these accounts. Handles are resolved to DIDs before searching.",
            "items": {"type": "string", "format": "at-identifier"},
          },
          "excludeDomains": {
            "type": "array",
            "description": "Exclude posts that link to any of these domains.",
            "items": {"type": "string"},
          },
          "excludeUrls": {
            "type": "array",
            "description": "Exclude posts that link to any of these URLs.",
            "items": {"type": "string", "format": "uri"},
          },
          "excludeEmbeddedAtUris": {
            "type": "array",
            "description": "Exclude posts that embed any of these AT URIs.",
            "items": {"type": "string", "format": "at-uri"},
          },
          "excludeHashtags": {
            "type": "array",
            "description":
                "Exclude posts tagged with any of these hashtags. Do not include the hash (#) prefix.",
            "items": {"type": "string", "maxLength": 640, "maxGraphemes": 64},
          },
          "since": {
            "type": "string",
            "description":
                "Include posts indexed at or after this timestamp. Can be a datetime, or just an ISO date (YYYY-MM-DD).",
          },
          "until": {
            "type": "string",
            "description":
                "Include posts indexed before this timestamp. Defaults to the current time. Can be a datetime, or just an ISO date (YYYY-MM-DD).",
          },
          "allTime": {
            "type": "boolean",
            "description":
                "Search the full index instead of the recent-post window.",
          },
          "languages": {
            "type": "array",
            "description":
                "Include posts whose language matches any of these language codes.",
            "items": {"type": "string", "format": "language"},
          },
          "excludeLanguages": {
            "type": "array",
            "description":
                "Exclude posts whose language matches any of these language codes.",
            "items": {"type": "string", "format": "language"},
          },
          "hasMedia": {
            "type": "boolean",
            "description": "Include only posts with media.",
          },
          "hasVideo": {
            "type": "boolean",
            "description": "Include only posts with video.",
          },
          "replyParentUri": {
            "type": "string",
            "format": "at-uri",
            "description":
                "Include only direct replies to this parent post URI.",
          },
          "threadRootUri": {
            "type": "string",
            "format": "at-uri",
            "description":
                "Include only posts in the thread rooted at this post URI.",
          },
          "excludeReplies": {
            "type": "boolean",
            "description":
                "Exclude replies from results. Mutually exclusive with repliesOnly.",
          },
          "repliesOnly": {
            "type": "boolean",
            "description":
                "Include only replies. Mutually exclusive with excludeReplies.",
          },
          "following": {
            "type": "boolean",
            "description":
                "Include only posts from accounts followed by the viewer.",
          },
          "queryLanguage": {
            "type": "string",
            "description":
                "Language analyzer hint for the query text. If unset, the server auto-detects when possible.",
            "knownValues": ["ja", "zh", "ko", "th", "ar"],
          },
        },
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "type": "object",
          "required": ["posts"],
          "properties": {
            "cursor": {
              "type": "string",
              "description": "Cursor for the next page of results.",
            },
            "hitsTotal": {
              "type": "integer",
              "description":
                  "Estimated total number of matching hits. May be rounded or truncated.",
            },
            "posts": {
              "type": "array",
              "description": "Hydrated views of matching posts.",
              "items": {"type": "ref", "ref": "app.bsky.feed.defs#postView"},
            },
            "detectedQueryLanguages": {
              "type": "array",
              "description":
                  "Query languages detected for CJK, Thai, or Arabic text. Empty or omitted for other scripts.",
              "items": {
                "type": "string",
                "knownValues": ["ja", "zh", "ko", "th", "ar"],
              },
            },
          },
        },
      },
      "errors": [
        {"name": "BadQueryString"},
      ],
    },
  },
};