Recipe: Current Conditions
This recipe shows how to retrieve live weather data — temperature, weather phrase, precipitation status, and more — for a specific location.
These recipes are teaching examples — not production code.
- Host: examples use the development host apidev.accuweather.com. Switch to api.accuweather.com for production.
- Production hardening: GZIP compression, caching, retries with exponential backoff, and error handling are not included. See the Best Practices guide.
Scenario
"I want to show users the current temperature and weather description for their city right now."
You'll need a LocationKey before starting. If you don't have one, follow the Location Search recipe first.
For this example we use LocationKey 349727 (New York City).
Call the Current Conditions endpoint with your LocationKey.
Endpoint:
Code
Extended details
Add details=true to receive an expanded set of fields including humidity, wind, UV index, ceiling, and more.
Additional fields returned with details=true:
Code
Key response fields
| Field | Type | Description |
|---|---|---|
WeatherText | String | Plain-language current conditions (e.g., "Partly cloudy") |
WeatherIcon | Integer | Icon code (1–44); maps to AccuWeather icon set |
HasPrecipitation | Boolean | Whether precipitation is currently falling |
PrecipitationType | String | null | "Rain", "Snow", "Ice", "Mixed", or null |
IsDayTime | Boolean | Whether it is currently daytime at the location |
Temperature.Metric.Value | Number | Current temperature in Celsius |
Temperature.Imperial.Value | Number | Current temperature in Fahrenheit |
LocalObservationDateTime | String | ISO 8601 timestamp of the observation |
EpochTime | Integer | Unix epoch timestamp of the observation |
Get historical current conditions
The API also supports the past 6 hours and past 24 hours of observations:
Code
Each returns an array of up to 6 (or 24) observation snapshots in reverse chronological order.
Complete code sample
Copy a full, runnable example that fetches current conditions and prints a summary.
Next steps
- Hourly Forecast — plan ahead with hour-by-hour data
- 5-Day Daily Forecast — multi-day high/low summaries