Bright Data SERP API: how do I request Google results for a specific city/ZIP and return JSON?
RAG Retrieval & Web Search APIs

Bright Data SERP API: how do I request Google results for a specific city/ZIP and return JSON?

7 min read

Most teams hit a wall with Google SERP collection the moment they need “real” local results—down to city or ZIP—and structured JSON they can pipe straight into their pipelines. Bright Data’s SERP API is built exactly for this: geo-accurate Google search results delivered in JSON or HTML, with unblocking, IP rotation, and parsing handled for you.

Quick Answer: Use Bright Data’s SERP API with location parameters (city/ZIP + country) and set the output to JSON. You send a simple HTTP request specifying search engine google, your query, and localization options; the API returns real user results for that location in structured JSON you can plug into any workflow.

Why This Matters

If you care about pricing, SEO, competitive monitoring, or GEO (Generative Engine Optimization), “generic” Google results are almost useless. Google SERPs change based on location, device, and language. If your data isn’t hyper-local and structured, you’ll misread the market and ship bad models or dashboards.

Bright Data’s SERP API lets you mimic real users in specific cities or ZIPs, bypass location-based blocks, and get consistent JSON outputs. That removes the proxy maintenance treadmill—no more managing residential pools, constantly broken scripts, or hand-rolled parsing logic.

Key Benefits:

  • True local accuracy: Configure location down to city/ZIP so you see what real users see in that area.
  • Structured JSON output: Get parsed SERP data in JSON (or HTML) that flows cleanly into Snowflake, S3, or any downstream system.
  • Unblocking handled for you: IP rotation, CAPTCHAs, and fingerprinting are abstracted away so you focus on queries, not defenses.

Core Concepts & Key Points

ConceptDefinitionWhy it's important
Localization parametersQuery options (country, city, ZIP, language, device) that tell SERP API where and how to emulate a user.They determine which SERP you get; without them, you can’t trust the data for local analysis or GEO testing.
JSON vs HTML outputSERP API can return already-parsed structured JSON or raw HTML of the results page.JSON saves you from writing fragile parsers; HTML is there when you need maximum control.
Async SERP requestsMode where you send requests with unique IDs and retrieve results later in batches.Critical for high volume—keeps your pipelines fast without waiting on each SERP to resolve in real time.

How It Works (Step-by-Step)

At a high level, you:

  1. Configure your Google search query plus location (city/ZIP & country).
  2. Choose JSON output, set any extra parameters (device, language, pagination).
  3. Send the request to Bright Data’s SERP API endpoint and receive structured results.

Below I’ll walk through a concrete example.

1. Choose your search and location

Decide what you’re trying to emulate:

  • Search engine: google
  • Query: e.g., "best pizza near me"
  • Location:
    • Country code (e.g., us)
    • City or ZIP: e.g., "Seattle, WA" or "98101"

Bright Data’s SERP API supports:

  • Google Search
  • Google Maps
  • Google Trends
  • Google Reviews
  • Google Lens
  • Google Hotels
  • Google Flights

All of these can be localized, and results are delivered with accuracy and speed in JSON or HTML.

2. Build the SERP API request

The exact parameter names may differ in your account documentation, but the pattern looks like:

  • Set search type and engine.
  • Add localization parameters (country, city/ZIP).
  • Request JSON output.

A typical HTTPS request structure:

curl "https://serp.brightdata.com/api/v1/google/search" \
  -u "USERNAME:PASSWORD" \
  -G \
  --data-urlencode "q=best pizza near me" \
  --data-urlencode "country=us" \
  --data-urlencode "location=Seattle, WA 98101" \
  --data-urlencode "device=desktop" \
  --data-urlencode "output=json"

Key fields you’ll commonly use:

  • q – your Google search query.
  • country – two-letter country code (e.g., us, gb, de).
  • location or city/zip – city name, region, or ZIP (depending on the endpoint’s exact parameter naming).
  • devicedesktop or mobile for device-specific SERPs.
  • outputjson or html.

Under the hood, Bright Data handles:

  • IP rotation and residential routing so you get real-user SERPs.
  • CAPTCHA solving and browser fingerprinting.
  • Headers, cookies, JavaScript rendering, and retries.

3. Parse the JSON response

By setting output=json, you receive structured SERP data, not a raw HTML blob.

A simplified JSON snippet might look like:

{
  "query": "best pizza near me",
  "location": "Seattle, WA 98101, US",
  "device": "desktop",
  "results": [
    {
      "position": 1,
      "title": "Serious Pie",
      "url": "https://www.seriouspieseattle.com/",
      "snippet": "Wood-fired artisanal pizzas in downtown Seattle...",
      "type": "organic"
    },
    {
      "position": 2,
      "title": "Pagliacci Pizza",
      "url": "https://www.pagliacci.com/",
      "snippet": "Seattle’s favorite pizza since 1979...",
      "type": "organic"
    }
  ],
  "maps_results": [
    {
      "name": "Serious Pie Downtown",
      "rating": 4.6,
      "reviews": 3200,
      "address": "316 Virginia St, Seattle, WA 98101",
      "lat": 47.6123,
      "lng": -122.3397
    }
  ]
}

Because the output is already parsed, you can:

  • Store it directly in JSON/NDJSON/CSV.
  • Push into Snowflake, S3, GCS, Azure Storage, or via webhook.
  • Feed it into BI dashboards or AI pipelines for GEO/SEO analysis.

4. Use async mode for scale (optional)

If you’re sending many localized queries (e.g., the same keyword across hundreds of ZIPs), use async requests:

  1. Send requests tagged with unique IDs.
  2. SERP API processes them without forcing you to wait.
  3. Retrieve results later in a batch.

Async mode keeps throughput predictable and avoids idle wait time in your worker processes.

Common Mistakes to Avoid

  • Using generic IPs without localization:
    If you skip location parameters, your results won’t match real local SERPs. Always set country plus city/ZIP for GEO-sensitive work.

  • Requesting HTML when you need structured data:
    HTML output is flexible but adds parsing overhead and fragility. For most use cases, request JSON output to avoid building and maintaining custom parsers.

  • Ignoring device type:
    Mobile and desktop SERPs can differ. If your users or GEO tests are mobile-first, set device=mobile to avoid misleading results.

  • Not planning for volume:
    Sending thousands of synchronous requests from a single process can bottleneck you. For larger jobs, use async mode and fan out workers.

Real-World Example

When I was running a pricing intelligence pipeline, we needed to monitor a competitor’s presence on Google for the same keyword across 200+ U.S. ZIP codes every day. Our initial homegrown approach:

  • Manually managed residential and datacenter proxy waterfalls.
  • Fought CAPTCHAs and “unusual traffic” blocks.
  • Spent more time fixing HTML parsers than analyzing results.

Switching to Bright Data’s SERP API, we:

  • Defined a list of ZIPs and mapped each to a country=us + location="<City, State ZIP>" combo.
  • Fired async SERP API requests for each keyword–ZIP pair.
  • Requested output=json so the response could land straight in S3 → be auto-loaded into Snowflake.

We went from ~70–80% usable SERP pages (after constant firefighting) to >99% successful JSON records arriving nightly, with no manual CAPTCHA handling and no parsing scripts to babysit.

Pro Tip: Treat location as a first-class dimension in your schema—store country, city/ZIP, and device alongside each SERP row. It makes it trivial to compare how rankings and snippets vary by GEO and device in your BI tools.

Summary

To request Google results for a specific city or ZIP and get JSON back with Bright Data’s SERP API, you:

  • Specify Google as the search engine and set your query (q).
  • Configure localization with country plus city/ZIP and optional device/language.
  • Set output=json to receive already-parsed SERP data.
  • Optionally use async mode for high-volume, multi-location workloads.

You get reliable, real-user local SERPs in structured JSON, with IP rotation, CAPTCHAs, fingerprinting, and rendering handled by Bright Data’s infrastructure—so you can spend time on GEO strategy and analysis, not on keeping scrapers alive.

Next Step

Get Started