
Google Scraper
Scrape Google with a simple API. It includes Google Search, Google Maps, Google Shopping, and more!
We return the results in a nice, structured JSON (or Makrdown). No more parsing, coding, proxy, or other web scraping headaches for developers.
How to scrape Google?
Using a simple GET request, you can access all Google search engine results:
https://serpapi.com/search.json?q=Coffee&engine=google&api_key=YOUR_API_KEY
- Register for free at SerpApi and get your API Key
- Endpoint:
https://serpapi.com/search.json
- If you don’t define the
engine, it defaults to google. You can replace the value with any engine you need. For example, google_maps for Google Maps scraper.
- Each of this engine have many optional parameters to refine your search.
Available Google Search Engines
We provide different engines, like:
Code examples
Here are some code examples based on your favorite programming languages.
cURL Integration
curl --get https://serpapi.com/search \
-d q="Coffee" \
-d location="Austin,+Texas,+United+States" \
-d hl="en" \
-d gl="us" \
-d google_domain="google.com" \
-d api_key="secret_api_key"
Python Integration
Preparation for accessing the SerpApi API in Python
Step 1:
Create a new main.py file. (You can name it whatever you want)
Step 2:
Install requests package with:
pip install requests
Step 3:
Add this code to your file:
import requests
SERPAPI_API_KEY = "YOUR_REAL_SERPAPI_API_KEY"
params = {
"api_key": SERPAPI_API_KEY, #replace with your real API Key
# soon
}
search = requests.get("https://serpapi.com/search", params=params)
response = search.json()
print(response)
With these few lines of code, we can access all of the search engines available at SerpApi, including the Google Search API.
Step 4:
Here is how to scrape “Google Search” results.
import requests
SERPAPI_API_KEY = "YOUR_SERPAPI_API_KEY"
params = {
"api_key": SERPAPI_API_KEY,
"engine": "google",
"q": "coffee"
}
search = requests.get("https://serpapi.com/search", params=params)
response = search.json()
print(response)
JavaScript Integration
Step 1:
Install the SerpApi JavaScript package:
npm install serpapi
Step 2:
Create a new index.js file. (You can name it whatever you want)
Step 3:
Add this to your file for basic search:
const { getJson } = require("serpapi");
getJson({
api_key: API_KEY,
engine: "google",
q: "coffee"
}, (json) => {
console.log(json["organic_results"]);
});
We’re printing the organic_results from Google Search in this case.
Other Programming Languages
While you can use our APIs using a simple GET request with any programming language, you can also see our ready-to-use libraries here: SerpApi Integrations.
Blog tutorial
Video tutorial
Nocode method
We also offer no-code solutions for scraping Google.
Feel free to reach out via [email protected].
评论