Sharks API
  1. Google Search
Sharks API
  • Google Search
    • code list
    • google search
      GET
    • google search
      POST
  1. Google Search

google search

POST
/api/v1/open/search

Request

Body Params application/json
api_key
string 
required
Parameter api_key open search required
cr
string 
optional
Parameter defines one or multiple countries to limit the search to. It uses country{two-letter upper-case country code} to specify countries and cr="countryCN|countryJP"
device
string 
optional
Parameter defines the device to use to get the results. Currently only supports desktop version.
engine
string 
optional
Parameter engine Currently only supports google
fetch_mode
string 
optional
Parameter fetch_mode Currently only supports static
filter
string 
optional
Parameter defines the exclusion of results from an auto-corrected query when the original query is spelled wrong. It can be set to 1 to exclude these results, or 0 to include them (default). Note that this parameter may not prevent Google from returning results for an auto-corrected query if no other results are available. 1 or 0
gl
string 
optional
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.
google_domain
string 
optional
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.
hl
string 
optional
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.
html
string 
optional
Parameter html 1 or 0
ibp
string 
optional
Parameter is responsible for rendering layouts and expansions for some elements (e.g., gwp;0,7 to expand searches with ludocid for expanded knowledge graph).
kgmid
string 
optional
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.
location
string 
optional
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. The location and uule parameters can't be used together. It is recommended to specify location at the city level in order to simulate a real user’s search. If location is omitted, the search may take on the location of the proxy.
lr
string 
optional
Parameter defines one or multiple languages to limit the search to. It uses lang_{two-letter language code} to specify languages and lr = "lang_de|lang_ja"
lsig
string 
optional
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 Google Local API.lsig ID is also available via a redirect Google uses within Google My Business.
ludocid
string 
optional
Parameter defines the id (CID) of the Google My Business listing you want to scrape. Also known as Google Place ID.
nfpr
string 
optional
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. 1 or 0
no_cache
boolean 
optional
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. true or false
num
integer 
optional
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).The use of num may introduce latency, and/or prevent the inclusion of specialized result types. It is better to omit this parameter unless it is strictly necessary to increase the number of results per page.
q
string 
required
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.
safe
string 
optional
Parameter defines the level of filtering for adult content. It can be set to active or off, by default Google will blur explicit content. off or active
start
integer 
optional
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.
tbs
string 
optional
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). (to be searched)
time
string 
optional
Parameter time last hour=h last day=d last week=w last month=m last year=y
uds
string 
optional
Parameter enables to filter search. It's a string provided by Google as a filter. uds values are provided under the section: filters with uds, q and serpapi_link values provided for each filter.
Example
{
    "api_key": "string",
    "cr": "string",
    "device": "string",
    "engine": "string",
    "fetch_mode": "string",
    "filter": "string",
    "gl": "string",
    "google_domain": "string",
    "hl": "string",
    "html": "string",
    "ibp": "string",
    "kgmid": "string",
    "location": "string",
    "lr": "string",
    "lsig": "string",
    "ludocid": "string",
    "nfpr": "string",
    "no_cache": true,
    "num": 0,
    "q": "string",
    "safe": "string",
    "start": 0,
    "tbs": "string",
    "time": "string",
    "uds": "string"
}

Request samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST '/api/v1/open/search' \
--header 'Content-Type: application/json' \
--data-raw '{
    "api_key": "string",
    "cr": "string",
    "device": "string",
    "engine": "string",
    "fetch_mode": "string",
    "filter": "string",
    "gl": "string",
    "google_domain": "string",
    "hl": "string",
    "html": "string",
    "ibp": "string",
    "kgmid": "string",
    "location": "string",
    "lr": "string",
    "lsig": "string",
    "ludocid": "string",
    "nfpr": "string",
    "no_cache": true,
    "num": 0,
    "q": "string",
    "safe": "string",
    "start": 0,
    "tbs": "string",
    "time": "string",
    "uds": "string"
}'

Responses

🟢200OK
*/*
{"code": 200, "data": [...]}
Body
code
integer 
optional
返回码
data
object 
dto.GetSearchResp
optional
数据
also_ask
array[object (dto.AlsoAskItem) {1}] 
optional
cost_time
number 
optional
knowledge_graph
array[object (dto.KnowledgeGraphItem) {5}] 
optional
local_map
array[object (dto.LocalMapItem) {2}] 
optional
local_results
array[object (dto.LocalResultsItem) {6}] 
optional
organic_results
array[object (dto.OrganicResultsItem) {9}] 
optional
pagination
object 
dto.GetSearchPagination
optional
raw_html
string 
optional
原始html
related_searches
object 
dto.RelatedSearchesData
optional
search_information
array[object (dto.GetSearchInformationItem) {1}] 
optional
search_metadata
object 
dto.SearchMetadata
optional
search_parameters
object 
dto.GetSearchParameters
optional
url
string 
optional
msg
string 
optional
消息
reqId
string 
optional
json:"请求id"
Example
{
    "code": 0,
    "data": {
        "also_ask": [
            {
                "question": "string"
            }
        ],
        "cost_time": 0,
        "knowledge_graph": [
            {
                "field_value": {
                    "property1": [
                        "string"
                    ],
                    "property2": [
                        "string"
                    ]
                },
                "inline_images": [
                    {
                        "img": "string",
                        "title_link": "string"
                    }
                ],
                "other_labels": [
                    {
                        "image": "string",
                        "link": "string",
                        "name": "string"
                    }
                ],
                "title": "string",
                "type": "string"
            }
        ],
        "local_map": [
            {
                "image": "string",
                "link": "string"
            }
        ],
        "local_results": [
            {
                "address": "string",
                "img": "string",
                "label": "string",
                "position": 0,
                "service_options": [
                    "string"
                ],
                "title": "string"
            }
        ],
        "organic_results": [
            {
                "description": "string",
                "detailed": "string",
                "favicon": "string",
                "img": {
                    "property1": "string",
                    "property2": "string"
                },
                "origin_navigation": "string",
                "origin_site": "string",
                "rank": 0,
                "title": "string",
                "url": "string"
            }
        ],
        "pagination": {
            "current": 0,
            "next": "string",
            "other_pages": {
                "property1": "string",
                "property2": "string"
            }
        },
        "raw_html": "string",
        "related_searches": {
            "data": [
                {
                    "title": "string",
                    "url": "string"
                }
            ]
        },
        "search_information": [
            {
                "query_displayed": "string"
            }
        ],
        "search_metadata": {
            "created_at": "string",
            "google_url": "string",
            "id": "string",
            "json_endpoint": "string",
            "raw_html_file": "string",
            "total_time_taken": "string",
            "xray_html_file": "string"
        },
        "search_parameters": {
            "engine": "string",
            "filter": "string",
            "gl": "string",
            "google_domain": "string",
            "hl": "string",
            "html": "string",
            "ibp": "string",
            "kgmid": "string",
            "lsig": "string",
            "ludocid": "string",
            "nfpr": "string",
            "num": 0,
            "q": "string",
            "safe": "string",
            "start": 0,
            "tbs": "string",
            "time": "string",
            "uds": "string"
        },
        "url": "string"
    },
    "msg": "string",
    "reqId": "string"
}
Modified at 2025-07-10 06:11:17
Previous
google search
Built with