Skip to main content

Interface: GoogleParameters

agents/tools.internal.GoogleParameters

This does not use the serpapi package because it appears to cause issues when used in jest tests. Part of the issue seems to be that the serpapi package imports a wasm module to use instead of native fetch, which we don't want anyway.

Hierarchy

Properties

as_dt

Optional as_dt: string

as_dt Parameter controls whether to include or exclude results from the site named in the as_sitesearch parameter.

Defined in

langchain/src/agents/tools/serpapi.ts:132


as_epq

Optional as_epq: string

as_epq Parameter identifies a phrase that all documents in the search results must contain. You can also use the phrase search query term to search for a phrase.

Defined in

langchain/src/agents/tools/serpapi.ts:140


as_eq

Optional as_eq: string

as_eq Parameter identifies a word or phrase that should not appear in any documents in the search results. You can also use the exclude query term to ensure that a particular word or phrase will not appear in the documents in a set of search results.

Defined in

langchain/src/agents/tools/serpapi.ts:149


as_lq

Optional as_lq: string

as_lq Parameter specifies that all search results should contain a link to a particular URL. You can also use the link: query term for this type of query.

Defined in

langchain/src/agents/tools/serpapi.ts:157


as_nhi

Optional as_nhi: string

as_nhi Parameter specifies the ending value for a search range. Use as_nlo and as_nhi to append an inclusive search range.

Defined in

langchain/src/agents/tools/serpapi.ts:169


as_nlo

Optional as_nlo: string

as_nlo Parameter specifies the starting value for a search range. Use as_nlo and as_nhi to append an inclusive search range.

Defined in

langchain/src/agents/tools/serpapi.ts:163


as_oq

Optional as_oq: string

as_oq Parameter provides additional search terms to check for in a document, where each document in the search results must contain at least one of the additional search terms. You can also use the Boolean OR query term for this type of query.

Defined in

langchain/src/agents/tools/serpapi.ts:178


as_q

Optional as_q: string

as_q Parameter provides search terms to check for in a document. This parameter is also commonly used to allow users to specify additional terms to search for within a set of search results.

Defined in

langchain/src/agents/tools/serpapi.ts:185


as_qdr

Optional as_qdr: string

as_qdr Parameter requests search results from a specified time period (quick date range). The following values are supported: d[number]: requests results from the specified number of past days. Example for the past 10 days: as_qdr=d10 w[number]: requests results from the specified number of past weeks. m[number]: requests results from the specified number of past months. y[number]: requests results from the specified number of past years. Example for the past year: as_qdr=y

Defined in

langchain/src/agents/tools/serpapi.ts:197


as_rq

Optional as_rq: string

as_rq Parameter specifies that all search results should be pages that are related to the specified URL. The parameter value should be a URL. You can also use the related: query term for this type of query.

Defined in

langchain/src/agents/tools/serpapi.ts:205


as_sitesearch

Optional as_sitesearch: string

as_sitesearch Parameter allows you to specify that all search results should be pages from a given site. By setting the as_dt parameter, you can also use it to exclude pages from a given site from your search resutls.

Defined in

langchain/src/agents/tools/serpapi.ts:212


device

Optional device: "desktop" | "tablet" | "mobile"

Parameter defines the device to use to get the results. It can be set to desktop (default) to use a regular browser, tablet to use a tablet browser (currently using iPads), or mobile to use a mobile browser (currently using iPhones).

Inherited from

BaseParameters.device

Defined in

langchain/src/agents/tools/serpapi.ts:18


filter

Optional filter: string

Results Filtering Parameter defines if the filters for 'Similar Results' and 'Omitted Results' are on or off. It can be set to 1 (default) to enable these filters, or 0 to disable these filters.

Defined in

langchain/src/agents/tools/serpapi.ts:239


gl

Optional gl: string

Country Parameter defines the country to use for the Google search. It's a two-letter country code. (e.g., us for the United States, uk for United Kingdom, or fr for France). Head to the Google countries page for a full list of supported Google countries.

Defined in

langchain/src/agents/tools/serpapi.ts:109


google_domain

Optional google_domain: string

Domain Parameter defines the Google domain to use. It defaults to google.com. Head to the Google domains page for a full list of supported Google domains.

Defined in

langchain/src/agents/tools/serpapi.ts:100


hl

Optional hl: string

Language Parameter defines the language to use for the Google search. It's a two-letter language code. (e.g., en for English, es for Spanish, or fr for French). Head to the Google languages page for a full list of supported Google languages.

Defined in

langchain/src/agents/tools/serpapi.ts:117


ijn

Optional ijn: string

Page Number (images) Parameter defines the page number for Google Images. There are 100 images per page. This parameter is equivalent to start (offset) = ijn * 100. This parameter works only for Google Images (set tbm to isch).

Defined in

langchain/src/agents/tools/serpapi.ts:275


kgmid

Optional kgmid: string

Google Knowledge Graph ID Parameter defines the id (KGMID) of the Google Knowledge Graph listing you want to scrape. Also known as Google Knowledge Graph ID. Searches with kgmid parameter will return results for the originally encrypted search parameters. For some searches, kgmid may override all other parameters except start, and num parameters.

Defined in

langchain/src/agents/tools/serpapi.ts:84


location

Optional location: string

Location Parameter defines from where you want the search to originate. If several locations match the location requested, we'll pick the most popular one. Head to the /locations.json API if you need more precise control. location and uule parameters can't be used together. Avoid utilizing location when setting the location outside the U.S. when using Google Shopping and/or Google Product API.

Defined in

langchain/src/agents/tools/serpapi.ts:53


lr

Optional lr: string

Set Multiple Languages Parameter defines one or multiple languages to limit the search to. It uses lang_{two-letter language code} to specify languages and | as a delimiter. (e.g., lang_fr|lang_de will only search French and German pages). Head to the Google lr languages page for a full list of supported languages.

Defined in

langchain/src/agents/tools/serpapi.ts:126


lsig

Optional lsig: string

Additional Google Place ID Parameter that you might have to use to force the knowledge graph map view to show up. You can find the lsig ID by using our Local Pack API or Places Results API. lsig ID is also available via a redirect Google uses within Google My Business.

Defined in

langchain/src/agents/tools/serpapi.ts:75


ludocid

Optional ludocid: string

Google Place ID Parameter defines the id (CID) of the Google My Business listing you want to scrape. Also known as Google Place ID.

Defined in

langchain/src/agents/tools/serpapi.ts:65


nfpr

Optional nfpr: string

Exclude Auto-corrected Results Parameter defines the exclusion of results from an auto-corrected query that is spelled wrong. It can be set to 1 to exclude these results, or 0 to include them (default).

Defined in

langchain/src/agents/tools/serpapi.ts:232


no_cache

Optional no_cache: boolean

Parameter will force SerpApi to fetch the Google results even if a cached version is already present. A cache is served only if the query and all parameters are exactly the same. Cache expires after 1h. Cached searches are free, and are not counted towards your searches per month. It can be set to false (default) to allow results from the cache, or true to disallow results from the cache. no_cache and async parameters should not be used together.

Inherited from

BaseParameters.no_cache

Defined in

langchain/src/agents/tools/serpapi.ts:27


num

Optional num: string

Number of Results Parameter defines the maximum number of results to return. (e.g., 10 (default) returns 10 results, 40 returns 40 results, and 100 returns 100 results).

Defined in

langchain/src/agents/tools/serpapi.ts:267


q

q: string

Search Query Parameter defines the query you want to search. You can use anything that you would use in a regular Google search. e.g. inurl:, site:, intitle:. We also support advanced search query parameters such as as_dt and as_eq. See the full list of supported advanced search query parameters.

Defined in

langchain/src/agents/tools/serpapi.ts:43


safe

Optional safe: string

Adult Content Filtering Parameter defines the level of filtering for adult content. It can be set to active, or off (default).

Defined in

langchain/src/agents/tools/serpapi.ts:225


si

Optional si: string

Google Cached Search Parameters ID Parameter defines the cached search parameters of the Google Search you want to scrape. Searches with si parameter will return results for the originally encrypted search parameters. For some searches, si may override all other parameters except start, and num parameters. si can be used to scrape Google Knowledge Graph Tabs.

Defined in

langchain/src/agents/tools/serpapi.ts:93


start

Optional start: number

Result Offset Parameter defines the result offset. It skips the given number of results. It's used for pagination. (e.g., 0 (default) is the first page of results, 10 is the 2nd page of results, 20 is the 3rd page of results, etc.). Google Local Results only accepts multiples of 20(e.g. 20 for the second page results, 40 for the third page results, etc.) as the start value.

Defined in

langchain/src/agents/tools/serpapi.ts:261


tbm

Optional tbm: string

Search Type (to be matched) parameter defines the type of search you want to do. It can be set to: (no tbm parameter): regular Google Search, isch: Google Images API, lcl - Google Local API vid: Google Videos API, nws: Google News API, shop: Google Shopping API, or any other Google service.

Defined in

langchain/src/agents/tools/serpapi.ts:252


tbs

Optional tbs: string

Advanced Search Parameters (to be searched) parameter defines advanced search parameters that aren't possible in the regular query field. (e.g., advanced search for patents, dates, news, videos, images, apps, or text contents).

Defined in

langchain/src/agents/tools/serpapi.ts:219


timeout

Optional timeout: number

Specify the client-side timeout of the request. In milliseconds.

Inherited from

BaseParameters.timeout

Defined in

langchain/src/agents/tools/serpapi.ts:31


uule

Optional uule: string

Encoded Location Parameter is the Google encoded location you want to use for the search. uule and location parameters can't be used together.

Defined in

langchain/src/agents/tools/serpapi.ts:59