The google_shopping source is designed to retrieve content from various Google Shopping URLs. Instead of sending multiple parameters and letting us form and scrape Google Shopping URLs, you can provide us with a URL to the required Google Shopping page. We do not strip any parameters or alter your URLs in any other way.
This data source also supports parsed data (structured data in JSON format), as long as the URL submitted links to a page that we can parse.
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 geo_location parameter structures here.
-
parse
true will return parsed data, as long as the URL submitted is for Google Search.
-
- required parameter
Code examples
In this example, we send a request with the specified URL to retrieve search results from Google Shopping for the keyword adidas. The search results are retrieved as if the search was conducted in New York, USA, as indicated by the geo_location parameter.
import requestsfrom pprint import pprint# Structure payload.payload ={'source':'google_shopping','url':'https://www.google.com/search?tbm=shop&q=adidas&hl=en','geo_location':'New York,New York,United States'}# Get response.response = requests.request('POST','https://realtime.oxylabs.io/v1/queries', auth=('user', 'pass1'), json=payload,)# Instead of response with job status and results url, this will return the# JSON response with results.pprint(response.json())
# Parameters have to be encoded to escape special characters:# URL: https://www.google.com/search?tbm=shop&q=adidas&hl=en# geo_location: New York,New York,United States# Encoded URL: https%3A%2F%2Fwww.google.com%2Fsearch%3Ftbm%3Dshop%26q%3Dadidas%26hl%3Den# Encoded geo_location: New%20York%2CNew%20York%2CUnited%20Stateshttps://realtime.oxylabs.io/v1/queries?source=google_shopping&url=https%3A%2F%2Fwww.google.com%2Fsearch%3Ftbm%3Dshop%26q%3Dadidas%26hl%3Den&geo_location=New%20York%2CNew%20York%2CUnited%20States&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.