SerpBase
Back to Blog

Google Weather API: Get the Weather Card from Google Search as JSON

Google has no public weather API. A weather query returns the card from the results page as JSON: temperature, condition, rain, humidity and wind. Tested on three cities.

November 27, 2026
By SerpBase Team3 min read

Short answer: Google has no public weather API, but a weather query on /google/search returns the weather card from the results page as a weather object — location, temperature, condition, chance of precipitation, humidity and wind.

It is the current conditions as Google displays them, for one credit. It is not a forecast feed: no hourly rows, no ten-day outlook.

The request

curl -X POST 'https://api.serpbase.dev/google/search' \
  -H 'Content-Type: application/json' \
  -H 'X-API-Key: YOUR_API_KEY' \
  -d '{"q":"weather in london","gl":"us","hl":"en"}'

What comes back

We ran three searches on 27 November 2026.

weather in london, mobile (the default), gl=us.

"weather": {
  "location": "London, UK",
  "temperature": "34°",
  "condition": "Cloudy",
  "precipitation": "10%",
  "humidity": "87%",
  "wind": "6 mph",
  "position": 3
}

weather in new york, desktop, gl=us. location New York, NY, temperature 50°F, condition Light rain, precipitation 93%, humidity 91%, wind 24 mph.

wetter berlin, mobile, gl=de, hl=de. condition Stark bewölkt, temperature -2°, wind 8 km/h, precipitation 10%, humidity 87%.

Three things to read from that. The unit follows the country: Fahrenheit and mph with gl=us, Celsius and km/h with gl=de. The unit letter was printed only on desktop (50°F against 34°). And the condition text follows hl.

Python: current conditions for a list of cities

import re, time, requests

CITIES = ["london", "new york", "tokyo"]

for city in CITIES:
    r = requests.post(
        "https://api.serpbase.dev/google/search",
        headers={"X-API-Key": "YOUR_API_KEY"},
        json={"q": f"weather in {city}", "gl": "us", "hl": "en", "device": "desktop"},
        timeout=60,
    ).json()
    if r["status"] != 0:
        print(city, "failed:", r.get("error"))
        continue
    w = r.get("weather")
    if not w:
        print(city, "no weather card on this page")
        continue
    degrees = int(re.search(r"-?\d+", w["temperature"]).group())
    print(city, degrees, w["temperature"][-1], "|", w["condition"], "|",
          "rain", w["precipitation"], "| wind", w["wind"])
    time.sleep(1)

Things that trip people up

  • Every value is a string as displayed. "34°", "87%", "6 mph". Parse the number out, as the script does.
  • Fix gl and you fix the unit. gl=us gave Fahrenheit, gl=de gave Celsius. Without a unit letter on the mobile card, the country you sent is how you know which one it is.
  • Use desktop if you want the unit in the value. 50°F on desktop, 34° on mobile.
  • Keep your own city name. In the German test the card's location field came back as Wetter, not the city. Key your records on the city you asked for and treat location as a check when it is there.
  • Current conditions only. For forecasts or history use a weather data provider. This is for showing "what Google says it is like there now" or checking the card for a location page.
  • The card is left out when Google does not show one. Phrase the query as weather in <city> and use .get("weather").
  • position is where the card sits on the page among the other blocks, not a weather value.

Related endpoints

The same response includes organic results from the weather sites, and Google's other answer cards when they appear: stock quotes and the local pack among them.

Cost and limits

Each search costs 1 credit; failed requests are not charged. The response is always HTTP 200 with a status field: 0 means success, anything else comes with an error string. Credits cost $0.25–$0.50 per 1,000 depending on the plan, and new accounts get 500 free credits without a card.