### One Call API 3.0 Example Call Source: https://openweathermap.org/api/one-call-3?collection=one_call_api_3.0 This snippet shows an example of how to call the One Call API 3.0 to get weather data for a specific location. Remember to replace `{API key}` with your actual API key. ```APIDOC ## GET /data/3.0/onecall ### Description Retrieves current and forecasted weather data for a specified geographic location. ### Method GET ### Endpoint https://api.openweathermap.org/data/3.0/onecall ### Parameters #### Query Parameters - **lat** (float) - Required - Latitude of the location. - **lon** (float) - Required - Longitude of the location. - **appid** (string) - Required - Your unique API key. ### Request Example ``` https://api.openweathermap.org/data/3.0/onecall?lat=33.44&lon=-94.04&appid={API key} ``` ### Response #### Success Response (200) - **lat** (float) - Latitude of the location. - **lon** (float) - Longitude of the location. - **timezone** (string) - Timezone name for the requested location. - **timezone_offset** (integer) - Shift in seconds from UTC. - **current** (object) - Current weather data. - **dt** (integer) - Current time, Unix, UTC. - **sunrise** (integer) - Sunrise time, Unix, UTC. - **sunset** (integer) - Sunset time, Unix, UTC. - **temp** (float) - Temperature. - **feels_like** (float) - Perceived temperature. - **pressure** (integer) - Atmospheric pressure on the sea level, hPa. - **humidity** (integer) - Humidity, %. - **dew_point** (float) - Dew point temperature. - **clouds** (integer) - Cloudiness, %. - **uvi** (float) - Current UV index. - **visibility** (integer) - Average visibility, metres. - **wind_speed** (float) - Wind speed. - **wind_gust** (float, optional) - Wind gust. - **wind_deg** (integer) - Wind direction, degrees. - **rain** (object, optional) - **1h** (float) - Precipitation volume for the last hour, mm/h. - **snow** (object, optional) - **1h** (float) - Snowfall volume for the last hour, mm/h. - **weather** (array) - Weather conditions. - **id** (integer) - Weather condition id. - **main** (string) - Group of weather parameters. - **description** (string) - Weather condition description. - **icon** (string) - Weather icon id. - **minutely** (array) - Minute forecast weather data. - **dt** (integer) - Time of the forecasted data, unix, UTC. - **precipitation** (float) - Precipitation, mm/h. - **hourly** (array) - Hourly forecast weather data. - **dt** (integer) - Time of the forecasted data, Unix, UTC. - **temp** (float) - Temperature. - **feels_like** (float) - Perceived temperature. - **pressure** (integer) - Atmospheric pressure on the sea level, hPa. - **humidity** (integer) - Humidity, %. - **dew_point** (float) - Dew point temperature. - **uvi** (float) - UV index. - **clouds** (integer) - Cloudiness, %. - **visibility** (integer) - Average visibility, metres. - **wind_speed** (float) - Wind speed. - **wind_gust** (float, optional) - Wind gust. - **wind_deg** (integer) - Wind direction, degrees. - **pop** (float) - Probability of precipitation. - **rain** (object, optional) - **1h** (float) - Precipitation volume for the last hour, mm/h. - **snow** (object, optional) - **1h** (float) - Snowfall volume for the last hour, mm/h. - **weather** (array) - Weather conditions. - **id** (integer) - Weather condition id. - **main** (string) - Group of weather parameters. - **description** (string) - Weather condition description. - **icon** (string) - Weather icon id. ### Response Example ```json { "lat": 33.44, "lon": -94.04, "timezone": "America/Chicago", "timezone_offset": -18000, "current": { "dt": 1694913000, "sunrise": 1694899000, "sunset": 1694943000, "temp": 298.15, "feels_like": 299.0, "pressure": 1012, "humidity": 70, "dew_point": 290.0, "clouds": 50, "uvi": 5.0, "visibility": 10000, "wind_speed": 5.0, "wind_deg": 180, "weather": [ { "id": 802, "main": "Clouds", "description": "scattered clouds", "icon": "03d" } ] }, "minutely": [ { "dt": 1694913000, "precipitation": 0.0 } ], "hourly": [ { "dt": 1694913000, "temp": 298.15, "feels_like": 299.0, "pressure": 1012, "humidity": 70, "dew_point": 290.0, "uvi": 5.0, "clouds": 50, "visibility": 10000, "wind_speed": 5.0, "wind_deg": 180, "pop": 0.0, "weather": [ { "id": 802, "main": "Clouds", "description": "scattered clouds", "icon": "03d" } ] } ] } ``` ``` -------------------------------- ### Example API Call with Parameters Source: https://openweathermap.org/api/one-call-3?collection=one_call_api_3.0 An example of a complete API call to the overview endpoint, including latitude, longitude, and API key. Ensure your API key is valid and replace the coordinates as needed. ```HTTP https://api.openweathermap.org/data/3.0/onecall/overview?lon=-11.8092&lat=51.509865&appid={API key} ``` -------------------------------- ### One Call API 3.0 Standard Units Example Source: https://openweathermap.org/api/one-call-3?collection=one_call_api_3.0 Example API call using standard (default) units for weather data. ```URL api.openweathermap.org/data/3.0/onecall?lat=30.489772&lon=-99.771335 ``` -------------------------------- ### Start AI Weather Assistant Session via API Source: https://openweathermap.org/api/one-call-3?collection=one_call_api_3.0 This POST request starts a session with the AI Weather Assistant. Ensure you include your API key in the 'X-Api-Key' header and set the 'Content-Type' to 'application/json'. ```http Method: `POST` Header: `Content-Type: application/json` X-Api-Key: `[your OpenWeather API key]` ``` -------------------------------- ### Example Day Summary API Call with Timezone Source: https://openweathermap.org/api/one-call-3?collection=one_call_api_3.0 A concrete example of an API call to the Day Summary endpoint, including latitude, longitude, date, and a specific timezone offset. Replace `{API key}` with your actual API key. ```HTTP https://api.openweathermap.org/data/3.0/onecall/day_summary?lat=60.45&lon=-38.67&date=2023-03-30&tz=+03:00&appid={API key} ``` -------------------------------- ### Example API Request Body Source: https://openweathermap.org/api/one-call-3?collection=one_call_api_3.0 A sample JSON object for the request body, containing a prompt for the AI Weather Assistant. ```json { "prompt": "What’s weather like in London?" } ``` -------------------------------- ### AI Weather Assistant Session Start Source: https://openweathermap.org/api/one-call-3?collection=one_call_api_3.0 This endpoint is used to start a session with the AI Weather Assistant to ask questions about the weather and receive weather-related advice. It returns an HTTP 200 on successful creation. ```APIDOC ## POST /ai/weather/session ### Description Starts a session with the AI Weather Assistant to query weather information and receive advice in a human-readable format. ### Method POST ### Endpoint /ai/weather/session ### Headers - **Content-Type**: application/json - **X-Api-Key**: [your OpenWeather API key] ### Request Body * **prompt** (string) - Required - The user's query about the weather or activities based on weather data. ### Response #### Success Response (200) - **session_id** (string) - Unique identifier for the session. - **message** (string) - A welcome message or initial response from the assistant. ### Request Example ```json { "prompt": "What's the weather like in London?" } ``` ### Response Example ```json { "session_id": "sess_abc123xyz", "message": "Hello! I can help you with weather information. What would you like to know about London?" } ``` ``` -------------------------------- ### One Call API 3.0 Metric Units Example Source: https://openweathermap.org/api/one-call-3?collection=one_call_api_3.0 Example API call specifying metric units for temperature (Celsius) and wind speed (meter/sec). ```URL api.openweathermap.org/data/3.0/onecall?lat=30.489772&lon=-99.771335&units=metric ``` -------------------------------- ### Example API Call with Language Parameter Source: https://openweathermap.org/api/one-call-3?collection=one_call_api_3.0 This example demonstrates how to include the 'lang' parameter in your One Call API 3.0 request to receive data in Chinese Simplified. ```HTTP https://api.openweathermap.org/data/3.0/onecall?lat=30.489772&lon=-99.771335&lang=zh_cn ``` -------------------------------- ### Example API Response Source: https://openweathermap.org/api/one-call-3?collection=one_call_api_3.0 A sample JSON response from the AI Weather Assistant, including an answer and detailed weather data for a specified location. ```json { "answer": "Hello! Right now in London, it's quite cloudy with overcast skies. The temperature is around 9.5°C, but it feels a little cooler at 9.2°C. The humidity is at 91%, so it might feel a bit damp. Winds are light at 1.54 m/s coming from the southwest. With these conditions, it's a cozy day to perhaps enjoy indoor activities or a calm walk with a warm jacket. If you're heading out, there's no rain reported at the moment, but it's a good idea to keep an umbrella handy just in case. Stay cozy and enjoy your day in London!", "data": { "London": { "Current UTC Time": "15 January 2025, 14:25", "Current Week Day UTC": "Wednesday", "clouds": 100, "dew_point": 281.26, "dt": 1736951146, "feels_like": 282.19, "humidity": 91, "pressure": 1034, "sunrise": 1736927957, "sunset": 1736958011, "temp": 282.65, "uvi": 0.43, "visibility": 10000, "weather": [ { "description": "overcast clouds", "icon": "04d", "id": 804, "main": "Clouds" } ], "wind_deg": 240, "wind_speed": 1.54 } }, "session_id": "d47d2211-f1cf-409c-8297-617d74945571" } ``` -------------------------------- ### Example API Call for Time Machine Source: https://openweathermap.org/api/one-call-3?collection=one_call_api_3.0 An example of a complete API call to the Time Machine endpoint with specific coordinates and a timestamp. Ensure you replace '{API key}' with your actual key. ```HTTP https://api.openweathermap.org/data/3.0/onecall/timemachine?lat=39.099724&lon=-94.578331&dt=1643803200&appid={API key} ``` -------------------------------- ### Example Error Response (400 Bad Request) Source: https://openweathermap.org/api/one-call-3?collection=one_call_api_3.0 This is an example of a JSON object returned when an API call fails due to a bad request, such as an invalid date format. It includes the error code, a descriptive message, and optionally, the parameters that caused the error. ```json { "cod":400, "message":"Invalid date format", "parameters": [ "date" ] } ``` -------------------------------- ### Example API Response for Session Resumption Source: https://openweathermap.org/api/one-call-3?collection=one_call_api_3.0 This is a sample API response when resuming a chatbot session. It includes an answer to the prompt and session details. ```JSON { "answer": "Given the mild temperature of around 9.76°C in London and the gentle north wind at 2.68 m/s, wearing a hat could be a good idea, especially if you tend to feel a bit chilly or if you're sensitive to cooler weather. Plus, a hat can add a nice style touch to your outfit! Stay cozy and enjoy your day, whatever you choose! 😊", "data": {}, "session_id": "xxxxxxxxx" } ``` -------------------------------- ### Day Summary API Call with Timezone Source: https://openweathermap.org/api/one-call-3?collection=one_call_api_3.0 This example shows how to include the timezone parameter to specify the desired timezone for temperature and other weather data. The timezone is provided in the ±XX:XX format. ```HTTP https://api.openweathermap.org/data/3.0/onecall/day_summary?lat={lat}&lon={lon}&date={date}&tz={tz}&appid={API key} ``` -------------------------------- ### Example API Response Structure Source: https://openweathermap.org/api/one-call-3?collection=one_call_api_3.0 This JSON structure represents a typical response from the AI Weather Assistant, including location details, date, units, and a generated weather overview. ```json { "lat": 51.509865, "lon": -0.118092, "tz": "+01:00", "date": "2024-05-13", "units": "metric", "weather_overview": "The current weather is overcast with a temperature of 16°C and a feels-like temperature of 16°C. The wind speed is 4 meter/sec with gusts up to 6 meter/sec coming from the west-southwest direction. The air pressure is at 1007 hPa with a humidity level of 79%. The dew point is at 12°C and the visibility is 10000 meters. The UV index is at 4, indicating moderate risk from the sun's UV rays. The sky is covered with overcast clouds, and there is no precipitation expected at the moment. Overall, it is a moderately cool and cloudy day with light to moderate winds from the west-southwest." } ``` -------------------------------- ### Day Summary API Call with Timezone Source: https://openweathermap.org/api/one-call-3 This example shows how to include the timezone parameter for more accurate daily summaries. The timezone can be specified manually. ```HTTP https://api.openweathermap.org/data/3.0/onecall/day_summary?lat={lat}&lon={lon}&date={date}&tz={tz}&appid=``{API key} ``` -------------------------------- ### Get Weather Overview Source: https://openweathermap.org/api/one-call-3?collection=one_call_api_3.0&collection=one_call_api_3.0&collection=one_call_api_3.0 Retrieves a weather summary for a specified latitude and longitude. You can optionally specify a date and preferred units. ```APIDOC ## GET /data/3.0/onecall/overview ### Description Retrieves a weather summary for a specified latitude and longitude. You can optionally specify a date and preferred units. ### Method GET ### Endpoint https://api.openweathermap.org/data/3.0/onecall/overview ### Parameters #### Query Parameters - **lat** (decimal) - Required - Latitude, decimal (-90; 90) - **lon** (decimal) - Required - Longitude, decimal (-180; 180) - **appid** (string) - Required - Your unique API key - **date** (string) - Optional - The date the user wants to get a weather summary in the YYYY-MM-DD format. Data is available for today and tomorrow. If not specified, the current date will be used by default. Please note that the date is determined by the timezone relevant to the coordinates specified in the API request. - **units** (string) - Optional - Units of measurement. Standard, metric and imperial units are available. If you do not use the units parameter, standard units will be applied by default. ### Request Example ``` https://api.openweathermap.org/data/3.0/onecall/overview?lat=51.509865&lon=-11.8092&appid={API key} ``` ### Response #### Success Response (200) - **weather_data** (object) - Contains detailed weather information. - **hourly** (array) - Hourly forecast data. - **daily** (array) - Daily forecast data. - **minutely** (array) - Minutely precipitation data. - **alerts** (array) - Weather alerts. #### Response Example { "example": "{\"lat\": 51.509865, \"lon\": -11.8092, \"timezone\": \"Europe/London\", \"timezone_offset\": 3600, \"current\": { \"dt\": 1678886400, \"sunrise\": 1678867200, \"sunset\": 1678906800, \"temp\": 10.5, \"feels_like\": 8.2, \"pressure\": 1012, \"humidity\": 70, \"wind_speed\": 5.1, \"weather\": [{ \"id\": 800, \"main\": \"Clear\", \"description\": \"clear sky\", \"icon\": \"01d\" }] }, \"hourly\": [ ... ], \"daily\": [ ... ]}" } ``` -------------------------------- ### Example API Response Structure Source: https://openweathermap.org/api/one-call-3?collection=one_call_api_3.0 This JSON object illustrates the typical structure of a response from the One Call API 3.0, showcasing all available weather parameters for a given location and time. ```json { "lat": 52.2297, "lon": 21.0122, "timezone": "Europe/Warsaw", "timezone_offset": 3600, "data": [ { "dt": 1645888976, "sunrise": 1645853361, "sunset": 1645891727, "temp": 279.13, "feels_like": 276.44, "pressure": 1029, "humidity": 64, "dew_point": 272.88, "uvi": 0.06, "clouds": 0, "visibility": 10000, "wind_speed": 3.6, "wind_deg": 340, "weather": [ { "id": 800, "main": "Clear", "description": "clear sky", "icon": "01d" } ] } ] } ``` -------------------------------- ### API Response Structure for Day Summary Source: https://openweathermap.org/api/one-call-3?collection=one_call_api_3.0 This is an example of the JSON response received when requesting a daily weather summary. It includes various weather parameters for the specified date. ```JSON { "lat":33, "lon":35, "tz":"+02:00", "date":"2020-03-04", "units":"standard", "cloud_cover":{ "afternoon":0 }, "humidity":{ "afternoon":33 }, "precipitation":{ "total":0 }, "temperature":{ "min":286.48, "max":299.24, "afternoon":296.15, "night":289.56, "evening":295.93, "morning":287.59 }, "pressure":{ "afternoon":1015 }, "wind":{ "max":{ "speed":8.7, "direction":120 } } } ``` -------------------------------- ### Get Day Summary Source: https://openweathermap.org/api/one-call-3?collection=one_call_api_3.0&collection=one_call_api_3.0&collection=one_call_api_3.0 Retrieves a daily weather summary for a given latitude, longitude, and date. You can also specify units, language, and timezone for the response. ```APIDOC ## GET /onecall/day_summary ### Description Retrieves a daily weather summary for a given latitude, longitude, and date. This endpoint can also include optional parameters for units, language, and timezone to customize the response. ### Method GET ### Endpoint https://api.openweathermap.org/data/3.0/onecall/day_summary ### Parameters #### Query Parameters - **lat** (float) - Required - Latitude, decimal (-90; 90) - **lon** (float) - Required - Longitude, decimal (-180; 180) - **date** (string) - Required - Date in the `YYYY-MM-DD` format for which data is requested. Supports historical data and future forecasts. - **appid** (string) - Required - Your unique API key. - **units** (string) - Optional - Units of measurement. Options: `standard`, `metric`, `imperial`. Defaults to `standard`. - **lang** (string) - Optional - You can use the `lang` parameter to get the output in your language. - **tz** (string) - Optional - Specify the correct timezone manually in the `±XX:XX` format if the service detected it incorrectly. ### Request Example ``` https://api.openweathermap.org/data/3.0/onecall/day_summary?lat=60.45&lon=-38.67&date=2023-03-30&tz=+03:00&appid={API key} ``` ### Response #### Success Response (200) (Response schema not provided in the source text) #### Response Example (Response example not provided in the source text) ``` -------------------------------- ### Get Daily Weather Summary Source: https://openweathermap.org/api/one-call-3?collection=one_call_api_3.0&collection=one_call_api_3.0&collection=one_call_api_3.0 This endpoint retrieves a summary of weather conditions for a specific day at a given latitude and longitude. It includes details on temperature, humidity, precipitation, and cloud cover. ```APIDOC ## GET /onecall/day_summary ### Description Retrieves a daily weather summary for a specified location and date. ### Method GET ### Endpoint https://api.openweathermap.org/data/3.0/onecall/day_summary ### Parameters #### Query Parameters - **lat** (float) - Required - Latitude of the location. - **lon** (float) - Required - Longitude of the location. - **date** (string) - Required - The date for the summary in `YYYY-MM-DD` format. - **appid** (string) - Required - Your unique API key. ### Response #### Success Response (200) - **lat** (float) - Latitude of the location. - **lon** (float) - Longitude of the location. - **tz** (string) - Timezone in the ±XX:XX format. - **date** (string) - Date specified in the API request. - **units** (string) - Units of measurement specified in the request. - **cloud_cover** (object) - Cloud related information. - **afternoon** (integer) - Cloud cover at 12:00 for the date specified in the request, %. - **humidity** (object) - Humidity related information. - **afternoon** (integer) - Relative humidity at 12:00 for the date specified in the request, %. - **precipitation** (object) - Precipitation related information. - **total** (float) - Total amount of liquid water equivalent of precipitation for the date specified in the request, mm. - **temperature** (object) - Temperature related information. - **min** (float) - Minimum temperature for the date specified in the request. - **max** (float) - Maximum temperature for the date specified in the request. - **afternoon** (float) - Temperature at 12:00 for the date specified in the request. - **night** (float) - Temperature at 00:00 for the date specified in the request. - **evening** (float) - Temperature at 18:00 for the date specified in the request. - **morning** (float) - Temperature at 06:00 for the date specified in the request. - **pressure** (object) - Atmospheric pressure related information. - **afternoon** (integer) - Atmospheric pressure at 12:00 for the date specified in the request, hPa. - **wind** (object) - Wind speed related information. - **max** (object) - Maximum wind speed related information. - **speed** (float) - Maximum wind speed for the date specified in the request. - **direction** (integer) - Wind cardinal direction relevant to the maximum wind speed, degrees. ### Request Example ``` https://api.openweathermap.org/data/3.0/onecall/day_summary?lat=39.099724&lon=-94.578331&date=2020-03-04&appid={API key} ``` ### Response Example ```json { "lat":33, "lon":35, "tz":"+02:00", "date":"2020-03-04", "units":"standard", "cloud_cover":{ "afternoon":0 }, "humidity":{ "afternoon":33 }, "precipitation":{ "total":0 }, "temperature":{ "min":286.48, "max":299.24, "afternoon":296.15, "night":289.56, "evening":295.93, "morning":287.59 }, "pressure":{ "afternoon":1015 }, "wind":{ "max":{ "speed":8.7, "direction":120 } } } ``` ``` -------------------------------- ### Start Session and Ask Weather Questions Source: https://openweathermap.org/api/one-call-3?collection=one_call_api_3.0&collection=one_call_api_3.0&collection=one_call_api_3.0 This POST method initiates a session with the AI Weather Assistant to ask questions about weather and receive related advice. It requires your OpenWeather API key in the header. ```APIDOC ## POST /weather-assistant ### Description Starts a session to ask questions about the weather and receive weather-related advice. The AI Assistant uses current weather, minutely, hourly, and daily forecasts for the next 7 days. It supports global locations and remembers the specified location for future inquiries. ### Method POST ### Endpoint /weather-assistant ### Headers - **Content-Type**: application/json - **X-Api-Key**: [your OpenWeather API key] ### Request Body - **prompt** (string) - Required - Your question or query about the weather or activities based on weather data. ### Response #### Success Response (200) - **lat** (number) - Latitude of the location. - **lon** (number) - Longitude of the location. - **tz** (string) - Timezone in the ±XX:XX format. - **date** (string) - Date for which summary is generated in the format YYYY-MM-DD. - **units** (string) - Units of measurement specified in the request. - **weather_overview** (string) - AI generated weather overview for the requested date. ### Request Example ```json { "prompt": "What's the weather like in London?" } ``` ### Response Example ```json { "lat": 51.509865, "lon": -0.118092, "tz": "+01:00", "date": "2024-05-13", "units": "metric", "weather_overview": "The current weather is overcast with a temperature of 16°C and a feels-like temperature of 16°C. The wind speed is 4 meter/sec with gusts up to 6 meter/sec coming from the west-southwest direction. The air pressure is at 1007 hPa with a humidity level of 79%. The dew point is at 12°C and the visibility is 10000 meters. The UV index is at 4, indicating moderate risk from the sun's UV rays. The sky is covered with overcast clouds, and there is no precipitation expected at the moment. Overall, it is a moderately cool and cloudy day with light to moderate winds from the west-southwest." } ``` ``` -------------------------------- ### One Call API 3.0 Imperial Units Example Source: https://openweathermap.org/api/one-call-3?collection=one_call_api_3.0 Example API call specifying imperial units for temperature (Fahrenheit) and wind speed (miles/hour). ```URL api.openweathermap.org/data/3.0/onecall?lat=30.489772&lon=-99.771335&units=imperial ``` -------------------------------- ### Example One Call API 3.0 Call with Specific Coordinates Source: https://openweathermap.org/api/one-call-3?collection=one_call_api_3.0 An example of a One Call API 3.0 call using specific latitude and longitude values. This call also excludes most data components to focus on alerts. ```HTTP https://api.openweathermap.org/data/3.0/onecall?lat=33.44&lon=-94.04&exclude=current,minutely,hourly,daily&appid={API key} ``` -------------------------------- ### Get Weather Overview Source: https://openweathermap.org/api/one-call-3 Retrieve a weather summary for a specific location and date using the One Call API 3.0. ```APIDOC ## GET /data/3.0/onecall/overview ### Description Retrieves a weather overview for a specified latitude and longitude. ### Method GET ### Endpoint https://api.openweathermap.org/data/3.0/onecall/overview ### Parameters #### Query Parameters - **lat** (decimal) - Required - Latitude, decimal (-90; 90) - **lon** (decimal) - Required - Longitude, decimal (-180; 180) - **appid** (string) - Required - Your unique API key - **date** (string) - Optional - The date in YYYY-MM-DD format. Data is available for today and tomorrow. Defaults to the current date. - **units** (string) - Optional - Units of measurement. Standard, metric, and imperial units are available. Defaults to standard units. ### Request Example ``` https://api.openweathermap.org/data/3.0/onecall/overview?lon=-11.8092&lat=51.509865&appid={API key} ``` ``` -------------------------------- ### Request Body for Resuming Session Source: https://openweathermap.org/api/one-call-3?collection=one_call_api_3.0 This is an example of the JSON payload to send when resuming a chatbot session. It includes the user's prompt. ```JSON { "prompt": "Do I need a hat?" } ``` -------------------------------- ### Access AI Weather Assistant via Web Interface Source: https://openweathermap.org/api/one-call-3?collection=one_call_api_3.0 Use this URL to access the AI Weather Assistant's web interface. Replace `{API key}` with your valid OpenWeather API key. ```url https://openweathermap.org/weather-assistant?apikey={API key} ``` -------------------------------- ### GET /onecall/timemachine Source: https://openweathermap.org/api/one-call-3 Retrieves historical weather data for a specific latitude, longitude, and timestamp using the OpenWeatherMap One Call API 3.0. ```APIDOC ## GET /onecall/timemachine ### Description Retrieves historical weather data for a specific latitude, longitude, and timestamp. This endpoint is part of the "One Call by Call" subscription. ### Method GET ### Endpoint https://api.openweathermap.org/data/3.0/onecall/timemachine ### Parameters #### Query Parameters - **lat** (decimal) - Required - Latitude (-90; 90). - **lon** (decimal) - Required - Longitude (-180; 180). - **dt** (Unix time) - Required - Timestamp in UTC (e.g., 1586468027). Data is available from January 1st, 1979, up to 4 days in the future. - **appid** (string) - Required - Your unique API key. - **units** (string) - Optional - Units of measurement (`standard`, `metric`, `imperial`). Defaults to `standard`. - **lang** (string) - Optional - Output language for the response. ### Request Example ``` https://api.openweathermap.org/data/3.0/onecall/timemachine?lat=39.099724&lon=-94.578331&dt=1643803200&appid={API key} ``` ### Response #### Success Response (200) (Response schema not provided in source text) #### Response Example (Response example not provided in source text) ``` -------------------------------- ### API Call for Day Summary Source: https://openweathermap.org/api/one-call-3?collection=one_call_api_3.0 This snippet shows the URL structure for requesting a daily weather summary. Replace {API key} with your actual OpenWeather API key. ```HTTP https://api.openweathermap.org/data/3.0/onecall/day_summary?lat=39.099724&lon=-94.578331&date=2020-03-04&appid={API key} ``` -------------------------------- ### One Call API 3.0 Full Response Example Source: https://openweathermap.org/api/one-call-3?collection=one_call_api_3.0 This snippet shows a complete response object from the One Call API 3.0, including current weather, minutely, hourly, daily forecasts, and alerts. It is useful for understanding the structure of the data returned by the API. ```json test({ "lat": 40.12, "lon": -96.66, "timezone": "America/Chicago", "timezone_offset": -18000, "current": { "dt": 1595243443, "sunrise": 1595243663, "sunset": 1595296278, "temp": 293.28, "feels_like": 293.82, "pressure": 1016, "humidity": 100, "dew_point": 293.28, "uvi": 10.64, "clouds": 90, "visibility": 10000, "wind_speed": 4.6, "wind_deg": 310, "weather": [ { "id": 501, "main": "Rain", "description": "moderate rain", "icon": "10n" }, { "id": 201, "main": "Thunderstorm", "description": "thunderstorm with rain", "icon": "11n" } ], "rain": { "1h": 2.93 } }, "minutely": [ { "dt": 1595243460, "precipitation": 2.928 }, ... }, "hourly": [ { "dt": 1595242800, "temp": 293.28, "feels_like": 293.82, "pressure": 1016, "humidity": 100, "dew_point": 293.28, "clouds": 90, "visibility": 10000, "wind_speed": 4.6, "wind_deg": 123, "weather": [ { "id": 501, "main": "Rain", "description": "moderate rain", "icon": "10n" } ], "pop": 0.99, "rain": { "1h": 2.46 } }, ... } "daily": [ { "dt": 1595268000, "sunrise": 1595243663, "sunset": 1595296278, "temp": { "day": 298.82, "min": 293.25, "max": 301.9, "night": 293.25, "eve": 299.72, "morn": 293.48 }, "feels_like": { "day": 300.06, "night": 292.46, "eve": 300.87, "morn": 293.75 }, "pressure": 1014, "humidity": 82, "dew_point": 295.52, "wind_speed": 5.22, "wind_deg": 146, "weather": [ { "id": 502, "main": "Rain", "description": "heavy intensity rain", "icon": "10d" } ], "clouds": 97, "pop": 1, "rain": 12.57, "uvi": 10.64 }, ... }, "alerts": [ { "sender_name": "NWS Tulsa (Eastern Oklahoma)", "event": "Heat Advisory", "start": 1597341600, "end": 1597366800, "description": "...HEAT ADVISORY REMAINS IN EFFECT FROM 1 PM THIS AFTERNOON TO\n8 PM CDT THIS EVENING...\n* WHAT...Heat index values of 105 to 109 degrees expected.\n* WHERE...Creek, Okfuskee, Okmulgee, McIntosh, Pittsburg,\nLatimer, Pushmataha, and Choctaw Counties.\n* WHEN...From 1 PM to 8 PM CDT Thursday.\n* IMPACTS...The combination of hot temperatures and high\nhumidity will combine to create a dangerous situation in which\nheat illnesses are possible." }, ... ] }) ``` -------------------------------- ### Day Summary API Call Source: https://openweathermap.org/api/one-call-3?collection=one_call_api_3.0 This snippet shows how to call the day summary endpoint to get weather data for a specific date, with optional timezone specification. ```APIDOC ## GET /data/3.0/onecall/day_summary ### Description Retrieves detailed weather information for a specific day, including historical and forecast data. Supports optional timezone specification for accurate time-based data. ### Method GET ### Endpoint /data/3.0/onecall/day_summary ### Parameters #### Path Parameters - **lat** (decimal) - Required - Latitude (-90; 90) - **lon** (decimal) - Required - Longitude (-180; 180) - **date** (string) - Required - Date in `YYYY-MM-DD` format. Available for 447+ years archive (starting from 1979-01-02) up to 1.5 years ahead forecast. - **appid** (string) - Required - Your unique API key. #### Query Parameters - **units** (string) - Optional - Units of measurement (`standard`, `metric`, `imperial`). Defaults to `standard`. - **lang** (string) - Optional - Output language. - **tz** (string) - Optional - Timezone in `±XX:XX` format. If specified, afternoon, night, evening, and morning temperatures, pressure, and humidity will be returned in accordance with this timezone. ### Request Example ``` https://api.openweathermap.org/data/3.0/onecall/day_summary?lat=60.45&lon=-38.67&date=2023-03-30&tz=+03:00&appid={API key} ``` ### Response (Response details not provided in the source text) ```