API USAGE GUIDE FOR RETRIEVING DATA FROM A WEATHER STATION =========================================================== 1. Retrieving the Current (Last Saved) Value: --------------------------------------------- HTTP GET: https://pgsonda.cz/api/api_json_user.php?name=station_name&api_key=YOUR_API_KEY Parameters: - name (required): User name or station identifier. - api_key (required): API key to authenticate the request. Example: https://pgsonda.cz/api/api_json_user.php?name=station_name&api_key=*** 2. Retrieving Data for a Specific Time Period: ---------------------------------------------- HTTP GET: https://pgsonda.cz/api/api_json_user.php?name=station_name&start_date=2024_01_07&end_date=2024_01_08&api_key=YOUR_API_KEY Parameters: - name (required): User name or station identifier. - start_date (optional): Start date (format: YYYY_MM_DD). - end_date (optional): End date (format: YYYY_MM_DD). - api_key (required): API key to authenticate the request. Example: https://pgsonda.cz/api/api_json_user.php?name=station_name&start_date=2024_01_07&end_date=2024_01_08&api_key=*** 3. JSON Response Format: ------------------------ Success: { "status": "success", "data": [ { "db_date": "2024-01-07", "db_time": "12:30:00", "db_avgdir": 186, "db_minspd": 2.3, "db_avgspd": 5.8, "db_maxspd": 10.2, "db_temp": 25.5, "db_hum": 45.0, "db_preszero": 1015.2, "db_bat": 100, "db_rain_hour": 0 } ] } Error: { "status": "error", "message": "Error description" } 4. Field Descriptions: ---------------------- - db_date - date of data sample - db_time - time of data sample - db_avgdir - wind direction (°) - db_minspd - minimum wind speed (m/s) - db_avgspd - average wind speed (m/s) - db_maxspd - maximum wind speed (m/s) - db_temp - air temperature (°C) - db_hum - air humidity (%RH) - db_preszero - air pressure adjusted to sea level (Pa) - db_bat - battery charge level of the weather station (%) - db_rain_hour - rainfall amount (mm/h)