Google Shopping
With E-Commerce Scraper API, you can scrape and parse various types of Google Shopping pages; below is an overview of all supported scrapers and their respective source
values.
Source | Description | Dedicated parser |
---|---|---|
| Product page of a product ID of your choice. | Yes. |
| Search results for a search term of your choice. | Yes. |
| List of offers available for a product ID of your choice. | Yes. |
| Submit any Google Shopping URL you like. | Limited to URLs of specific Google page types. |
Getting started
Create your API user credentials: Sign up for a free trial or purchase the product in the Oxylabs dashboard to create your API user credentials (USERNAME
and PASSWORD
).
If you need more than one API user for your account, please contact our customer support or message our 24/7 live chat support.
Request samples
curl 'https://realtime.oxylabs.io/v1/queries' \
--user 'USERNAME:PASSWORD' \
-H 'Content-Type: application/json' \
-d '{
"source": "google_shopping_product",
"domain": "com",
"query": "5007040952399054528",
"parse": true
}'
import requests
from pprint import pprint
# Structure payload.
payload = {
'source': 'google_shopping_product',
'domain': 'com',
'query': '5007040952399054528',
'parse': True
}
# Get response.
response = requests.request(
'POST',
'https://realtime.oxylabs.io/v1/queries',
auth=('USERNAME', 'PASSWORD'),
json=payload,
)
# Print prettified response to stdout.
pprint(response.json())
const https = require("https");
const username = "USERNAME";
const password = "PASSWORD";
const body = {
source: "google_shopping_product",
domain: "com",
query: "5007040952399054528",
parse: true,
};
const options = {
hostname: "realtime.oxylabs.io",
path: "/v1/queries",
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization:
"Basic " + Buffer.from(`${username}:${password}`).toString("base64"),
},
};
const request = https.request(options, (response) => {
let data = "";
response.on("data", (chunk) => {
data += chunk;
});
response.on("end", () => {
const responseData = JSON.parse(data);
console.log(JSON.stringify(responseData, null, 2));
});
});
request.on("error", (error) => {
console.error("Error:", error);
});
request.write(JSON.stringify(body));
request.end();
https://realtime.oxylabs.io/v1/queries?source=google_shopping_product&domain=com&query=5007040952399054528&parse=true&access_token=12345abcde
<?php
$params = array(
'source' => 'google_shopping_product',
'domain' => 'com',
'query' => '5007040952399054528',
'parse' => true
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://realtime.oxylabs.io/v1/queries");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($params));
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_USERPWD, "USERNAME" . ":" . "PASSWORD");
$headers = array();
$headers[] = "Content-Type: application/json";
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($ch);
echo $result;
if (curl_errno($ch)) {
echo 'Error:' . curl_error($ch);
}
curl_close($ch);
package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
)
func main() {
const Username = "USERNAME"
const Password = "PASSWORD"
payload := map[string]interface{}{
"source": "google_shopping_product",
"domain": "com",
"query": "5007040952399054528",
"parse": true,
}
jsonValue, _ := json.Marshal(payload)
client := &http.Client{}
request, _ := http.NewRequest("POST",
"https://realtime.oxylabs.io/v1/queries",
bytes.NewBuffer(jsonValue),
)
request.SetBasicAuth(Username, Password)
response, _ := client.Do(request)
responseText, _ := ioutil.ReadAll(response.Body)
fmt.Println(string(responseText))
}
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Json;
using System.Threading.Tasks;
namespace OxyApi
{
class Program
{
static async Task Main()
{
const string Username = "USERNAME";
const string Password = "PASSWORD";
var parameters = new {
source = "google_shopping_product",
domain = "com",
query = "5007040952399054528",
parse = true
};
var client = new HttpClient();
Uri baseUri = new Uri("https://realtime.oxylabs.io");
client.BaseAddress = baseUri;
var requestMessage = new HttpRequestMessage(HttpMethod.Post, "/v1/queries");
requestMessage.Content = JsonContent.Create(parameters);
var authenticationString = $"{Username}:{Password}";
var base64EncodedAuthenticationString = Convert.ToBase64String(System.Text.ASCIIEncoding.UTF8.GetBytes(authenticationString));
requestMessage.Headers.Add("Authorization", "Basic " + base64EncodedAuthenticationString);
var response = await client.SendAsync(requestMessage);
var contents = await response.Content.ReadAsStringAsync();
Console.WriteLine(contents);
}
}
}
package org.example;
import okhttp3.*;
import org.json.JSONObject;
import java.util.concurrent.TimeUnit;
public class Main implements Runnable {
private static final String AUTHORIZATION_HEADER = "Authorization";
public static final String USERNAME = "USERNAME";
public static final String PASSWORD = "PASSWORD";
public void run() {
JSONObject jsonObject = new JSONObject();
jsonObject.put("source", "google_shopping_product");
jsonObject.put("domain", "com");
jsonObject.put("query", "5007040952399054528");
jsonObject.put("parse", true);
Authenticator authenticator = (route, response) -> {
String credential = Credentials.basic(USERNAME, PASSWORD);
return response
.request()
.newBuilder()
.header(AUTHORIZATION_HEADER, credential)
.build();
};
var client = new OkHttpClient.Builder()
.authenticator(authenticator)
.readTimeout(180, TimeUnit.SECONDS)
.build();
var mediaType = MediaType.parse("application/json; charset=utf-8");
var body = RequestBody.create(jsonObject.toString(), mediaType);
var request = new Request.Builder()
.url("https://realtime.oxylabs.io/v1/queries")
.post(body)
.build();
try (var response = client.newCall(request).execute()) {
if (response.body() != null) {
try (var responseBody = response.body()) {
System.out.println(responseBody.string());
}
}
} catch (Exception exception) {
System.out.println("Error: " + exception.getMessage());
}
System.exit(0);
}
public static void main(String[] args) {
new Thread(new Main()).start();
}
}
{
"source": "google_shopping_product",
"domain": "com",
"query": "5007040952399054528",
"parse": true
}
Output example
{
"results": [
{
"content": {
"url": "https://www.google.com/shopping/product/5007040952399054528?uule=w+CAIQICINdW5pdGVkIHN0YXRlcw&gl=us&hl=en",
"title": "Nintendo Switch - Gray Joy-Con",
"images": {
"full_size": [
"https://encrypted-tbn1.gstatic.com/shopping?q=tbn:ANd9GcR4AUXzhl0oIFtz3giLEUsdGtsilvw8CZl1Y31IEj_AvzIDWG0&usqp=CAY",
...
"https://encrypted-tbn0.gstatic.com/shopping?q=tbn:ANd9GcToYoWMmOHXnZo8Np5NTZZTw5XtWBmnD0jJuliVEbayoUoRroY&usqp=CAY"
],
"thumbnails": []
},
"pricing": {
"online": [
{
"price": 279,
"seller": "eBay",
"details": "$6.86 delivery by Wed, Jul 10",
"currency": "USD",
"condition": "New",
"price_tax": 28.6,
"price_total": 314.46,
"seller_link": "/url?q=https://www.ebay.com/itm/355727353733%3Fchn%3Dps%26mkevt%3D1%26mkcid%3D28&opi=95576897&sa=U&ved=0ahUKEwjoqrK61IWHAxV_QlUIHdV8AewQ2ykIZw&usg=AOvVaw0Pt7e83t8qaZtK-8V-r-oX",
"price_shipping": 6.86
},
{
"price": 249.95,
"seller": "The Game Store And More",
"details": "Free delivery by Wed, Jul 17Apply SUMMER",
"currency": "USD",
"condition": "New",
"price_tax": 0,
"price_total": 249.95,
"seller_link": "/url?q=https://gamestoreandmore.com/products/nintendo-switch-with-gray-joy-con-nintendo-switch%3Fvariant%3D48844204802322%26currency%3DUSD%26utm_medium%3Dproduct_sync%26utm_source%3Dgoogle%26utm_content%3Dsag_organic%26utm_campaign%3Dsag_organic%26srsltid%3DAfmBOooWDt8hObZEFrEypoOL5xBWO9YAFI5SvaLghujgRbRZRTrdoPwvgtU&opi=95576897&sa=U&ved=0ahUKEwjoqrK61IWHAxV_QlUIHdV8AewQ2ykIbQ&usg=AOvVaw3qPmp87jibXX5tvTaQuVKf",
"price_shipping": 0
}
]
},
"reviews": {
"rating": 4.7,
"top_review": {
"text": "I took a dive being unsure how useful a switch would be to me given I already play on ps5 and there's only so many times I thought I'd want to play games on the go. But being able to play bioshock for example on the go on a beautiful OLED screen really got my attention properly invested into the series again. The modular design to play how you want and with friends on the go really is so convenient as well. Ok it's underpowered and aging hardware but it's still impressive to me that essentially just a small tablet device can play games like bioshock and Alien isolation etc. I think there will always be a passion for fixed space dedicated hardware and PC gaming to push the boundaries on graphics but in terms of how mobile chipsets are becoming much more relevant for running more modern game engines now I think there will be a big crossover in future for people who want to play the latest games but aren't fussed about needing fixed hardware to support the latest graphics features etc. I hope nintendo's next console follows a similar vision. There is a negative with the screen however hence 4 stars. IT SCRATCHES REALLY EASILY! There is a plastic coating on the screen which is basically not removable that is there to protect the glass underneath from shattering. It's a nice feature but I think because of this plastic film it means the plastic film itself scratches really easily. So don't make the mistake I made and make sure you put your own screen protector on it. It's not like a top end smartphone screen that's really hard to scratch. 19\u00a0Less",
"title": "",
"author": "yvonne.r",
"rating": 5,
"source": "influenster.com"
},
"rating_stars": 4.5,
"reviews_count": 0,
"reviews_by_stars": {
"1": {
"url": "/shopping/product/5007040952399054528/reviews?uule=w+CAIQICINdW5pdGVkIHN0YXRlcw&gl=us&hl=en&prds=pid:13763880237627946848,rate:1,rnum:10,rsk:PC_12361402487756646367&sa=X&ved=0ahUKEwjoqrK61IWHAxV_QlUIHdV8AewQn08ITCgE",
"reviews_count": 1
},
"2": {
"url": "/shopping/product/5007040952399054528/reviews?uule=w+CAIQICINdW5pdGVkIHN0YXRlcw&gl=us&hl=en&prds=pid:13763880237627946848,rate:2,rnum:10,rsk:PC_12361402487756646367&sa=X&ved=0ahUKEwjoqrK61IWHAxV_QlUIHdV8AewQn08ISygD",
"reviews_count": 397
}
...
},
"search_suggestions": []
},
"highlights": [
"Video Up to 1080p via HDMI in TV mode",
"Up to 720p via built-in screen in tabletop mode and handheld mode",
"Audio Compatible with 5.1\" Linear PCM output",
"Output via HDMI connector in TV mode"
],
"description": "Choose this Nintendo Switch console to play favorite games anywhere with one system. It replaces both home and portable components for a seamless experience, docking with your television or standing alone on a tabletop for outdoor action on its 6.2-inch screen. This Nintendo Switch console includes the Joy-Con detachable controller and can link with other units for multiplayer adventures.",
"related_items": [
{
"items": [
{
"url": "/shopping/product/15004091033324648223?uule=w+CAIQICINdW5pdGVkIHN0YXRlcw&gl=us&hl=en&prds=epd:9143533438835195003,oid:9143533438835195003,pid:101830863606988935,rsk:PC_11357056235034102526&sa=X&ved=0ahUKEwjoqrK61IWHAxV_QlUIHdV8AewQrhIIgQE",
"image": "https://encrypted-tbn3.gstatic.com/shopping?q=tbn:ANd9GcR3UX58D2tiNUiwZBzIS0FFWhH2Pm7scnODYaWvE73-0n9sU5-KMjOfznrUpUdN0MJZWfpVcmpu&usqp=CAY",
"price": 75.99,
"title": "Nintendo Switch with Yellow and ...",
"rating": 4.5,
"currency": "USD",
"reviews_count": 19278
},
{...}
],
"title": "Related items"
}
],
"specifications": [
{
"items": [
{
"title": "Product Type",
"value": "Game console"
},
{
"title": "Media",
"value": "Flash memory card, Nintendo Switch Game Card"
},
{...}
],
"section_title": "General"
}
],
"parse_status_code": 12000
},
"created_at": "2024-07-01 10:44:15",
"updated_at": "2024-07-01 10:44:16",
"page": 1,
"url": "https://www.google.com/shopping/product/5007040952399054528?uule=w+CAIQICINdW5pdGVkIHN0YXRlcw&gl=us&hl=en",
"job_id": "7213492596180527105",
"status_code": 200,
"parser_type": ""
}
]
}
We use synchronous Realtime integration method in our examples. If you would like to use Proxy Endpoint or asynchronous Push-Pull integration, refer to the integration methods section.
Optionally, you can include additional parameters such as geo_location
, user_agent_type
, parse
, render
and more to customize your scraping request. Read more:
Last updated