Serp API tool for flows in Azure AI Studio
Important
Items marked (preview) in this article are currently in public preview. This preview is provided without a service-level agreement, and we don't recommend it for production workloads. Certain features might not be supported or might have constrained capabilities. For more information, see Supplemental Terms of Use for Microsoft Azure Previews.
The prompt flow Serp API tool provides a wrapper to the Serp API Google Search Engine Results API and Serp API Bing Search Engine Results API.
You can use the tool to retrieve search results from many different search engines, including Google and Bing. You can specify a range of search parameters, such as the search query, location, and device type.
Prerequisites
Sign up on the Serp API home page.
To create a Serp connection:
Sign in to Azure AI Studio.
Go to Project settings > Connections.
Select + New connection.
Add the following custom keys to the connection:
azureml.flow.connection_type
:Custom
azureml.flow.module
:promptflow.connections
api_key
: Your Serp API key. You must select the is secret checkbox to keep the API key secure.
The connection is the model used to establish connections with the Serp API. Get your API key from the Serp API account dashboard.
Type | Name | API key |
---|---|---|
Serp | Required | Required |
Build with the Serp API tool
Create or open a flow in Azure AI Studio. For more information, see Create a flow.
Select + More tools > Serp API to add the Serp API tool to your flow.
Select the connection to one of your provisioned resources. For example, select SerpConnection if you created a connection with that name. For more information, see Prerequisites.
Enter values for the Serp API tool input parameters described in the Inputs table.
Add more tools to your flow, as needed. Or select Run to run the flow.
The outputs are described in the Outputs table.
Inputs
The following input parameters are available.
Name | Type | Description | Required |
---|---|---|---|
query | string | The search query to be executed. | Yes |
engine | string | The search engine to use for the search. Default is google . |
Yes |
num | integer | The number of search results to return. Default is 10. | No |
location | string | The geographic location from which to execute the search. | No |
safe | string | The safe search mode to use for the search. Default is off. | No |
Outputs
The JSON representation from a serpapi
query:
Engine | Return type | Output |
---|---|---|
json | Sample | |
Bing | json | Sample |