Google Local API
The Google Local API retrieves local business listings from Google search including ratings, reviews, addresses, GPS coordinates, and business type. Costs 5 API credits per request.
Endpoint:
https://api.scrapingdog.com/google_localAPI Parameters
π
Authentication
api_keyRequiredYour personal API key. Available on your dashboard
Type: String
π
Search Query
queryRequiredThis is a Google Search Query. Example:query=coffee+in+manhattan
Type: String
π
Geographic Location and Localization
locationOptionalThe location from where you want to scrape the local results. Example:Manhattan, New York
Note: Cannot be used together with theuuleparameter.
Type: StringuuleOptionalIt is a parameter that specifies the geographic location or locale for which the search results should be tailored. Possible Value could bew+CAIQIFJlbWF5IFN0YXRlcw==
Note: Cannot be used together with thelocationparameter.
Type: StringcountryOptionalISO code of the country from which you are seeking Google search results.
Default:us
Type: StringlanguageOptionalLanguage of the results. Possible Values -en,es,fr,de, etc.
Default:en
Type: StringdomainOptionalTo obtain local results from a specific country, for example, for India, it will be "google.co.in," and for the UK, it will be "google.co.uk".
Default:google.com
Type: String
β
οΈ Advanced Filters
ludocidOptionalGoogle My Business listing ID (CID) you want to scrape, also known as the Google Place ID.
Type: StringtbsOptionalto be searched - An advanced parameter to filter search results.
Type: String
π
Pagination
pageOptionalThis is the page number of Google searches. Its value can be0for the first page,1for the second page, and so on.
Default:0
Type: String
API Examples
Code to Integrate
curl "https://api.scrapingdog.com/google_local?api_key=APIKEY&query=coffee+in+manhattan"
import requests url = "https://api.scrapingdog.com/google_local" params = {"api_key": "APIKEY", "query": "coffee in manhattan"} response = requests.get(url, params=params) if response.status_code == 200: print(response.json())
const axios = require('axios'); axios.get('https://api.scrapingdog.com/google_local', { params: { api_key: 'APIKEY', query: 'coffee in manhattan' } }).then(response => console.log(response.data)) .catch(error => console.error(error.message));
<?php $url = 'https://api.scrapingdog.com/google_local/?' . http_build_query([ 'api_key' => 'APIKEY', 'query' => 'coffee in manhattan', ]); $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); echo curl_exec($ch); curl_close($ch);
require 'net/http' require 'uri' url = URI.parse("https://api.scrapingdog.com/google_local/") url.query = URI.encode_www_form('api_key' => 'APIKEY', 'query' => 'coffee in manhattan') http = Net::HTTP.new(url.host, url.port) http.use_ssl = true puts http.request(Net::HTTP::Get.new(url)).body
import java.io.*; import java.net.*; public class Main { public static void main(String[] args) throws Exception { String apiUrl = "https://api.scrapingdog.com/google_local/?api_key=APIKEY&query=coffee+in+manhattan"; URL url = new URL(apiUrl); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setRequestMethod("GET"); BufferedReader reader = new BufferedReader(new InputStreamReader(conn.getInputStream())); String line; while ((line = reader.readLine()) != null) System.out.println(line); conn.disconnect(); } }
API Response
{
"local_results": [
{
"title": "Bird & Branch Coffee Roasters",
"rating": "4.7",
"reviews": "762",
"price": "$1β10",
"description": "Family-run specialty coffee shop",
"address": "359 W 45th St",
"type": "Coffee shop",
"place_id": "197653116721562462",
"gps_coordinates": {
"lat": "40.7602998",
"lng": "-73.9907758"
}
}
]
}