Location Identifiers

GET https://api.weatherstack.com/current?query=40.7831,-73.9712

Aside from simply passing the name of a city, there are multiple other ways of passing a location to the API:

DefinitionExampleDescription
Location Namequery = New YorkThe standard way of passing a location name to the API.
UK/Canada/US ZIP Codequery = 99501Pass a UK/Canada/US ZIP code to the API and auto-detect the associated location.
Coordinates (Lat/Lon)query = 40.7831,-73.9712Pass latitude and longitude coordinates to the API and auto-detect the associated location.
IP Addressquery = 153.65.8.20Pass an IP address to the API and auto-detect the associated location.
IP Address (Auto-Fetch)query = fetch:ipPass fetch:ip to the API in order to auto-detect the requester IP address and location.

Request Params

KeyDatatypeRequiredDescription
querystringPass latitude and longitude coordinates to the API and auto-detect the associated location.

RESPONSES

status: OK

{"request":{"type":"LatLon","query":"Lat 40.78 and Lon -73.97","language":"en","unit":"m"},"location":{"name":"Guttenberg","country":"United States of America","region":"New Jersey","lat":"40.792","lon":"-74.004","timezone_id":"America/New_York","localtime":"2024-03-18 08:59","localtime_epoch":1710752340,"utc_offset":"-4.0"},"current":{"observation_time":"12:59 PM","temperature":6,"weather_code":113,"weather_icons":["https://cdn.worldweatheronline.com/images/wsymbols01_png_64/wsymbol_0001_sunny.png"],"weather_descriptions":["Sunny"],"wind_speed":4,"wind_degree":297,"wind_dir":"WNW","pressure":1008,"precip":0,"humidity":45,"cloudcover":0,"feelslike":3,"uv_index":2,"visibility":16,"is_day":"yes"}}