Shopping Product
The google_shopping_product
source is designed to retrieve Google Shopping product page for a specified product.
Request samples
In the code example below, we make a request to retrieve the product page for product ID 5007040952399054528
from Google Shopping on com
domain.
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
}
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.
Request parameter values
Generic
Basic setup and customization options for scraping Google Shopping product pages.
- mandatory parameter
Localization
Adapt results to specific geographical locations, domains, and languages.
Structured data
Below you can find a structured output example for google_shopping_product
.
Output data dictionary
HTML sample
JSON structure
The table below presents a detailed list of each product page element we parse, along with its description and data type. The table also includes some metadata.
In the following sections, parsed JSON code snippets are shortened where more than one item for the result type is available.
Pricing
An object containing pricing information for the product.
...
"pricing": {
"online": [
{
"price": 80,
"seller": "Nordstrom",
"details": "Free delivery by Thu, Jun 13Free lifetime returns",
"currency": "USD",
"condition": "New",
"price_tax": 8.2,
"price_total": 88.2,
"seller_link": "/url?q=https://www.nordstrom.com/s/adidas-kids-samba-sneaker-baby-walker-toddler-little-kid-big-kid/7430299%3Fcolor%3DCORE%2BBLACK%252F%2BFTWR%2BWHITE%252F%2BGUM5%26size%3Dbig%2Bkid-6%2Bm%26country%3DUS%26currency%3DUSD%26utm_source%3Dgoogle%26utm_medium%3Dorganic%26utm_campaign%3Dseo_shopping%26utm_channel%3Dlow_nd_seo_shopping%26srsltid%3DAfmBOorl2CxT1AHFBVXT4_CSjY0tpFIQ7WROdRquaI_AZSBRdZUpmEnOi-k&opi=95576897&sa=U&ved=0ahUKEwjG8LquqNOGAxXbDhAIHRQMB2AQ2ykIjAE&usg=AOvVaw1ZPuvWAp40Pbc3lhSjyTkh",
"price_shipping": 0
},
...
]
},
...
Reviews
An object containing reviews and ratings information for the product.
...
"reviews": {
"rating": 4.7,
"top_review": {
"text": "I first found out about this shoe a while back when it started trending online. I held off on buying a pair because I wanted to make sure it wasn't a \"come and go\" trend that I would get tired of after a few months. However, after holding off, I still found myself wanting to grab a pair. I first purchased it in the adult size off of the Adidas Website in a Women's 7, but it was way too big. Lengthwise, I'm a 6.5, but sometimes I have to size up because my feet are wide. So, when the original pair from the Adidas website came in and I realized how big they were on me, I figured I could size down and get a kids size that looks exactly the same for a cheaper price. That's exactly what I did. So, I ended up ordering a size 5 in kids and it fits perfectly! Lengthwise, I could probably also get a 4.5 in kids, but it probably wouldn't fit so well in width. The 5 gives enough room where it's roomy but not too big. Initially, the shoe is pretty narrow, but even with my wide feet and bunions, it fits really well after a few wears. I was able to pretty much break them in after 2-3 wears. Now, they fit great and they go with everything. It's such a classic, low-profile shoe that can be dressed up or down. I could definitely wear these shoes with jean shorts on the weekend but also pair them with a midi-skirt for work during the week (which is exactly what I did). I honestly can't wait to start pairing these with so many looks!\u00a0Less",
"title": "Classic Shoe",
"author": "Faith",
"rating": 5,
"source": "finishline.com"
},
"rating_stars": 4.5,
"reviews_count": 0,
"reviews_by_stars": {
"1": {
"url": "/shopping/product/9643822540334825608/reviews?uule=w+CAIQICINdW5pdGVkIHN0YXRlcw&gl=us&hl=en&prds=pid:10536581948450497165,rate:1,rnum:10,rsk:PC_10680952363545638615&sa=X&ved=0ahUKEwjG8LquqNOGAxXbDhAIHRQMB2AQn08IeSgE",
"reviews_count": 27
},
"2": {
"url": "/shopping/product/9643822540334825608/reviews?uule=w+CAIQICINdW5pdGVkIHN0YXRlcw&gl=us&hl=en&prds=pid:10536581948450497165,rate:2,rnum:10,rsk:PC_10680952363545638615&sa=X&ved=0ahUKEwjG8LquqNOGAxXbDhAIHRQMB2AQn08IeCgD",
"reviews_count": 3
},
"3": {
"url": "/shopping/product/9643822540334825608/reviews?uule=w+CAIQICINdW5pdGVkIHN0YXRlcw&gl=us&hl=en&prds=pid:10536581948450497165,rate:3,rnum:10,rsk:PC_10680952363545638615&sa=X&ved=0ahUKEwjG8LquqNOGAxXbDhAIHRQMB2AQn08IdygC",
"reviews_count": 13
},
"4": {
"url": "/shopping/product/9643822540334825608/reviews?uule=w+CAIQICINdW5pdGVkIHN0YXRlcw&gl=us&hl=en&prds=pid:10536581948450497165,rate:4,rnum:10,rsk:PC_10680952363545638615&sa=X&ved=0ahUKEwjG8LquqNOGAxXbDhAIHRQMB2AQn08IdigB",
"reviews_count": 51
},
"5": {
"url": "/shopping/product/9643822540334825608/reviews?uule=w+CAIQICINdW5pdGVkIHN0YXRlcw&gl=us&hl=en&prds=pid:10536581948450497165,rate:5,rnum:10,rsk:PC_10680952363545638615&sa=X&ved=0ahUKEwjG8LquqNOGAxXbDhAIHRQMB2AQn08IdSgA",
"reviews_count": 530
}
},
"search_suggestions": []
},
...
Variants
An array of objects containing variant options for the product.
...
"variants": [
{
"type": "Size",
"items": [
{
"value": "1",
"available": true,
"product_id": "14855470651354119759"
},
{
"value": "1\u00bd",
"available": true,
"product_id": "5671387020715674519"
},
{
"value": "2",
"available": true,
"product_id": "1029961476587819050"
},
...
],
...
Related Items
An array of objects containing related items for the product.
...
"related_items": [
{
"items": [
{
"url": "/shopping/product/16479871209744499300?uule=w+CAIQICINdW5pdGVkIHN0YXRlcw&gl=us&hl=en&prds=epd:10860789321621480519,oid:10860789321621480519,pid:6998593240514241486,prmr:1,rsk:PC_11355485667075104643&sa=X&ved=0ahUKEwjG8LquqNOGAxXbDhAIHRQMB2AQ2sgCCPEB",
"image": "https://encrypted-tbn1.gstatic.com/shopping?q=tbn:ANd9GcQpQuG5H0h5YM8gR0Hcw6c_RCpNdXX7h6TbSRn8oyEMDajHyn6btJ8NdvoaUQX0mHauB9Tyyam3D3j803Bn-kggu9FniPdP1252_ayDDp2CvshV91x7u9X7&usqp=CAY",
"price": 90,
"store": "adidas",
"currency": "USD",
"reviews_count": 0
},
...
],
"title": "You might also like"
}
],
...
Specifications
An array of objects containing specification details for the product.
...
"specifications": [
{
"items": [
{
"title": "Product Type",
"value": "Casual Shoes"
},
{
"title": "Color",
"value": "Black/White"
},
{
"title": "Shoe Size",
"value": "6"
}
],
"section_title": "General"
}
],
...
Last updated