gsr
    Preparing search index...

    Function search

    • Performs a Google search and returns parsed results from a single page.

      This is the main search function for single-page searches. It accepts various parsers to extract different types of results (organic results, news, translations, etc.).

      Type Parameters

      Parameters

      Returns Promise<SearchResultTypeFromParser<R, N>[]>

      Promise that resolves to an array of parsed search results

      import { search, OrganicResult } from 'google-sr';

      const results = await search({
      query: 'nodejs tutorial',
      // Configure the parsers you want
      parsers: [OrganicResult],
      noPartialResults: true
      });

      When searchOptions is not provided or is invalid