### Get Solar Panels URL Example Source: https://openweathermap.org/api/solar-panels-and-energy-prediction-2 An example of the URL used to fetch solar panel data for a given location. This includes a sample `location_id`. ```text https://api.openweathermap.org/energy/2.0/location/F01E165B-22F3-4591-89D4-F238E92F6885?appid={API key} ``` -------------------------------- ### Example API Call by City ID (No Date Specified) Source: https://openweathermap.org/api/history?collection=historical Example API call using a city ID. If start and end/cnt are not specified, default historical data may be returned. Ensure you have the correct city ID and API key. ```text https://history.openweathermap.org/data/2.5/history/city?id=2885679&type=hour&appid={API key} ``` -------------------------------- ### API Call with API Key Source: https://openweathermap.org/faq This example shows how to include your API key as a parameter in a GET request to OpenWeather's API. ```http api.openweathermap.org/data/2.5/weather?id=524901&appid=YOUR_API_KEY ``` -------------------------------- ### Delete Solar Panel URL Example Source: https://openweathermap.org/api/solar-panels-and-energy-prediction-2 An example of the URL for deleting a solar panel, demonstrating the use of a specific `panel_id`. ```text https://api.openweathermap.org/energy/2.0/panel/F01E165B-22F3-4591-89D4-F238E92F6885?appid={API key} ``` -------------------------------- ### Example API Call Source: https://openweathermap.org/api/one-call-4 An example of how to construct the API request URL for a specific alert ID. Ensure you replace `{API key}` with your actual API key. ```text https://api.openweathermap.org/data/4.0/onecall/alert/8B46C632-DCA7-44D7-8BDF-02445621BAFF?appid={API key} ``` -------------------------------- ### 7-Day Forecast by City Name (Metric Units) Source: https://openweathermap.org/api/forecast16?collection=current_forecast This example demonstrates how to call the API to get a 7-day weather forecast for a city, specifically requesting data in metric units. Remember to replace the placeholders. ```api api.openweathermap.org/data/2.5/forecast/daily?q={city name}&cnt=7&appid={API key}&units=metric ``` -------------------------------- ### API Call Example with API Key Source: https://openweathermap.org/appid This example demonstrates how to make an API call to retrieve weather data, including the required API key. ```APIDOC ## GET api.openweathermap.org/data/2.5/forecast ### Description This endpoint retrieves weather forecast data for a specified location using your unique API key. ### Method GET ### Endpoint `http://api.openweathermap.org/data/2.5/forecast?id=524901&appid={API key}` ### Parameters #### Query Parameters - **appid** (string) - Required - Your unique API key. This key is essential for authenticating your request and accessing the weather data. You can find your API key on your account page under the "API key" tab. ### Request Example ```text http://api.openweathermap.org/data/2.5/forecast?id=524901&appid=YOUR_API_KEY ``` ### Response #### Success Response (200) - The response will contain weather forecast data for the specified location. The exact structure of the response depends on the specific data points requested and the API version being used. #### Response Example ```json { "cod": "200", "message": 0, "cnt": 40, "list": [ { "dt": 1661875200, "main": { "temp": 298.48, "feels_like": 298.74, "temp_min": 297.56, "temp_max": 300.05, "pressure": 1015, "sea_level": 1015, "grnd_level": 933, "humidity": 69, "temp_kf": 2.49 }, "weather": [ { "id": 800, "main": "Clear", "description": "clear sky", "icon": "01d" } ], "clouds": { "all": 0 }, "wind": { "speed": 3.65, "deg": 349, "gust": 6.07 }, "visibility": 10000, "pop": 0.21, "sys": { "pod": "d" }, "dt_txt": "2022-08-30 12:00:00" } ], "city": { "id": 524901, "name": "Moscow", "coord": { "lat": 55.7522, "lon": 37.6156 }, "country": "RU", "population": 1000000, "timezone": 10800, "sunrise": 1661834104, "sunset": 1661887904 } } ``` ``` -------------------------------- ### Temperature Map Layer Example Source: https://openweathermap.org/api/weathermaps Example of how to request a temperature weather map layer. This layer displays temperature variations worldwide. ```text layer : temp_new area : worldwide ``` -------------------------------- ### API Response Example (City Name) Source: https://openweathermap.org/api/history?collection=historical Example URL for fetching historical data by city name. Replace '{API key}' with your actual API key. ```text https://history.openweathermap.org/data/2.5/history/city?q=Munchen,DE&appid={API key} ``` -------------------------------- ### Hourly Forecast API Call Example by ZIP Code Source: https://openweathermap.org/api/hourly-forecast An example of an API call to get hourly forecast data using a ZIP code and country code. ```text https://pro.openweathermap.org/data/2.5/forecast/hourly?zip=94040,us&appid={API key} ``` -------------------------------- ### Solar Data API URL Example Source: https://openweathermap.org/api/solar-panels-and-energy-prediction-2 A concrete example of a URL for requesting solar data, specifying location, date, and interval. ```text https://api.openweathermap.org/energy/2.0/location/018aa7aa-3d5f-85a2-91ee-b1b53c3e98a4/interval_data?date=2021-05-01&interval=1h&appid={API key} ``` -------------------------------- ### Example CSV Bulk Download Link Source: https://openweathermap.org/api/bulk This example shows how to construct a download link for a bulk file in CSV format. Note the change from '.json.gz' to '.csv.gz' in the file name. ```text https://bulk.openweathermap.org/snapshot/weather_zip_us.csv.gz?appid={API key} ``` -------------------------------- ### API Call Example (Forecast) Source: https://openweathermap.org/appid An example demonstrating the structure of an API call for forecast data, including the necessary parameters like location ID and API key. ```text api.openweathermap.org/data/2.5/forecast?id=524901&appid={API key} ``` -------------------------------- ### Basic Relief Map URL Example Source: https://openweathermap.org/api/relief An example of a basic URL to retrieve relief maps, including the required API key. ```text http://maps.openweathermap.org/maps/2.0/relief/{z}/{x}/{y}?appid={API key} ``` -------------------------------- ### URL Example Source: https://openweathermap.org/api/fire-index-map An example of a complete URL for fetching a Fire Weather Index map. Replace placeholders with your actual API key and desired date (Unix time). ```text https://maps.openweathermap.org/maps/2.0/fwi/4/1/6?appid={API key}&date=1600780200 ``` -------------------------------- ### Example API Call Source: https://openweathermap.org/api/uvi An example of a complete API call with latitude and longitude specified. Replace '{API key}' with your actual API key. ```HTTP https://api.openweathermap.org/data/3.0/onecall/overview?lon=-11.8092&lat=51.509865&appid={API key} ``` -------------------------------- ### API Call Example with JavaScript Callback Source: https://openweathermap.org/api/forecast30 This example demonstrates how to make an API call and handle the JSON response using a JavaScript callback function for JSONP. ```javascript test( { "coord":{ "lon":-0.13, "lat":51.51 }, "weather":[ { "id":300, "main":"Drizzle", "description":"light intensity drizzle", "icon":"09d" } ], "base":"stations", "main":{ "temp":280.32, "pressure":1012, "humidity":81, "temp_min":279.15, "temp_max":281.15 }, "visibility":10000, "wind":{ "speed":4.1, "deg":80 }, "clouds":{ "all":90 }, "dt":1485789600, "sys":{ "type":1, "id":5091, "message":0.0103, "country":"GB", "sunrise":1485762037, "sunset":1485794875 }, "id":2643743, "name":"London", "cod":200 } ) ``` -------------------------------- ### API Call Example with JSONP Callback Source: https://openweathermap.org/api/forecast16 This example demonstrates how to make an API call and receive the response as a JSONP callback function. This is useful for integrating with JavaScript applications. ```text test( { "coord":{ "lon":-0.13, "lat":51.51 }, "weather":[ { "id":300, "main":"Drizzle", "description":"light intensity drizzle", "icon":"09d" } ], "base":"stations", "main":{ "temp":280.32, "pressure":1012, "humidity":81, "temp_min":279.15, "temp_max":281.15 }, "visibility":10000, "wind":{ "speed":4.1, "deg":80, "gust":6.1 }, "clouds":{ "all":90 }, "dt":1485789600, "sys":{ "type":1, "id":5091, "message":0.0103, "country":"GB", "sunrise":1485762037, "sunset":1485794875 }, "id":2643743, "name":"London", "cod":200 } ) ``` -------------------------------- ### Clouds Map Layer Example Source: https://openweathermap.org/api/weathermaps Example of how to request a clouds weather map layer. This layer shows cloud cover worldwide. ```text layer : clouds_new area : worldwide ``` -------------------------------- ### JavaScript JSONP Callback Example Source: https://openweathermap.org/api/current?collection=current_forecast This example shows how to use a callback function for JSONP requests in JavaScript. ```javascript function callback(data) { // Process the JSONP data here } ``` -------------------------------- ### API Call Example Source: https://openweathermap.org/api/uvi This example demonstrates a typical API call to retrieve weather data, including current, minutely, hourly, daily, and alert information. ```APIDOC ## API Call Example This example demonstrates a typical API call to retrieve weather data, including current, minutely, hourly, daily, and alert information. ### Request Body Example ```json { "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." } ] } ``` ``` -------------------------------- ### Example API Call with Parameters Source: https://openweathermap.org/api/one-call-4 An example of a complete API call including latitude, longitude, units, language, and API key. Ensure you have the correct subscription for One Call 4.0. ```text https://api.openweathermap.org/data/4.0/onecall/current?lat=52.2297&lon=21.0122&units=metric&lang=en&appid={API key} ``` -------------------------------- ### API Call Example - Standard Units Source: https://openweathermap.org/api/one-call-4 Example API call using default (standard) units for temperature and wind speed. ```text https://api.openweathermap.org/data/4.0/onecall/current?lat=30.489772&lon=-99.771335&appid={API key} ``` -------------------------------- ### Example API Call for 1 Minute Timeline Source: https://openweathermap.org/api/one-call-4 An example of a complete API call URL for the 1-minute timeline endpoint, demonstrating the inclusion of latitude, longitude, and API key. ```text https://api.openweathermap.org/data/4.0/onecall/timeline/1min?lat=51.5&lon=-0.1&appid={API key} ``` -------------------------------- ### API Call Example - Multilingual Support Source: https://openweathermap.org/api/one-call-4 Example API call requesting the output in Simplified Chinese. ```text https://api.openweathermap.org/data/4.0/onecall/current?lat=30.489772&lon=-99.771335&lang=zh_cn&appid={API key} ``` -------------------------------- ### Solar Data API Call Example with Timezone Source: https://openweathermap.org/api/solar-panels-and-energy-prediction-2 An example API call demonstrating how to include the timezone parameter for a specific location and date. ```text https://api.openweathermap.org/energy/2.0/location/F01E165B-22F3-4591-89D4-F238E92F6885/interval_data?date=2023-03-30&interval=1h&tz=+05:45&appid={API key} ``` -------------------------------- ### XML API Response Example Source: https://openweathermap.org/api/forecast16 This is an example of the XML response structure for a daily forecast. It includes detailed weather information for multiple days. ```xml London GB 0.0117