Google Local Services API
Our Google Local Services API allows you to scrape local ads results from the Google Local Services search page. The API is accessed through the following endpoint: /search?engine=google_local_services
.
A user may query the following: https://serpapi.com/search?engine=google_local_services
utilizing a GET
request. Head to the playground for a live and interactive demo.
API Parameters
Search Query
q
Required
Parameter defines the service you want to search for. Head to the Google local services queries page for a full list of supported Google local services queries.
Geographic Location
data_cid
Required
Parameter defines the Google CID (customer identifier) of a place. To aquire the data_cid you can either use Google's CID converter, or SerpApi's Google Maps API. Example CID for "New York, NY, USA": 14414772292044717666
.
Google Local Services API returns empty results for places outside of the USA.
Localization
hl
Optional
Parameter defines the language to use for the Google Local Services 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.
Advanced Google Local Services Parameters
job_type
Optional
Parameter defines the type of a job, or a subcategory of a service you have searched for. For example, if you search for "electrician", you can be more specific by adding a job_type (e.g. job_type=restore_power
). Head to the Google local services job types page for a full list of supported Google local services job types.
Google Local Services Place Parameters
cid
Optional
Parameter defines a unique ID of a place. The ID is available in our Google Local Services API JSON response.
Parameter is required when accessing a specific business and should be used with bid and pid parameters.
bid
Optional
Parameter defines a unique ID of a place. The ID is available in our Google Local Services API JSON response.
Parameter is required when accessing a specific business and should be used with cid and pid parameters.
pid
Optional
Parameter defines a unique ID of a place. The ID is available in our Google Local Services API JSON response.
Parameter is required when accessing a specific business and should be used with cid and bid parameters.
Serpapi Parameters
no_cache
Optional
Parameter will force SerpApi to fetch the Google Local Services 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.
async
Optional
Parameter defines the way you want to submit your search to SerpApi. It can be set to false
(default) to open an HTTP connection and keep it open until you got your search results, or true
to just submit your search to SerpApi and retrieve them later. In this case, you'll need to use our Searches Archive API to retrieve your results. async and no_cache parameters should not be used together. async should not be used on accounts with Ludicrous Speed enabled.
zero_trace
Optional
Enterprise only. Parameter enables ZeroTrace mode. It can be set to false
(default) or true
. Enable this mode to skip storing search parameters, search files, and search metadata on our servers. This may make debugging more difficult.
Deprecated
Google's ID of a place (place_id parameter) has been deprecated by Google. data_cid parameter should be used instead.
API Results
JSON Results
JSON output includes structured data for Local Ads and Local Place results.
A search status is accessible through search_metadata.status
. It flows this way: Processing
-> Success
|| Error
. If a search has failed, error
will contain an error message. search_metadata.id
is the search ID inside SerpApi.
HTML Results
This API does not have the HTML response, just a text. search_metadata.prettify_html_file
contains prettified version of the result. It is displayed in the playground.
API Examples
Example with q: electrician
, and Austin, TX, US (data_cid: 6745062158417646970
) as a location
{
"search_metadata": {
"id": "6706491796b8f861e9b084dc",
"status": "Success",
"json_endpoint": "https://serpapi.com/searches/37cb6121315438a4/6706491796b8f861e9b084dc.json",
"created_at": "2024-10-09 09:12:55 UTC",
"processed_at": "2024-10-09 09:12:55 UTC",
"google_local_services_url": "https://www.google.com/_/AdsHomeservicesConsumerUi/data/batchexecute?hl=en",
"raw_html_file": "https://serpapi.com/searches/37cb6121315438a4/6706491796b8f861e9b084dc.html",
"prettify_html_file": "https://serpapi.com/searches/37cb6121315438a4/6706491796b8f861e9b084dc.prettify",
"total_time_taken": 1.80
},
"search_parameters": {
"engine": "google_local_services",
"hl": "en",
"q": "electrician",
"data_cid": "6745062158417646970"
},
"search_information": {
"google_local_services_url": "https://www.google.com/localservices/prolist?scp=Cix4Y2F0OnNlcnZpY2VfYXJlYV9idXNpbmVzc19lbGVjdHJpY2lhbjplbi1VUxIYGhIJLwPMoJm1RIYRetVp1EtGm104mdE-"
},
"local_ads": [
{
"title": "Tejas Electric",
"link": "https://www.google.com/localservices/profile?cs=0&q=Tejas+Electric&spp=EkIKEgithoKcARC49cWwCRic1q2yCRIseGNhdDpzZXJ2aWNlX2FyZWFfYnVzaW5lc3NfZWxlY3RyaWNpYW46ZW4tVVM&scp=Cix4Y2F0OnNlcnZpY2VfYXJlYV9idXNpbmVzc19lbGVjdHJpY2lhbjplbi1VUxIYGhIJLwPMoJm1RIYRetVp1EtGm104mdE-",
"rating": 5.0,
"reviews": 153,
"phone": "+15128713043",
"badge": "GOOGLE GUARANTEED",
"type": "Electrician",
"service_area": "Austin",
"years_in_business": 6,
"bookings_nearby": 10,
"thumbnail": "https://lh3.googleusercontent.com/UeXDfd2UzUat22NrelNUdBqzYTd7Z6P3PpNfo3skdQN654eKvqUl_0EeY1RUvg=w150-h150-p-rj-sc0x00ffffff",
"hours": {
"currently": "Open 24 hours",
"week": [
{
"monday": "Open 24 hours"
},
{
"tuesday": "Open 24 hours"
},
{
"wednesday": "Open 24 hours"
},
...
]
},
"cid": "327189293",
"bid": "2517727928",
"pid": "2521525020",
"serpapi_link": "https://serpapi.com/search.json?bid=2517727928&cid=327189293&data_cid=6745062158417646970&engine=google_local_services&hl=en&pid=2521525020&q=electrician"
},
{
"title": "Terrapin Electric",
"link": "https://www.google.com/localservices/profile?cs=0&q=Terrapin+Electric&spp=EkIKEgj6jYLJBBCb8rz7DBj_x6-gJRIseGNhdDpzZXJ2aWNlX2FyZWFfYnVzaW5lc3NfZWxlY3RyaWNpYW46ZW4tVVM&scp=Cix4Y2F0OnNlcnZpY2VfYXJlYV9idXNpbmVzc19lbGVjdHJpY2lhbjplbi1VUxIYGhIJLwPMoJm1RIYRetVp1EtGm104mdE-",
"rating": 4.9,
"reviews": 188,
"phone": "+15053874447",
"badge": "GOOGLE GUARANTEED",
"type": "Electrician",
"service_area": "Austin",
"years_in_business": 2,
"thumbnail": "https://lh3.googleusercontent.com/XHXRJptom5xpRDRTt23ZpRm7-ZxeJ2yG4cE-lYXZxI6ihyiCz4Rr_DNwNh9S=w150-h150-p-rj-sc0x00ffffff",
"hours": {
"currently": "Open 24 hours",
"week": [
{
"monday": "Open 24 hours"
},
{
"tuesday": "Open 24 hours"
},
{
"wednesday": "Open 24 hours"
},
...
]
},
"cid": "1226868474",
"bid": "3480172827",
"pid": "9999999999",
"serpapi_link": "https://serpapi.com/search.json?bid=3480172827&cid=1226868474&data_cid=6745062158417646970&engine=google_local_services&hl=en&pid=9999999999&q=electrician"
},
{
"title": "TruTec Electric",
"link": "https://www.google.com/localservices/profile?cs=0&q=TruTec+Electric&spp=EkEKEQjkrdJfEKntrKwJGLrjiK0JEix4Y2F0OnNlcnZpY2VfYXJlYV9idXNpbmVzc19lbGVjdHJpY2lhbjplbi1VUw&scp=Cix4Y2F0OnNlcnZpY2VfYXJlYV9idXNpbmVzc19lbGVjdHJpY2lhbjplbi1VUxIYGhIJLwPMoJm1RIYRetVp1EtGm104mdE-",
"rating": 4.9,
"reviews": 429,
"phone": "+15127906031",
"badge": "GOOGLE GUARANTEED",
"type": "Electrician",
"service_area": "Austin",
"years_in_business": 7,
"thumbnail": "https://lh3.googleusercontent.com/c3k4FQhEhZ9I67nd4BfOGk4Z55UNW4wAnaFW8AnE7ZpP9JQnNao77HFEm3hiXQ=w150-h150-p-rj-sc0x00ffffff",
"hours": {
"currently": "Open 24 hours",
"week": [
{
"monday": "Open 24 hours"
},
{
"tuesday": "Open 24 hours"
},
{
"wednesday": "Open 24 hours"
},
...
]
},
"cid": "200578788",
"bid": "2508928681",
"pid": "2510434746",
"serpapi_link": "https://serpapi.com/search.json?bid=2508928681&cid=200578788&data_cid=6745062158417646970&engine=google_local_services&hl=en&pid=2510434746&q=electrician"
},
...
]
}
JSON structure overview
{
"local_ads": [
{
"title": "String - Title of the business",
"link": "String - URL to the Google Local Services search",
"rating": "Float - Rating of the business",
"reviews": "Integer - Number of reviews of the business",
"phone": "String - Phone number of the business",
"badge": "String - Google awarded badge of the business",
"type": "String - Type of the business",
"service_area": "String - Main coverage area of the business",
"years_in_business": "Integer - Number of years that business is in operation",
"bookings_nearby": "Integer - Number of bookings nearby",
"thumbnail": "String - Thumbnail of the business",
"hours": {
"currently": "String - Current open status of the business",
"week": [
{
"monday": "String - Working hours of the business"
},
...
]
},
"cid": "String - Unique ID of the business",
"bid": "String - Unique ID of the business",
"pid": "String - Unique ID of the business",
"serpapi_link": "String - URL to the SerpApi search"
},
...
]
}