IGPAPI
    Preparing search index...

    Function SearchSerp

    • The user search flow: typeahead while typing, then the account_serp user results on submit. Emits the captured navigation — SwitchTab(Explore, main_search) → NavigateTo(SearchTypeahead, button) → NavigateTo(SerpTop, search_result) — so the rendered x-ig-nav-chain and the nav_chain query param name the search screens.

      The search session is threaded across both legs: search_session_id is shared; the typeahead leg fills typeahead_session_id / client_uuid_rank_token when the session has none, the SERP leg fills serp_session_id.

      Parameters

      Returns Effect<
          {
              rankToken: string;
              results: readonly (
                  | {
                      __typename: "XDTTypeaheadSearchKeyword";
                      keyword_lazified: {
                          id: string;
                          name: string;
                          user?: | {
                              full_name?: string;
                              id: string;
                              is_private?: boolean;
                              is_verified?: boolean;
                              latest_reel_media?: number;
                              profile_pic_url?: string;
                              search_serp_type?: number
                              | null;
                              username: string;
                          }
                          | null;
                      };
                  }
                  | {
                      __typename: "XDTTypeaheadSearchUser";
                      rank_token?: string;
                      user: {
                          full_name?: string;
                          id: string;
                          is_private?: boolean;
                          is_verified?: boolean;
                          latest_reel_media?: number;
                          profile_pic_url?: string;
                          search_serp_type?: number
                          | null;
                          username: string;
                      };
                  }
                  | {
                      __typename: "XDTTypeaheadSearchHashtag";
                      hashtag: { id: string; media_count?: number; name: string };
                  }
              )[];
              session: SerpReadySession;
              users: AccountSerpUser[];
          },
          | IgApiError
          | RequestError
          | ParseError
          | TransportError
          | SchemaError
          | GraphqlRootFieldMissingError,
          | PlainJsonApiHttp
          | MobileSession
          | MobileDevice
          | GraphqlJsonHttp
          | MobileApplication,
      >