mode=auto), Extract (extract=auto), proxy_country, css_extractor
Ask your AI agent
With the Zenrows MCP server connected to Claude, Cursor or any MCP client, paste this prompt. Your agent picks the right Zenrows tools and settings on its own.Get Google results as JSON
Build the Google URL with your query and its localization parameters, then send it withextract=auto. parsed comes back with one group per kind of result on the page, such as organic_results, related_questions and video_results.
*_results group instead of a fixed name. Results-page layouts vary from query to query, which is why this example skips extract_fields.
Example output
position follows the order of every block on the page, including the questions and videos between organic results, so sort by it to get the ranking. The second result above in full:
url is Google’s own redirect link, as it appears on the page. Prefix it with https://www.google.com to follow it, and read displayed_url or source_name for the destination site.
Localize results to a market
Two layers decide which results you get: the parameters in the Google URL, and where the request comes from. Set both to the same market.
For German results, set
hl=de and gl=de in the Google URL and send it with proxy_country=de.
Get Bing results with CSS selectors
For Bing, pick the fields withcss_extractor. Each organic result is an li.b_algo element, and its link is a Bing redirect that carries the destination URL in base64:
Python (Requests)
setlang and cc set Bing’s language and country. Pair them with a matching proxy_country.
Track many keywords
Rank tracking means the same query list every day. Put one search URL per keyword in a Batch job withzenrows_params set to {"mode": "auto", "proxy_country": "us", "extract": "auto"}, and give each task the keyword as its external_id. To run it daily on Zenrows’ side, see Run scraping jobs on a schedule.
Customize it
Troubleshooting
- Results are for the wrong country: the URL and the request location disagree. Set
glandproxy_countryto the same country. - A group your code expects is missing: Google shows different blocks for different queries. Loop over the
*_resultsgroups, as in the first example, instead of hard-coding one name. - Bing returns results for a shorter query: Bing rewrites some queries. Make the query more specific, or add
setlangandccto pin the market. - The request takes long to return: set your client timeout to 180 seconds or more, so
mode=autohas time to pick the configuration that works.
Related recipes
Build a research agent with live web data
Search, read the top results and cite sources.
Get structured JSON from any page
How extract=auto and prepared domains work.
Get content as seen from any country
Geotarget any request with proxy_country.
Detect changes on any page and get alerted
Alert when rankings or content change.