Document loaders
SerpAPI Web Search
The SerpAPI_DocumentLoaders node is a document loader that uses the SerpAPI service to perform web searches and load the results as documents. It’s designed to integrate web search capabilities into document processing pipelines.
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
-
Query (required)
- Type: string
- Description: The search query to be sent to SerpAPI
-
Text Splitter (optional)
- Type: TextSplitter
- Description: A text splitter to break down large documents into smaller chunks
-
Additional Metadata (optional)
- Type: JSON
- Description: Additional metadata to be added to the extracted documents
-
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
- Initializes the SerpAPILoader with the provided query and API key
- Loads documents using the SerpAPILoader
- If a text splitter is provided, splits the documents
- Applies additional metadata if specified
- Filters metadata based on the “Omit Metadata Keys” input
- 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
Was this page helpful?