Node Details

  • Name: searchApi
  • Type: Document
  • Category: Document Loaders
  • Version: 1.0

Credentials

This node requires a SearchApi credential to authenticate with the service.

  • Credential Name: searchApi
  • Required: Yes

Input Parameters

  1. Query (optional)

    • Type: string
    • Description: The search query to be used for fetching results.
  2. Custom Parameters (optional)

    • Type: JSON
    • Description: Additional parameters to customize the search request. Refer to the SearchApi documentation for available parameters and engines.
  3. Text Splitter (optional)

    • Type: TextSplitter
    • Description: A text splitter to process the retrieved documents.
  4. Additional Metadata (optional)

    • Type: JSON
    • Description: Additional metadata to be added to the extracted documents.
  5. Omit Metadata Keys (optional)

    • Type: string
    • Description: A comma-separated list of metadata keys to be omitted from the final documents. Use ’*’ to omit all metadata keys except those specified in the Additional Metadata field.

Output

The node outputs an array of IDocument objects, each representing a search result with the following properties:

  • pageContent: The main content of the search result.
  • metadata: An object containing metadata about the search result, which can be customized or filtered based on the input parameters.

Functionality

  1. The node initializes a SearchApiLoader with the provided API key and custom parameters.
  2. It fetches search results based on the given query and parameters.
  3. If a text splitter is provided, the retrieved documents are split accordingly.
  4. Additional metadata is added to the documents if specified.
  5. Metadata keys are filtered based on the “Omit Metadata Keys” input.
  6. The processed documents are returned as the output.

Use Cases

  • Retrieving up-to-date information from the web for research or analysis.
  • Gathering data from multiple search engines for comparison or aggregation.
  • Integrating real-time web search capabilities into AI-powered applications or chatbots.
  • Automating web research tasks by programmatically querying and processing search results.

Notes

  • The SearchApi service provides access to multiple search engines. Refer to their documentation for specific parameters and available engines.
  • Be mindful of rate limits and usage quotas associated with your SearchApi account.
  • Proper error handling and input validation should be implemented when using this node in production environments.