Function searchWeb

  • Search Web via SearXNG metasearch of all major search engines. Options are 10 search categories, recency, and how many times to retry other domains if first time fails. SearXNG is a free internet metasearch engine which aggregates results from more than 180+ search sources.

    Searxng Installation Guide

    Parameters

    • query: string

      The search query string.

    • Optionaloptions: {
          category: number;
          recency: number;
          customSearxngDomain: string | boolean;
          maxRetries: number;
          page: number;
          proxy: string;
      } = {}
      • category: number

        default=0 - ["general", "news", "videos", "images", "science", "map", "music", "it", "files", "social+media"]

      • recency: number

        default=0 - ["", "day", "week", "month", "year"]

      • customSearxngDomain: string | boolean

        default=null - Use your custom domain SearXNG

      • maxRetries: number

        default=3 - Maximum number of retry attempts if the initial search fails.

      • page: number

        default=1 - The page number to retrieve.

      • proxy: string

        default=false - Use corsproxy.io to access in frontend JS

    Returns Promise<{
        title: string;
        url: string;
        snippet: string;
        engines: string[];
    }[]>

    An array of search result objects.

    const advancedResults = await searchWeb('Node.js', {
    category: 2,
    recency: 1,
    maxRetries: 5
    });

    ai-research-agent (2024) Heiser, M., Tauber, A., Flament, A., et al. (2014-)