Document loaders
SearchAPI Web Search
The SearchAPI for Web Search is a document loader node that allows you to fetch real-time search results from multiple search engines using the SearchApi.io service. This node is particularly useful for retrieving up-to-date information from the web based on specific queries or parameters.
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
-
Query (optional)
- Type: string
- Description: The search query to be used for fetching results.
-
Custom Parameters (optional)
- Type: JSON
- Description: Additional parameters to customize the search request. Refer to the SearchApi documentation for available parameters and engines.
-
Text Splitter (optional)
- Type: TextSplitter
- Description: A text splitter to process the retrieved documents.
-
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 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
- The node initializes a SearchApiLoader with the provided API key and custom parameters.
- It fetches search results based on the given query and parameters.
- If a text splitter is provided, the retrieved documents are split accordingly.
- Additional metadata is added to the documents if specified.
- Metadata keys are filtered based on the “Omit Metadata Keys” input.
- 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.