Node Details

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

Credentials

  • Type: serpApi
  • Fields:
    • serpApiKey: API key for accessing the SerpAPI service

Input Parameters

  1. Query (required)

    • Type: string
    • Description: The search query to be sent to SerpAPI
  2. Text Splitter (optional)

    • Type: TextSplitter
    • Description: A text splitter to break down large documents into smaller chunks
  3. Additional Metadata (optional)

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

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

Output

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

  • pageContent: The main content of the search result
  • metadata: Associated metadata, which can be customized or filtered based on input parameters

Functionality

  1. Initializes the SerpAPILoader with the provided query and API key
  2. Loads documents using the SerpAPILoader
  3. If a text splitter is provided, splits the documents
  4. Applies additional metadata if specified
  5. Filters metadata based on the “Omit Metadata Keys” input
  6. Returns the processed documents

Use Cases

  • Web research automation
  • Content aggregation from search results
  • Data collection for analysis or training language models
  • Integrating up-to-date web information into document processing workflows

Notes

  • Requires a valid SerpAPI credential to function
  • Can be combined with other document processing nodes for more complex workflows
  • Useful for dynamically generating document collections based on search queries