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.

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

engine

Required

Set parameter to google_local_services to use the Google Local Services API engine.

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.

api_key

Required

Parameter defines the SerpApi private key to use.

output

Optional

Parameter defines the final output you want. It can be set to json (default) to get a structured JSON of the results, or html to get the raw html retrieved.

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

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",
      "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"
    },
    ...
  ]
}

Example with q: electrician, and Austin, TX, US (data_cid: 6745062158417646970) as a location

Example with q: electrician, and Austin, TX, US (data_cid: 6745062158417646970) as a location

JSON Example

{
  "search_metadata": {
    "id": "63ef77d5de983401704dc219",
    "status": "Success",
    "json_endpoint": "https://serpapi.com/searches/8f10d18af088e70f/63ef77d5de983401704dc219.json",
    "created_at": "2023-02-17 12:49:25 UTC",
    "processed_at": "2023-02-17 12:49:26 UTC",
    "google_local_services_url": "https://www.google.com/_/AdsHomeservicesConsumerUi/data/batchexecute?hl=en",
    "raw_html_file": "https://serpapi.com/searches/8f10d18af088e70f/63ef77d5de983401704dc219.html",
    "prettify_html_file": "https://serpapi.com/searches/8f10d18af088e70f/63ef77d5de983401704dc219.prettify",
    "total_time_taken": 1.54
  },
  "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=Cix4Y2F0OnNlcnZpY2VfYXJlYV9idXNpbmVzc19lbGVjdHJpY2lhbjplbi1VUxIUGhIJLwPMoJm1RIYRetVp1EtGm10"
  },
  "local_ads": [
    {
      "title": "Abacus Electrical",
      "link": "https://www.google.com/localservices/profile?cs=0&q=Abacus+Electrical&spp=EkIKEgjGwMj_AhD5-q7RCRj_x6-gJRIseGNhdDpzZXJ2aWNlX2FyZWFfYnVzaW5lc3NfZWxlY3RyaWNpYW46ZW4tVVM&scp=Cix4Y2F0OnNlcnZpY2VfYXJlYV9idXNpbmVzc19lbGVjdHJpY2lhbjplbi1VUxIUGhIJLwPMoJm1RIYRetVp1EtGm10",
      "rating": 4.8,
      "reviews": 1931,
      "phone": "+15127906564",
      "badge": "GOOGLE GUARANTEED",
      "type": "Electrical",
      "service_area": "Austin",
      "years_in_business": 20,
      "hours": {
        "currently": "Open 24 hours",
        "week": [
          {
            "monday": "Open 24 hours"
          },
          {
            "tuesday": "Open 24 hours"
          },
          {
            "wednesday": "Open 24 hours"
          },
          ...
        ]
      },
      "cid": "804397126",
      "bid": "2586557817",
      "pid": "9999999999",
      "serpapi_link": "https://serpapi.com/search.json?bid=2586557817&cid=804397126&data_cid=6745062158417646970&engine=google_local_services&hl=en&pid=9999999999&q=electrician"
    },
    {
      "title": "Fox Service Company - Electrical",
      "link": "https://www.google.com/localservices/profile?cs=0&q=Fox+Service+Company+-+Electrical&spp=EkIKEgjmgpqXARDy5Y2wCRiPzuexCRIseGNhdDpzZXJ2aWNlX2FyZWFfYnVzaW5lc3NfZWxlY3RyaWNpYW46ZW4tVVM&scp=Cix4Y2F0OnNlcnZpY2VfYXJlYV9idXNpbmVzc19lbGVjdHJpY2lhbjplbi1VUxIUGhIJLwPMoJm1RIYRetVp1EtGm10",
      "rating": 4.7,
      "reviews": 1401,
      "phone": "+15128711354",
      "badge": "GOOGLE GUARANTEED",
      "type": "Electrical",
      "service_area": "Austin",
      "years_in_business": 53,
      "hours": {
        "currently": "Open 24 hours",
        "week": [
          {
            "monday": "Open 24 hours"
          },
          {
            "tuesday": "Open 24 hours"
          },
          {
            "wednesday": "Open 24 hours"
          },
          ...
        ]
      },
      "cid": "317096294",
      "bid": "2516808434",
      "pid": "2520377103",
      "serpapi_link": "https://serpapi.com/search.json?bid=2516808434&cid=317096294&data_cid=6745062158417646970&engine=google_local_services&hl=en&pid=2520377103&q=electrician"
    },
    {
      "title": "TruTec Electric",
      "link": "https://www.google.com/localservices/profile?cs=0&q=TruTec+Electric&spp=EkEKEQjkrdJfEKntrKwJGLrjiK0JEix4Y2F0OnNlcnZpY2VfYXJlYV9idXNpbmVzc19lbGVjdHJpY2lhbjplbi1VUw&scp=Cix4Y2F0OnNlcnZpY2VfYXJlYV9idXNpbmVzc19lbGVjdHJpY2lhbjplbi1VUxIUGhIJLwPMoJm1RIYRetVp1EtGm10",
      "rating": 5.0,
      "reviews": 163,
      "phone": "+15128714265",
      "badge": "GOOGLE GUARANTEED",
      "type": "Electrical",
      "service_area": "Austin",
      "years_in_business": 6,
      "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"
    },
    ...
  ]
}