Shopping Product
The google_shopping_product
source is designed to retrieve Google Shopping product page for a specified product.
Query parameters
Parameter | Description | Default Value |
---|---|---|
source | Data source. More info. |
|
| Domain localization | com |
query | UTF-encoded product code | - |
|
| - |
| Results language. List of supported Google languages can be found here. | - |
| The geographical location that the result should be adapted for. Using this parameter correctly is extremely important to get the right data. For more information, read about our suggested | - |
| Device type and browser. The full list can be found here. |
|
| Enables JavaScript rendering. More info. | |
| URL to your callback endpoint. More info. | - |
|
| - |
- required parameter
Code examples
In the code example below, we make a request to retrieve the product page for product ID 5007040952399054528
from Google Shopping on com
domain.
{
"source": "google_shopping_product",
"domain": "com",
"query": "5007040952399054528",
"parse": true
}
curl --user "user:pass1" 'https://realtime.oxylabs.io/v1/queries' -H "Content-Type: application/json" \
-d '{"source": "google_shopping_product", "domain": "com", "query": "5007040952399054528"}'
import requests
from pprint import pprint
# Structure payload.
payload = {
'source': 'google_shopping_product',
'domain': 'com',
'query': '5007040952399054528',
}
# Get response.
response = requests.request(
'POST',
'https://realtime.oxylabs.io/v1/queries',
auth=('user', 'pass1'),
json=payload,
)
# Print prettified response to stdout.
pprint(response.json())
<?php
$params = array(
'source' => 'google_shopping_product',
'domain' => 'com',
'query' => '5007040952399054528',
);
$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, "user" . ":" . "pass1");
$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);
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 = "YOUR_USERNAME";
const string Password = "YOUR_PASSWORD";
var parameters = new Dictionary<string, string>()
{
{ "source", "google_shopping_product" },
{ "domain", "com" },
{ "query", "5007040952399054528" },
};
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 main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
)
func main() {
const Username = "YOUR_USERNAME"
const Password = "YOUR_PASSWORD"
payload := map[string]string{
"source": "google_shopping_product",
"domain": "com",
"query": "5007040952399054528",
}
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))
}
package org.example;
import okhttp3.*;
import org.json.JSONObject;
public class Main implements Runnable {
private static final String AUTHORIZATION_HEADER = "Authorization";
public static final String USERNAME = "YOUR_USERNAME";
public static final String PASSWORD = "YOUR_PASSWORD";
public void run() {
JSONObject jsonObject = new JSONObject();
jsonObject.put("source", "google_shopping_product");
jsonObject.put("domain", "com");
jsonObject.put("query", "5007040952399054528");
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)
.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()) {
assert response.body() != null;
System.out.println(response.body().string());
} catch (Exception exception) {
System.out.println("Error: " + exception.getMessage());
}
System.exit(0);
}
public static void main(String[] args) {
new Thread(new Main()).start();
}
}
import fetch from 'node-fetch';
const username = 'YOUR_USERNAME';
const password = 'YOUR_PASSWORD';
const body = {
'source': 'google_shopping_product',
'domain': 'com',
'query': '5007040952399054528'
};
const response = await fetch('https://realtime.oxylabs.io/v1/queries', {
method: 'post',
body: JSON.stringify(body),
headers: {
'Content-Type': 'application/json',
'Authorization': 'Basic ' + Buffer.from(`${username}:${password}`).toString('base64'),
}
});
console.log(await response.json());
https://realtime.oxylabs.io/v1/queries?source=google_shopping_product&domain=com&query=5007040952399054528&pages=4&access_token=12345abcde
The example above uses the Realtime integration method. If you would like to use some other integration method in your query (e.g. Push-Pull or Proxy Endpoint), refer to the integration methods section.
Output example
Below you can find a structured output example for google_shopping_product
.
google_shopping_product
structured output
{
"results": [
{
"content": {
"url": "https://www.google.com/shopping/product/6151552437452191901?uule=w+CAIQICINdW5pdGVkIHN0YXRlcw&gl=us&hl=en",
"title": "Mikasa BQ1100 Basketball Official",
"images": {
"full_size": [
"https://encrypted-tbn1.gstatic.com/shopping?q=tbn:ANd9GcTsMDYMSlrlrjER-H5xHwOGmDKijWJgYtrMu-POv3JuKSBtXkuwqCc-NJqXy76VZb-JeUGNMHgWpmq25Rgh0yV-J1t6lj73&usqp=CAY"
],
"thumbnails": []
},
"variants": [
{
"type": "Size",
"items": [
{
"value": "Size 6",
"available": true,
"product_id": "12907455603058442785"
},
{
"value": "Size 7",
"selected": true,
"available": true,
"product_id": "6151552437452191901"
}
]
}
],
"highlights": [
"Size 7",
"Competition game ball",
"Cordley composite cover",
"Wide channel",
"Designed for indoor use"
],
"description": "Level up your game now with the Indoor Basketball by Mikasa Sports, Size 7 - Championship Series, Competition! This competition game ball is made of specially compounded rubber material and special chemical composite to prevent layers from peeling. This ball's improved thin film coat leaves the feeling of natural leather and its premium micro-fiber composite cover prevents that score from slipping off your hands. The high air retention capability and adequate rebound longevity are achieved with its intelligent construction. Designed for indoor use, it also boasts air cushions to deliver soft and strong grip. With the well-balanced ball construction, you can definitely achieve total balance and control. Durable construction. Powerful grip. Gentle touch. Play your best today and grab the Indoor Basketball by Mikasa Sports, Size 7 - Championship Series, Competition!",
"related_items": [
{
"items": [
{
"url": "/shopping/product/5688753286764228258?uule=w+CAIQICINdW5pdGVkIHN0YXRlcw&gl=us&hl=en&prds=epd:15499756951361495493,oid:15499756951361495493,rsk:PC_17845703503359704742&sa=X&ved=0ahUKEwjfrvHw69H3AhXahP0HHdo0B3EQrhIIcg",
"price": 9.99,
"title": "Tarmak Men's R100, Basketball ...",
"rating": 4.5,
"currency": "USD",
"reviews_count": 2456
},
{
"url": "/shopping/product/15189183023795546276?uule=w+CAIQICINdW5pdGVkIHN0YXRlcw&gl=us&hl=en&prds=epd:4014245109382337527,oid:4014245109382337527,rsk:PC_3715543414279635088&sa=X&ved=0ahUKEwjfrvHw69H3AhXahP0HHdo0B3EQrhIIdg",
"price": 109.95,
"title": "Wilson NCAA Evo NXT Game Basketball",
"rating": 4,
"currency": "USD",
"reviews_count": 37
},
{
"url": "/shopping/product/3825593705175985494?uule=w+CAIQICINdW5pdGVkIHN0YXRlcw&gl=us&hl=en&prds=epd:16684023295127281670,oid:16684023295127281670,rsk:PC_1542493126743285368&sa=X&ved=0ahUKEwjfrvHw69H3AhXahP0HHdo0B3EQrhIIeg",
"price": 69.99,
"title": "Wilson Evolution Indoor Game ...",
"rating": 4.5,
"currency": "USD",
"reviews_count": 1092
},
{
"url": "/shopping/product/15812215176313496524?uule=w+CAIQICINdW5pdGVkIHN0YXRlcw&gl=us&hl=en&prds=epd:14675350186308772261,oid:14675350186308772261,rsk:PC_10888770517254528336&sa=X&ved=0ahUKEwjfrvHw69H3AhXahP0HHdo0B3EQrhIIfg",
"price": 73.5,
"title": "Spalding Legacy Tf-1000 Indoor ...",
"rating": 4.5,
"currency": "USD",
"reviews_count": 1925
},
{
"url": "/shopping/product/18240249874593330291?uule=w+CAIQICINdW5pdGVkIHN0YXRlcw&gl=us&hl=en&prds=epd:16235714908843469361,oid:16235714908843469361,rsk:PC_5742794121566194630&sa=X&ved=0ahUKEwjfrvHw69H3AhXahP0HHdo0B3EQrhIIggE",
"price": 19.99,
"title": "Decathlon BT100, Basketball ...",
"rating": 4.5,
"currency": "USD",
"reviews_count": 944
},
{
"url": "/shopping/product/1205956411867188246?uule=w+CAIQICINdW5pdGVkIHN0YXRlcw&gl=us&hl=en&prds=epd:12964647013116253886,oid:12964647013116253886,rsk:PC_15465944636107685133&sa=X&ved=0ahUKEwjfrvHw69H3AhXahP0HHdo0B3EQrhIIhgE",
"price": 99.95,
"title": "Baden BX7E-02D-F Perfection ...",
"rating": 4.5,
"currency": "USD",
"reviews_count": 84
},
{
"url": "/shopping/product/6423717504455742896?uule=w+CAIQICINdW5pdGVkIHN0YXRlcw&gl=us&hl=en&prds=epd:13895992678702929490,oid:13895992678702929490,rsk:PC_11849333091184670147&sa=X&ved=0ahUKEwjfrvHw69H3AhXahP0HHdo0B3EQrhIIigE",
"price": 9.05,
"title": "MacGregor Rubber Basketball ...",
"rating": 3.5,
"currency": "USD",
"reviews_count": 344
},
{
"url": "/shopping/product/4729530520874750781?uule=w+CAIQICINdW5pdGVkIHN0YXRlcw&gl=us&hl=en&prds=epd:11220969377284956555,oid:11220969377284956555,rsk:PC_11782026418948764459&sa=X&ved=0ahUKEwjfrvHw69H3AhXahP0HHdo0B3EQrhIIjgE",
"price": 15.99,
"title": "Wilson NBA Drv Basketball",
"rating": 4.5,
"currency": "USD",
"reviews_count": 316
},
{
"url": "/shopping/product/8430257643588471460?uule=w+CAIQICINdW5pdGVkIHN0YXRlcw&gl=us&hl=en&prds=epd:16813126910794842539,oid:16813126910794842539&sa=X&ved=0ahUKEwjfrvHw69H3AhXahP0HHdo0B3EQrhIIkgE",
"price": 74.99,
"title": "Wilson NCAA Official Game ...",
"currency": "USD",
"reviews_count": 0
},
{
"url": "/shopping/product/1578440537330764690?uule=w+CAIQICINdW5pdGVkIHN0YXRlcw&gl=us&hl=en&prds=epd:95398887148698003,oid:95398887148698003,rsk:PC_10768082336510151813&sa=X&ved=0ahUKEwjfrvHw69H3AhXahP0HHdo0B3EQrhIIlQE",
"price": 20,
"title": "Nike Dominate Basketball Size 7 ...",
"rating": 4.5,
"currency": "USD",
"reviews_count": 511
}
],
"title": "Related items"
}
],
"specifications": [
{
"items": [
{
"title": "Dimensions (Overall)",
"value": "9 inches (H) x 9 inches (D)"
},
{
"title": "Shell Material",
"value": "Composite"
},
{
"title": "Ball Diameter",
"value": "9 inches"
},
{
"title": "Package Quantity",
"value": "1"
},
{
"title": "Battery",
"value": "No Battery Used"
}
],
"section_title": "Details"
}
],
"parse_status_code": 12000
},
"created_at": "2022-05-09 06:58:59",
"updated_at": "2022-05-09 06:59:06",
"page": 1,
"url": "https://www.google.com/shopping/product/6151552437452191901?uule=w+CAIQICINdW5pdGVkIHN0YXRlcw&gl=us&hl=en",
"job_id": "6929323821178579969",
"status_code": 200,
"parser_type": ""
}
]
}
Last updated