Build a Scalable Product Data Pipeline with Google Shopping API
The Google Shopping API provides a reliable, structured source of product information, including listings, prices, and availability. However, its strict request quotas can limit scalability for data-intensive applications. To overcome these limitations, web scraping can complement API data, but it requires sophisticated proxy rotation and anti-detection strategies to avoid blocks and ensure compliance.
This guide will provide practical steps and code to get you started. Here's what to expect:
● Managing Google Shopping API quotas effectively to maximize data retrieval within limits.
● Using web scraping with proxy rotation to supplement API data and access additional sources.
● Architecting a hybrid system that combines both methods for seamless and comprehensive data gathering.

What Is Google Shopping API?
The Google Shopping API (part of Google's Content API for Shopping) allows developers to access structured product data directly from Google's ecosystem. It provides details like product titles, prices, availability, and merchant information in a consistent, machine-readable format. The API is well-documented and ideal for applications requiring reliable e-commerce data.
Managing Google Shopping API Quotas
Google enforces strict quotas on API usage as a measure to maintain fair access for all users and to prevent potential abuse of its services. These quotas primarily regulate the number of requests a user can make within a given time frame. For example, Google may limit the total number of daily requests to a certain threshold, such as 1,000 requests per day, while also imposing limits on the number of queries allowed per second (QPS), commonly set at around 5 QPS.
When users exceed these predefined limits, Google responds by returning HTTP 429 errors, which indicate "Too Many Requests." Such responses not only signal that the user has surpassed the quota but may also result in temporary restrictions on the user's account to mitigate any excessive or abusive behavior. These measures help ensure that the service remains reliable and accessible to all users.
Furthermore, the exact quotas applied can vary based on several factors. The type of user account, the usage tier subscribed to, and the evolving policies established by Google all influence the specific limits imposed. This variability allows Google to tailor quota restrictions in a way that aligns with the needs and privileges of different users, balancing resource availability and service quality across its platform.
Why Use Web Scraping When You Have an API?
Web scraping is sometimes necessary even if you have access to an API like the Google Shopping API. This is because the Google Shopping AP still has its limitations;
1. Limited Data Scope of APIs
APIs are designed to provide structured data, but often only cover a subset of information. For example:
● The Google Shopping API might give you basic product details like price, title, and availability.
● However, it may not include niche or specialized product information, such as detailed customer reviews, unique seller data, or metadata from third-party sellers.
● APIs may exclude data from competitor sites or smaller platforms that don't integrate with Google’s ecosystem, meaning you miss out on potentially valuable market insights.
2. Quota and Rate Limits
APIs almost always come with usage restrictions:
● Google Shopping API might limit the number of requests per day or per minute.
● If you want to collect data on thousands or millions of products or continuously monitor prices in real-time, these limits can be a big bottleneck.
● Quotas mean that large-scale or continuous data collection is costly or impossible through the API alone.
3. Lack of APIs for Certain Sources
● Many e-commerce sites do not offer public APIs at all, or their APIs are very restrictive.
● Competitor websites often don’t want you to access their data programmatically and thus don’t provide APIs.
● To get data from these sources, web scraping is the only viable option.
4. More Control and Flexibility
● Scraping lets you extract exactly the data you want, even if it’s buried in product descriptions, reviews, or dynamic content.
● APIs typically return predefined sets of fields, limiting customization.
● Scraping can also capture visual elements, page structure, or user-generated content that APIs don’t expose.
5. Comprehensive Market Analysis
● Combining API data with scraped data from other sites and sources gives you a richer and more complete dataset.
● This can improve competitive analysis, price monitoring, trend detection, and customer sentiment analysis.
While APIs are reliable and easier to use, their data limitations, usage quotas, and lack of access to all sources make web scraping a necessary complement when you want a full, up-to-date picture across multiple platforms and competitors.
Risks of Scraping
Web scraping still has its own challenges because many websites don’t want automated programs (scrapers) to take their data. So they use tricks like blocking your IP address, showing CAPTCHAs (those “prove you’re not a robot” tests), or tracking your browser to spot scrapers and stop them.
Scraping also may violate a website's terms of service, which means you could get in trouble legally or be banned from the site. So always review legal and ethical considerations before proceeding.
How to Combine API Access with Web Scraping Effectively

Why Combine Both?
● API access gives you reliable, structured data but has strict quotas.
● Scraping fills in gaps when API data is incomplete, or you need faster or broader coverage beyond quota limits.
When combining data collection methods such as APIs and web scraping, following best practices is essential to maximize efficiency, ensure data quality, and maintain legal and ethical standards. A strategic approach that leverages the strengths of both techniques can provide a more comprehensive and reliable dataset.
Firstly, the official API should be used as the primary data source whenever possible. APIs typically offer high-quality, structured data that is both reliable and stable. Because APIs are provided and maintained by the service owner, they ensure compliance with legal standards and help avoid potential violations. To optimize API usage, it is advisable to cache responses, thereby reducing redundant requests and staying within quota limits. This practice not only improves performance but also helps manage resource constraints imposed by API providers.
Secondly, web scraping should be employed as a supplementary tool. Scraping becomes particularly valuable when the API does not cover specific data points or product categories needed for analysis. It also proves useful for capturing real-time updates that exceed the API’s quota restrictions, or for gathering information from competitor sites and platforms that do not offer public APIs. By supplementing the API with scraping, one can fill in the gaps and build a richer, more comprehensive dataset.
A key component of this approach is smart request routing. This involves designing a system that prioritizes API requests and automatically switches to scraping only when the API quota is exhausted or when certain data is unavailable through the API. Implementing a fallback mechanism in the data collection code ensures seamless transitions between data sources, maintaining data flow without interruption or loss.
Moreover, it is critical to respect legal and ethical boundaries throughout the process. This includes carefully reviewing the terms of service for both APIs and the websites being scraped, and avoiding aggressive scraping practices that could harm website performance or violate laws. Ethical data collection safeguards the reputation of the user and minimizes risks associated with unauthorized data harvesting.
Finally, to unify the data collected from these disparate sources, data aggregation and normalization must be performed. Combining API and scraped data requires handling inconsistencies in format and update frequency. Normalizing this data into a consistent structure enables accurate analysis and decision-making, ensuring that the combined dataset is coherent and reliable.
In summary, the best practices for combining API and web scraping revolve around using the API as the foundational data source, supplementing with scraping when necessary, implementing smart request routing, adhering to legal and ethical standards, and unifying the collected data through normalization. This balanced strategy ensures effective, lawful, and comprehensive data collection.
Hybrid API + Scraping Workflow: Step-by-Step
1. Check API quota — if available, fetch data from API.
2. If API quota exceeded or data not available, trigger scraping with proxy support.
3. Store & merge both data sources into a central database.
4. Monitor usage and errors from both sources continuously.
Integrating Proxy Technology for Scraping
Proxies act as intermediaries between your scraper and target websites, routing requests through different IP addresses to:
● Prevent IP Bans: Distribute requests across multiple IPs to avoid rate limits.
● Mask Activity: Make scraping requests appear as regular user traffic.
● Enable Geo-Targeting: Access region-specific content by using IPs from specific locations.
Types of Proxies
| Proxy Type | Description | Pros | Cons |
| Residential Proxies | IPs assigned by ISPs to real devices | Hard to detect, high trust | Expensive, limited bandwidth |
| Datacenter Proxies | IPs from data centers, not tied to ISPs | Cheap, high speed | Easier to detect and block |
| Rotating Proxies | Automatically cycle IPs per request/session | Ideal for large-scale scraping | Higher cost, setup complexity |
| Static Proxies | Fixed IP proxies | Stable for consistent tasks | Easier to detect over time |
How To Use Proxy Rotation in Python
Prerequisites
Before starting, ensure you have:
● A Python environment (3.6+ recommended).
● The requests library (pip install requests).
● An OkeyProxy account with API access. Sign up to get your API key and proxy list.
● A target URL for scraping (use a test site like http://example.com for practice).
What Is OkeyProxy?
OkeyProxy is a leading proxy service provider offering residential and datacenter proxies optimized for web scraping. With a global network of high-quality IPs, OkeyProxy supports rotating and static proxy options, ensuring reliable access to data while minimizing detection risks. Its user-friendly dashboard and robust API make it easy to integrate into scraping workflows, offering scalable solutions for businesses and developers.
Enhance your scraping pipeline with reliable, high-speed proxies. Visit OkeyProxy to explore plans tailored to your needs.
Get started with OkeyProxy today.
Setting Up OkeyProxy
1. Create an OkeyProxy Account: Sign up for a plan (rotating residential proxies recommended for scraping).
2. Obtain Proxy Credentials: From the OkeyProxy dashboard, get your API key or proxy list (e.g., IP:port combinations or an API endpoint for rotating proxies).
3. Test Proxy Access: Ensure your proxies are working by sending a test request.
Proxy Rotation in Python with OkeyProxy
Below is a Python script demonstrating proxy rotation and user-agent switching using OkeyProxy. The script fetches a webpage, rotates through proxies, and handles errors.
python
import requests
import random
import time
# OkeyProxy configuration (replace with your actual proxy details)
proxies_list = [
'http://your-okeyproxy-ip1:port',
'http://your-okeyproxy-ip2:port',
'http://your-okeyproxy-ip3:port',
# Add more proxies from OkeyProxy dashboard
]
# Alternatively, use OkeyProxy's rotating proxy endpoint (if supported)
# proxies_list = ['http://your-okeyproxy-rotating-endpoint:port']
# List of user agents to mimic different browsers
user_agents = [
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36',
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.1 Safari/605.1.15',
'Mozilla/5.0 (X11; Linux x86_64; rv:89.0) Gecko/20100101 Firefox/89.0',
]
def get_proxy():
"""Select a random proxy from the OkeyProxy pool."""
return random.choice(proxies_list)
def get_user_agent():
"""Select a random user agent."""
return random.choice(user_agents)
def fetch_url(url, max_retries=3):
"""Fetch a URL using a random OkeyProxy proxy and user agent."""
for attempt in range(max_retries):
proxy = get_proxy()
user_agent = get_user_agent()
headers = {'User-Agent': user_agent}
proxies = {'http': proxy, 'https': proxy}
try:
response = requests.get(url, headers=headers, proxies=proxies, timeout=10)
response.raise_for_status()
print(f"Success with proxy: {proxy}")
return response.text
except requests.exceptions.RequestException as e:
print(f"Request failed with proxy {proxy}: {e}")
if attempt < max_retries - 1:
print(f"Retrying... ({attempt + 1}/{max_retries})")
time.sleep(random.uniform(1, 3)) # Random delay before retry
else:
print("Max retries reached. Skipping...")
return None
if __name__ == "__main__":
url = 'http://example.com' # Replace with your target URL
for _ in range(10):
data = fetch_url(url)
if data:
print("Data retrieved successfully!")
# Process data as needed (e.g., parse with BeautifulSoup)
time.sleep(random.uniform(1, 3)) # Random delay to mimic human behavior
Code Explanation
● Proxies List: Replace proxies_list with IPs from your OkeyProxy dashboard or use their rotating proxy endpoint for automatic IP cycling.
● User-Agent Rotation: The user_agents list mimics different browsers to reduce detection risks.
● Error Handling: The script retries failed requests up to max_retries times with exponential backoff (random delays between 1-3 seconds).
● Timeouts: A 10-second timeout prevents hanging on slow proxies.
● Random Delays: time.sleep(random.uniform(1, 3)) mimics human-like request patterns.
Best Practices for Proxy Rotation
● Use Residential Proxies: OkeyProxy’s residential proxies are less likely to be detected compared to datacenter proxies.
● Rotate Frequently: Use OkeyProxy’s rotating proxy API for automatic IP cycling per request or session.
● Monitor Proxy Performance: Track success/failure rates for each proxy and remove underperforming IPs from your pool.
● Respect Rate Limits: Adhere to the target website’s robots.txt and avoid excessive parallel requests.
● Combine with Headless Browsers: Use headless browsers (e.g., Selenium) or CAPTCHA-solving services for sites with advanced bot protection.
● Secure Credentials: Store OkeyProxy API keys and proxy details securely (e.g., in environment variables).
Troubleshooting Common Issues
1. HTTP 403/429 Errors
Indicates IP blocking or rate limiting. Increase proxy rotation frequency or switch to OkeyProxy’s residential proxies.
2. CAPTCHAs
Use CAPTCHA solvers (e.g., 2Captcha) or Selenium for headless browser automation.
3. Slow Responses
Test proxy latency in the OkeyProxy dashboard and prioritize faster IPs.
4. Authentication Errors
Verify your OkeyProxy credentials (username, password, or API key) are correctly configured.
FAQs
1. Why do my requests fail with OkeyProxy?
Ensure your proxy credentials are correct and IPs are active (check the OkeyProxy dashboard). Test with a simple curl command to isolate issues. If failures persist, switch to OkeyProxy’s residential proxies for higher success rates.
2. How many proxies do I need for scraping?
For small-scale scraping (<1,000 requests/day), 5-10 proxies are sufficient. For larger scales, use OkeyProxy’s rotating proxy API to access a larger IP pool dynamically.
3. Can I use OkeyProxy for geo-targeted scraping?
Yes, OkeyProxy supports geo-targeting. Specify the desired region in their dashboard or API to use IPs from specific countries.
4. How do I handle CAPTCHAs with OkeyProxy?
Use OkeyProxy’s residential proxies to minimize CAPTCHA triggers. For persistent CAPTCHAs, integrate a solving service like 2Captcha or adjust your user-agent rotation strategy.
5. What if my scraper is still detected?
Enhance anti-detection by combining OkeyProxy’s rotating proxies with headless browsers (e.g., Puppeteer) and randomized request intervals. Contact OkeyProxy support for tailored advice on your use case.
Conclusion
Building a scalable product data pipeline requires a strategic combination of Google Shopping API and web scraping. By effectively managing API quotas, supplementing with proxy-enabled scraping, you can gather comprehensive and reliable product data for e-commerce and price intelligence.
Tools like OkeyProxy enhance scraping reliability with robust proxy rotation, ensuring your pipeline remains efficient and undetected.
Explore OkeyProxy’s rotating residential proxy solutions to power your scraping needs.








