SearchApi Tool
Search the web in real time using a chosen search engine. This component lets you send a query to a search engine (like Google, Bing, DuckDuckGo, etc.) and get the most recent results directly into your Nappai workflow.
How it Works
When you run the component, it talks to the SearchAPI service. You give it a search engine name, a query, and optional search parameters. The component sends the request to SearchAPI, receives a list of organic results, and turns each result into a Data object that contains the full result and a short snippet. It also creates a Tool that can be used by other parts of your workflow to perform the same search on demand.
Inputs
The component needs three main inputs:
- Engine: The name of the search engine you want to use (e.g.,
google
,bing
,duckduckgo
). - Input: The search query you want to send to the engine.
- Search parameters: Optional key‑value pairs that tweak the search (for example,
num_results
,language
, etc.). This field is advanced and can be left empty for a simple search.
Credential
Before you can use the component, you must create a Search API credential in Nappai’s credential manager. The credential stores your SearchAPI key. After creating it, select that credential in the component’s Credential field.
Outputs
- Data – A list of Data objects, each containing a search result and a short snippet.
- Tool – A reusable tool that can be called by other components to perform the same search.
Usage Example
- Create a Search API credential in the Nappai credentials section and store your API key.
- Drag the SearchApi Tool component onto the canvas.
- Set Engine to
google
. - Set Input to
latest AI news
. - Leave Search parameters empty or add
num_results: 5
. - Connect the Data output to a Text Output component to display the snippets, or use the Tool output in a loop that processes each result.
Related Components
- Google Search Tool – Uses the Google Custom Search API.
- Bing Search Tool – Uses the Bing Web Search API.
- Web Scraper – Pulls data from a specific webpage after a search.
Tips and Best Practices
- Keep your queries short and specific to get the most relevant results.
- Use the
num_results
parameter to limit the number of results and reduce API usage. - Combine the SearchApi Tool with a Filter component to keep only results that match certain keywords.
- Store the API key in a credential and never hard‑code it in your workflow.
Security Considerations
- The Search API key is stored securely in Nappai’s credential store.
- Only users with permission to view credentials can see the key.
- When sharing a workflow, the credential reference is shared, not the key itself.