How to Switch to the Scraper APIs?
The ZenRows® Scraper APIs provide a more efficient and specialized way to extract structured data from popular websites. If you’re currently using the Universal Scraper API, switching to the Scraper APIs can simplify your setup, ensure predictable pricing, and improve performance. This guide walks you through the transition process for a seamless upgrade to the Scraper APIs.
Why Switch to the Scraper APIs
The Scraper APIs are designed to streamline web scraping by offering dedicated endpoints for specific use cases. Unlike the Universal Scraper API, which requires custom configurations for proxies, JavaScript rendering, and anti-bot measures, the Scraper APIs handle these complexities for you. Key benefits include:
-
Predictable Pricing: Scraper APIs offer a competitive fixed price per successful request, ensuring clear and consistent cost management for your scraping needs.
-
No Setup, Parsing, or Maintenance Required: With the Scraper APIs, simply select the API use case, and we handle all the anti-bot configuration. This means you can focus on extracting valuable data while we ensure the API responses are structured and reliable. Enjoy high success rates and continuous data streams with no maintenance on your end.
How the Scraper APIs Work
The core of the ZenRows API is the API Endpoint, which is structured based on the industry, target website, type of request, and query parameters. This modular approach allows you to extract data efficiently from various sources.
Each part of the URL serves a specific purpose:
<INDUSTRY>
The industry category (e.g., ecommerce, realestate, serp).<WEBSITE>
The target website (e.g., amazon, idealista, google).<TYPE_OF_REQUEST>
The type of data you want (e.g., products, reviews, search).<QUERY_ID_URL>
The unique identifier for the request, such as a product ID, property ID, or query.<YOUR_ZENROWS_API_KEY>
Your personal API key for authentication and access.
Here’s an example for Amazon Product Information API:
Breaking it down:
- Industry:
ecommerce
- Website:
amazon
- Type of Request:
products
- Query ID:
{asin}
(Amazon Standard Identification Number, used for product lookup)
Customization with Additional Parameters
Depending on the website, you may include extra parameters to refine your request:
.tld
Specify the top-level domain (e.g.,.com
,.co.uk
,.de
).country
Set the country code to retrieve localized data.filters
Apply filters to extract specific data.
How to Transition from the Universal Scraper API
Switching to the Scraper APIs requires minimal code changes. Below is an example of how to transition from the Universal Scraper API to a dedicated Scraper API.
Old Code Using Universal Scraper API:
New Code Using a Dedicated Scraper API:
Steps to Switch:
Update the API Endpoint
Replace the existing Universal Scraper API endpoint with the dedicated endpoint for Amazon products. The new endpoint follows this format:
Where {asin}
is the unique Amazon product identifier.
Simplify the Parameters
The Scraper APIs are optimized to handle common scraping tasks, such as JS rendering and proxy management, without needing to specify additional parameters like js_render
or premium_proxy
. Simply pass the apikey
and any other relevant parameters (such as country
or tld
) and you’re good to go.
Test the New API Call
Once you’ve made the necessary changes to your code, run it to test the new API call. The response will be structured data tailored to your scraping use case, such as product name, price, and description.
Need Help?
If you have any questions or face issues during the transition, our support team is here to assist you. Switching to the new Scraper APIs is straightforward, offering optimized performance, predictable pricing, and less maintenance. We’re constantly expanding our API catalog and prioritizing new features based on your feedback, so enjoy a more reliable scraping experience today!
Was this page helpful?