Weather API: Difference between revisions

From Deep Sky Chile
No edit summary
No edit summary
Line 1: Line 1:
== Deep Sky Chile Weather API User Manual ==
== Deep Sky Chile Weather API User Manual ==


The Deep Sky Chile Weather API provides real-time weather and astronomical data, including cloud cover, temperature, wind speed, rain, light levels, and key astronomical measurements.
The Deep Sky Chile Weather API provides real-time weather and astronomical data, including cloud cover, temperature, wind speed, rain, light levels, seeing conditions, and key astronomical measurements.


=== Base URL ===
=== Base URL ===
The base URL for accessing the API is: http://api.deepskychile.com/weather
The base URL for accessing the API is:
<code>http://api.deepskychile.com/weather</code>


=== Endpoint ===
=== Endpoint ===
* '''GET /weather''': Retrieves the current weather and astronomical data, including cloud, rain, light states, and important astronomical metrics.
* '''GET /weather''': Retrieves the current weather and astronomical data, including cloud, rain, light states, seeing, and important astronomical metrics.


=== Response Format ===
=== Response Format ===
The API returns the data in JSON format with the following structure:
The API returns data in JSON format with the following structure:
<pre>
{
{
     "weather": {
     "weather": {
         "cloudwatcher": {
         "cloudwatcher": {
             "clouds": <clouds_value>,
             "clouds": &lt;clouds_value&gt;,
             "temp": <temperature_value>,
             "temp": &lt;temperature_value&gt;,
             "wind": <wind_speed>,
             "wind": &lt;wind_speed&gt;,
             "gust": <wind_gust>,
             "gust": &lt;wind_gust&gt;,
             "rain": <rain_value>,
             "rain": &lt;rain_value&gt;,
             "light": <light_level>,
             "light": &lt;light_level&gt;,
             "switch": <switch_state>,
             "switch": &lt;switch_state&gt;,
             "safe": <safe_state>,
             "safe": &lt;safe_state&gt;,
             "hum": <humidity>,
             "hum": &lt;humidity&gt;,
             "dewp": <dew_point>,
             "dewp": &lt;dew_point&gt;,
             "cloudsState": "<clouds_state>",
             "cloudsState": "&lt;clouds_state&gt;",
             "rainState": "<rain_state>",
             "rainState": "&lt;rain_state&gt;",
             "lightState": "<light_state>"
             "lightState": "&lt;light_state&gt;"
         },
         },
         "ninox": {
         "ninox": {
             "UTC": "<utc_time>",
             "UTC": "&lt;utc_time&gt;",
             "NSBNow": <current_NSB_value>,
             "NSBNow": &lt;current_NSB_value&gt;,
             "SunAltitude": <sun_altitude>,
             "SunAltitude": &lt;sun_altitude&gt;,
             "MoonAltitude": <moon_altitude>,
             "MoonAltitude": &lt;moon_altitude&gt;,
             "MoonPhase": <moon_phase>,
             "MoonPhase": &lt;moon_phase&gt;,
             "ZenithGalacticLatitude": <galactic_latitude>,
             "ZenithGalacticLatitude": &lt;galactic_latitude&gt;,
             "NightBestNSB": <best_NSB_value>,
             "NightBestNSB": &lt;best_NSB_value&gt;,
             "NightBestNSBTime": "<night_best_NSB_time>",
             "NightBestNSBTime": "&lt;night_best_NSB_time&gt;",
             "NightBestNSBZGL": <night_best_ZGL>,
             "NightBestNSBZGL": &lt;night_best_ZGL&gt;,
             "OverallBestNSB": <overall_best_NSB_value>,
             "OverallBestNSB": &lt;overall_best_NSB_value&gt;,
             "OverallBestNSBTime": "<overall_best_NSB_time>",
             "OverallBestNSBTime": "&lt;overall_best_NSB_time&gt;",
             "OverallBestNSBZGL": <overall_best_ZGL>
             "OverallBestNSBZGL": &lt;overall_best_ZGL&gt;
        },
        "seeing": {
            "UTC": "&lt;seeing_utc_time&gt;",
            "SeeingValue": &lt;seeing_value&gt;
         },
         },
         "average": {
         "average": {
             "avgHum": <average_humidity>,
             "avgHum": &lt;average_humidity&gt;,
             "avgWind": <average_wind_speed>,
             "avgWind": &lt;average_wind_speed&gt;,
             "avgTemp": <average_temperature>,
             "avgTemp": &lt;average_temperature&gt;,
             "monitoringStart": "<monitoring_start_date>"
             "monitoringStart": "&lt;monitoring_start_date&gt;"
         }
         }
     }
     }
}
}
</pre>


=== Fields ===
=== Fields ===
weather   
'''weather'''  
The main object containing weather data from three sources: cloudwatcher, ninox, and average.
The main object containing weather data from four sources: <code>cloudwatcher</code>, <code>ninox</code>, <code>seeing</code>, and <code>average</code>.


cloudwatcher (General Weather Data)
'''cloudwatcher (General Weather Data)'''
* '''clouds''' (float): The current sky temperature in degrees Celsius.   
* '''clouds''' (float): Current sky temperature in degrees Celsius.   
* '''temp''' (float): The current temperature in degrees Celsius.   
* '''temp''' (float): Current temperature in degrees Celsius.   
* '''wind''' (float): The current wind speed in kilometer per hour (km/h).   
* '''wind''' (float): Wind speed in km/h.   
* '''gust''' (float): The current wind gust speed in kilometer per hour (km/h).   
* '''gust''' (float): Wind gust speed in km/h.   
* '''rain''' (float): The amount of rain, no unit.   
* '''rain''' (float): Rain value (unitless).   
* '''light''' (float): The ambient light level, no unit.   
* '''light''' (float): Ambient light level (unitless).   
* '''switch''' (integer): Lock switch status value. Possible values:
* '''switch''' (integer): Lock switch status:
   * 1: Observatories are unlocked.   
   * 1: Observatories are unlocked.   
   * 0: Observatories are locked.   
   * 0: Observatories are locked.   
* '''safe''' (integer): Safety status value. Possible values:
* '''safe''' (integer): Safety status:
   * 1: Safe.   
   * 1: Safe.   
   * 0: Unsafe.   
   * 0: Unsafe.   
* '''hum''' (float): The relative humidity in percentage.   
* '''hum''' (float): Relative humidity (%).   
* '''dewp''' (float): The dew point temperature in degrees Celsius.   
* '''dewp''' (float): Dew point temperature in degrees Celsius.   
* '''cloudsState''' (string): Determined based on the clouds value. Possible values:
* '''cloudsState''' (string):
   * "Clear": Cloud coverage is low.
   * "Clear": Low cloud cover.
   * "Cloudy": Moderate cloud cover.
   * "Cloudy": Moderate cloud cover.
   * "Overcast": High cloud cover or fully covered skies.   
   * "Overcast": High cloud cover or fully covered skies.   
* '''rainState''' (string): Determined based on the rain value. Possible values:
* '''rainState''' (string):
   * "Dry": No significant rain detected (rain value greater than 2000).
   * "Dry": Rain &gt; 2000.
   * "Wet": Light rain (rain value between 1700 and 2000).
   * "Wet": Rain between 1700 and 2000.
   * "Raining": Moderate to heavy rain (rain value less than 1700).   
   * "Raining": Rain &lt; 1700.   
* '''lightState''' (string): Determined based on the light value. Possible values:
* '''lightState''' (string):
   * "Dark": Light intensity above 8000.
   * "Dark": Light &gt; 8000.
   * "Bright": Light intensity between 6 and 8000.
   * "Bright": Light between 6 and 8000.
   * "Sunny": Light intensity below 6.
   * "Sunny": Light &lt;= 6
 
'''ninox (Astronomical Data)'''
* '''UTC''' (string): Current UTC time, format: yy-mm-dd hh:mm:ss. 
* '''NSBNow''' (float): Current sky brightness (NSB) value. Lower values indicate better observing conditions. 
* '''SunAltitude''' (float): Altitude of the Sun in degrees. 
* '''MoonAltitude''' (float): Altitude of the Moon in degrees. 
* '''MoonPhase''' (float): Moon phase in percentage (0–100%). 
* '''ZenithGalacticLatitude''' (float): Galactic latitude at zenith. 
* '''NightBestNSB''' (float): Best NSB value for the current night. 
* '''NightBestNSBTime''' (string): Time of best NSB value. 
* '''NightBestNSBZGL''' (float): Zenith galactic latitude at best NSB time. 
* '''OverallBestNSB''' (float): Best overall NSB recorded. 
* '''OverallBestNSBTime''' (string): Time of overall best NSB. 
* '''OverallBestNSBZGL''' (float): Galactic latitude at overall best NSB.


ninox (Astronomical Data)
'''seeing (Atmospheric Seeing Conditions)'''
* '''UTC''' (string): The current UTC time, formatted as yy-mm-dd hh:mm:ss. 
* '''UTC''' (string): UTC time of the seeing measurement.   
* '''NSBNow''' (float): The current NSB (Sky Brightness) value. It represents the visibility of the night sky. Lower values indicate better observing conditions. 
* '''SeeingValue''' (float): Seeing value in arcseconds. Lower values indicate better seeing (e.g., 1.0 is excellent, 2.5 is poor).
* '''SunAltitude''' (float): The altitude of the Sun in degrees. Negative values indicate the Sun is below the horizon.   
* '''MoonAltitude''' (float): The altitude of the Moon in degrees. Negative values indicate the Moon is below the horizon.
* '''MoonPhase''' (float): The phase of the Moon, measured as a percentage (0-100%).
* '''ZenithGalacticLatitude''' (float): The galactic latitude at the zenith, used to describe the position relative to the galactic plane.
* '''NightBestNSB''' (float): The best NSB value for the night. 
* '''NightBestNSBTime''' (string): The timestamp of when the best NSB conditions occur during the night. 
* '''NightBestNSBZGL''' (float): The Zenith Galactic Latitude associated with the best NSB value. 
* '''OverallBestNSB''' (float): The overall best NSB value over a longer period, representing the best observing conditions overall.
* '''OverallBestNSBTime''' (string): The timestamp of when the overall best NSB conditions occur. 
* '''OverallBestNSBZGL''' (float): The Zenith Galactic Latitude associated with the overall best NSB value.


average (Averaged Historical Data)
'''average (Averaged Historical Data)'''
* '''avgHum''' (float): The average relative humidity in percentage since monitoring began.   
* '''avgHum''' (float): Average humidity (%) since monitoring began.   
* '''avgWind''' (float): The average wind speed in kilometer per hour (km/h) since monitoring began.   
* '''avgWind''' (float): Average wind speed (km/h) since monitoring began.   
* '''avgTemp''' (float): The average temperature in degrees Celsius since monitoring began.   
* '''avgTemp''' (float): Average temperature (°C) since monitoring began.   
* '''monitoringStart''' (string): The timestamp marking the start of monitoring, formatted as yyyy-mm-dd hh:mm:ss.
* '''monitoringStart''' (string): Start timestamp for monitoring (yyyy-mm-dd hh:mm:ss).


=== Example Response ===
=== Example Response ===
<pre>
{
{
     "weather": {
     "weather": {
         "cloudwatcher": {
         "cloudwatcher": {
             "clouds": -17.18,
             "clouds": -16.13,
             "temp": 36.33,
             "temp": 17.38,
             "wind": 3,
             "wind": 4,
             "gust": 5,
             "gust": 5,
             "rain": 5094,
             "rain": 5248,
             "light": 2,
             "light": 57232,
             "switch": 1,
             "switch": 1,
             "safe": 1,
             "safe": 1,
             "hum": 14,
             "hum": 5,
             "dewp": 4.6,
             "dewp": -22.72,
             "cloudsState": "Clear",
             "cloudsState": "Clear",
             "rainState": "Dry",
             "rainState": "Dry",
             "lightState": "Sunny"
             "lightState": "Dark"
         },
         },
         "ninox": {
         "ninox": {
             "UTC": "24-11-15 09:05:52",
             "UTC": "2025-05-10 07:04:09",
             "NSBNow": 15.96,
             "NSBNow": 19.45,
             "SunAltitude": -8,
             "SunAltitude": -55.2,
             "MoonAltitude": 0.3,
             "MoonAltitude": 29,
             "MoonPhase": 99.5,
             "MoonPhase": 94.8,
             "ZenithGalacticLatitude": -0.9,
             "ZenithGalacticLatitude": 1.9,
             "NightBestNSB": 19.43,
             "NightBestNSB": 19.46,
             "NightBestNSBTime": "24-11-15 08:28:44",
             "NightBestNSBTime": "2025-05-10 07:02:02",
             "NightBestNSBZGL": -7,
             "NightBestNSBZGL": 1.9,
             "OverallBestNSB": 24.1,
             "OverallBestNSB": 21.15,
             "OverallBestNSBTime": "24-05-07 23:17:28",
             "OverallBestNSBTime": "2025-05-08 09:00:13",
             "OverallBestNSBZGL": 16.2
             "OverallBestNSBZGL": -19.2
        },
        "seeing": {
            "UTC": "2025-05-10 03:16:14",
            "SeeingValue": 1.48
         },
         },
         "average": {
         "average": {
             "avgHum": 26.43,
             "avgHum": 26.94,
             "avgWind": 6.81,
             "avgWind": 6.8,
             "avgTemp": 19.21,
             "avgTemp": 19.16,
             "monitoringStart": "2023-01-03 22:41:01"
             "monitoringStart": "2023-05-10 09:11:02"
         }
         }
     }
     }
}
}
</pre>


=== Error Handling ===
=== Error Handling ===
If an error occurs while fetching the data, the API will return a generic HTTP error response (e.g., 500 Internal Server Error).
If an error occurs while fetching the data, the API will return a generic HTTP error response (e.g., 500 Internal Server Error).


=== Example Request ===
=== Example Request ===
To retrieve the current weather and astronomical data, make a simple GET request to the following endpoint:
To retrieve the current weather and astronomical data:
GET http://api.deepskychile.com/weather
<code>GET http://api.deepskychile.com/weather</code>
 
=== Authentication ===
Currently, the API does not require authentication. Any future authentication requirements will be detailed here.


=== Conclusion ===
=== Authentication ===
This API provides both weather and astronomical data to help with sky observations and general weather monitoring at Deep Sky Chile. It allows users to track cloud coverage, temperature, rain, light levels, and other important factors for stargazing, as well as obtain detailed astronomical conditions such as NSB, Sun and Moon altitudes, and phase data.
Currently, the API does not require authentication. Any future requirements will be documented here.


If you need further assistance or have additional questions about using the API, feel free to reach out.
=== Conclusion === 
This API provides detailed weather, seeing, and astronomical data to support stargazing, observatory operations, and long-term monitoring at Deep Sky Chile.


[[Category:User manuals]]
[[Category:User manuals]]

Revision as of 09:11, 10 May 2025

Deep Sky Chile Weather API User Manual

The Deep Sky Chile Weather API provides real-time weather and astronomical data, including cloud cover, temperature, wind speed, rain, light levels, seeing conditions, and key astronomical measurements.

Base URL

The base URL for accessing the API is: http://api.deepskychile.com/weather

Endpoint

  • GET /weather: Retrieves the current weather and astronomical data, including cloud, rain, light states, seeing, and important astronomical metrics.

Response Format

The API returns data in JSON format with the following structure:

{
    "weather": {
        "cloudwatcher": {
            "clouds": <clouds_value>,
            "temp": <temperature_value>,
            "wind": <wind_speed>,
            "gust": <wind_gust>,
            "rain": <rain_value>,
            "light": <light_level>,
            "switch": <switch_state>,
            "safe": <safe_state>,
            "hum": <humidity>,
            "dewp": <dew_point>,
            "cloudsState": "<clouds_state>",
            "rainState": "<rain_state>",
            "lightState": "<light_state>"
        },
        "ninox": {
            "UTC": "<utc_time>",
            "NSBNow": <current_NSB_value>,
            "SunAltitude": <sun_altitude>,
            "MoonAltitude": <moon_altitude>,
            "MoonPhase": <moon_phase>,
            "ZenithGalacticLatitude": <galactic_latitude>,
            "NightBestNSB": <best_NSB_value>,
            "NightBestNSBTime": "<night_best_NSB_time>",
            "NightBestNSBZGL": <night_best_ZGL>,
            "OverallBestNSB": <overall_best_NSB_value>,
            "OverallBestNSBTime": "<overall_best_NSB_time>",
            "OverallBestNSBZGL": <overall_best_ZGL>
        },
        "seeing": {
            "UTC": "<seeing_utc_time>",
            "SeeingValue": <seeing_value>
        },
        "average": {
            "avgHum": <average_humidity>,
            "avgWind": <average_wind_speed>,
            "avgTemp": <average_temperature>,
            "monitoringStart": "<monitoring_start_date>"
        }
    }
}

Fields

weather The main object containing weather data from four sources: cloudwatcher, ninox, seeing, and average.

cloudwatcher (General Weather Data)

  • clouds (float): Current sky temperature in degrees Celsius.
  • temp (float): Current temperature in degrees Celsius.
  • wind (float): Wind speed in km/h.
  • gust (float): Wind gust speed in km/h.
  • rain (float): Rain value (unitless).
  • light (float): Ambient light level (unitless).
  • switch (integer): Lock switch status:
 * 1: Observatories are unlocked.  
 * 0: Observatories are locked.  
  • safe (integer): Safety status:
 * 1: Safe.  
 * 0: Unsafe.  
  • hum (float): Relative humidity (%).
  • dewp (float): Dew point temperature in degrees Celsius.
  • cloudsState (string):
 * "Clear": Low cloud cover.  
 * "Cloudy": Moderate cloud cover.  
 * "Overcast": High cloud cover or fully covered skies.  
  • rainState (string):
 * "Dry": Rain > 2000.  
 * "Wet": Rain between 1700 and 2000.  
 * "Raining": Rain < 1700.  
  • lightState (string):
 * "Dark": Light > 8000.  
 * "Bright": Light between 6 and 8000.  
 * "Sunny": Light <= 6.  

ninox (Astronomical Data)

  • UTC (string): Current UTC time, format: yy-mm-dd hh:mm:ss.
  • NSBNow (float): Current sky brightness (NSB) value. Lower values indicate better observing conditions.
  • SunAltitude (float): Altitude of the Sun in degrees.
  • MoonAltitude (float): Altitude of the Moon in degrees.
  • MoonPhase (float): Moon phase in percentage (0–100%).
  • ZenithGalacticLatitude (float): Galactic latitude at zenith.
  • NightBestNSB (float): Best NSB value for the current night.
  • NightBestNSBTime (string): Time of best NSB value.
  • NightBestNSBZGL (float): Zenith galactic latitude at best NSB time.
  • OverallBestNSB (float): Best overall NSB recorded.
  • OverallBestNSBTime (string): Time of overall best NSB.
  • OverallBestNSBZGL (float): Galactic latitude at overall best NSB.

seeing (Atmospheric Seeing Conditions)

  • UTC (string): UTC time of the seeing measurement.
  • SeeingValue (float): Seeing value in arcseconds. Lower values indicate better seeing (e.g., 1.0 is excellent, 2.5 is poor).

average (Averaged Historical Data)

  • avgHum (float): Average humidity (%) since monitoring began.
  • avgWind (float): Average wind speed (km/h) since monitoring began.
  • avgTemp (float): Average temperature (°C) since monitoring began.
  • monitoringStart (string): Start timestamp for monitoring (yyyy-mm-dd hh:mm:ss).

Example Response

{
    "weather": {
        "cloudwatcher": {
            "clouds": -16.13,
            "temp": 17.38,
            "wind": 4,
            "gust": 5,
            "rain": 5248,
            "light": 57232,
            "switch": 1,
            "safe": 1,
            "hum": 5,
            "dewp": -22.72,
            "cloudsState": "Clear",
            "rainState": "Dry",
            "lightState": "Dark"
        },
        "ninox": {
            "UTC": "2025-05-10 07:04:09",
            "NSBNow": 19.45,
            "SunAltitude": -55.2,
            "MoonAltitude": 29,
            "MoonPhase": 94.8,
            "ZenithGalacticLatitude": 1.9,
            "NightBestNSB": 19.46,
            "NightBestNSBTime": "2025-05-10 07:02:02",
            "NightBestNSBZGL": 1.9,
            "OverallBestNSB": 21.15,
            "OverallBestNSBTime": "2025-05-08 09:00:13",
            "OverallBestNSBZGL": -19.2
        },
        "seeing": {
            "UTC": "2025-05-10 03:16:14",
            "SeeingValue": 1.48
        },
        "average": {
            "avgHum": 26.94,
            "avgWind": 6.8,
            "avgTemp": 19.16,
            "monitoringStart": "2023-05-10 09:11:02"
        }
    }
}

Error Handling

If an error occurs while fetching the data, the API will return a generic HTTP error response (e.g., 500 Internal Server Error).

Example Request

To retrieve the current weather and astronomical data: GET http://api.deepskychile.com/weather

Authentication

Currently, the API does not require authentication. Any future requirements will be documented here.

Conclusion

This API provides detailed weather, seeing, and astronomical data to support stargazing, observatory operations, and long-term monitoring at Deep Sky Chile.