Integrations / SerpApi
SerpApi
Search engine results as JSON: Google web search, archived searches, locations and account usage.
4 actions
API key
4 read0 write
Calls serpapi.com
Connect
const conn = await setu.connections.initiate({ userId: "user_1", toolkit: "serpapi" });
console.log(conn.connectUrl); // show this to your user
await conn.waitUntilActive();Permissions requested
This toolkit uses a single credential and requests no scopes.
Actions
Get account usagereadserpapi.get_accountGet the SerpApi plan, searches used this month and searches left. Free and not counted against the quota.
No input.
await setu.execute({
userId: "user_1",
action: "serpapi.get_account",
input: {},
});Get archived searchreadserpapi.get_archived_searchFetch a previous search's JSON result by its search id (search_metadata.id), available for 31 days. Free.
| Input | Type | Description | |
|---|---|---|---|
search_id | string | Required | Search id from search_metadata.id |
await setu.execute({
userId: "user_1",
action: "serpapi.get_archived_search",
input: {
"search_id": "<search_id>"
},
});Google searchreadserpapi.google_searchRun a Google web search and return the structured results (organic results, knowledge graph, related questions). Uses one search credit.
| Input | Type | Description | |
|---|---|---|---|
q | string | Required | Search query; supports operators like site: |
location | string | Optional | Where the search originates, e.g. Austin, Texas, United States |
gl | string | Optional | Two-letter country code, e.g. us |
hl | string | Optional | Interface language code, e.g. en |
num | integer | Optional | Results per page |
start | integer | Optional | Result offset for paging |
await setu.execute({
userId: "user_1",
action: "serpapi.google_search",
input: {
"q": "<q>"
},
});Search locationsreadserpapi.search_locationsLook up supported Google locations by name, to use as the location of a search.
| Input | Type | Description | |
|---|---|---|---|
q | string | Optional | Location name fragment, e.g. Austin |
limit | integer | Optional | Maximum results (up to 10) |
await setu.execute({
userId: "user_1",
action: "serpapi.search_locations",
input: {},
});