Astronomy Service

This service offers times for rise, set, noon and twilight times for sun and moon for all locations worldwide on any date.

Locations can be queried by:

  • Location id (obtained by Places Service).
  • Geographical coordinates.

A single query can return results for up to 10 locations, including sun and moon data for up to 31 days.

The service provides the following data:

  • Sunrise, sunset and twilight times and azimuth.
  • Moonrise and moonset times and azimuth.
  • Moon phase and illuminated fraction.
  • Meridian (noon) passing time, altitude and distance.
  • Antimeridian passing time (midnight).

Data coverage

Browse supported locations

List all supported countries

Sample Data

Example Request: https://api.xmltime.com/astronomy?object=sun&placeid=152&startdt=2012-03-19&enddt=2012-03-20&types=all&version=2&out=json&prettyprint=1&accesskey={KEY}&expires={TIMESTAMP}&signature={SIGNATURE}

{
  "version": 2,
  "locations": [{
    "id": "152",
    "geo": {
      "name": "Melbourne",
      "state": "Victoria",
      "country": {
        "id": "au",
        "name": "Australia"
      },
      "latitude": -37.814,
      "longitude": 144.963
    },
    "astronomy": {
      "objects": [{
        "name": "sun",
        "days": [{
          "date": "2012-03-19",
          "events": [{
            "type": "antimeridian",
            "utctime": "2012-03-18T14:28",
            "isotime": "2012-03-19T01:28+11:00",
            "hour": 1,
            "min": 28
          },{
            "type": "twi18_start",
            "utctime": "2012-03-18T18:54",
            "isotime": "2012-03-19T05:54+11:00",
            "hour": 5,
            "min": 54
          },{
            "type": "twi12_start",
            "utctime": "2012-03-18T19:25",
            "isotime": "2012-03-19T06:25+11:00",
            "hour": 6,
            "min": 25
          },{
            "type": "twi6_start",
            "utctime": "2012-03-18T19:56",
            "isotime": "2012-03-19T06:56+11:00",
            "hour": 6,
            "min": 56
          },{
            "type": "rise",
            "utctime": "2012-03-18T20:22",
            "isotime": "2012-03-19T07:22+11:00",
            "hour": 7,
            "min": 22,
            "azimuth": 91.3
          },{
            "type": "meridian",
            "utctime": "2012-03-19T02:28",
            "isotime": "2012-03-19T13:28+11:00",
            "hour": 13,
            "min": 28,
            "altitude": 52.6,
            "distance": 148942000
          },{
            "type": "set",
            "utctime": "2012-03-19T08:33",
            "isotime": "2012-03-19T19:33+11:00",
            "hour": 19,
            "min": 33,
            "azimuth": 268.9
          },{
            "type": "twi6_end",
            "utctime": "2012-03-19T08:59",
            "isotime": "2012-03-19T19:59+11:00",
            "hour": 19,
            "min": 59
          },{
            "type": "twi12_end",
            "utctime": "2012-03-19T09:30",
            "isotime": "2012-03-19T20:30+11:00",
            "hour": 20,
            "min": 30
          },{
            "type": "twi18_end",
            "utctime": "2012-03-19T10:01",
            "isotime": "2012-03-19T21:01+11:00",
            "hour": 21,
            "min": 1
          }],
          "daylength": "12:11"
        },{
          "date": "2012-03-20",
          "events": [{
            "type": "antimeridian",
            "utctime": "2012-03-19T14:28",
            "isotime": "2012-03-20T01:28+11:00",
            "hour": 1,
            "min": 28
          },{
            "type": "twi18_start",
            "utctime": "2012-03-19T18:55",
            "isotime": "2012-03-20T05:55+11:00",
            "hour": 5,
            "min": 55
          },{
            "type": "twi12_start",
            "utctime": "2012-03-19T19:26",
            "isotime": "2012-03-20T06:26+11:00",
            "hour": 6,
            "min": 26
          },{
            "type": "twi6_start",
            "utctime": "2012-03-19T19:57",
            "isotime": "2012-03-20T06:57+11:00",
            "hour": 6,
            "min": 57
          },{
            "type": "rise",
            "utctime": "2012-03-19T20:23",
            "isotime": "2012-03-20T07:23+11:00",
            "hour": 7,
            "min": 23,
            "azimuth": 90.8
          },{
            "type": "meridian",
            "utctime": "2012-03-20T02:28",
            "isotime": "2012-03-20T13:28+11:00",
            "hour": 13,
            "min": 28,
            "altitude": 52.2,
            "distance": 148984000
          },{
            "type": "set",
            "utctime": "2012-03-20T08:32",
            "isotime": "2012-03-20T19:32+11:00",
            "hour": 19,
            "min": 32,
            "azimuth": 269.4
          },{
            "type": "twi6_end",
            "utctime": "2012-03-20T08:58",
            "isotime": "2012-03-20T19:58+11:00",
            "hour": 19,
            "min": 58
          },{
            "type": "twi12_end",
            "utctime": "2012-03-20T09:28",
            "isotime": "2012-03-20T20:28+11:00",
            "hour": 20,
            "min": 28
          },{
            "type": "twi18_end",
            "utctime": "2012-03-20T09:59",
            "isotime": "2012-03-20T20:59+11:00",
            "hour": 20,
            "min": 59
          }],
          "daylength": "12:08"
        }]
      }]
    }
  }]
}

Example Request: https://api.xmltime.com/astronomy?object=sun&placeid=152&startdt=2012-03-19&enddt=2012-03-20&types=all&version=2&out=xml&prettyprint=1&accesskey={KEY}&expires={TIMESTAMP}&signature={SIGNATURE}

<?xml version="1.0" encoding="UTF-8"?>
<data version="2">
  <location id="152">
    <geo>
      <name>Melbourne</name>
      <state>Victoria</state>
      <country id="au">Australia</country>
      <latitude>-37.814</latitude>
      <longitude>144.963</longitude>
    </geo>
    <astronomy>
      <object name="sun">
        <day date="2012-03-19" daylength="12:11">
          <event type="antimeridian" utctime="2012-03-18T14:28" isotime="2012-03-19T01:28+11:00" hour="1" min="28"/>
          <event type="twi18_start" utctime="2012-03-18T18:54" isotime="2012-03-19T05:54+11:00" hour="5" min="54"/>
          <event type="twi12_start" utctime="2012-03-18T19:25" isotime="2012-03-19T06:25+11:00" hour="6" min="25"/>
          <event type="twi6_start" utctime="2012-03-18T19:56" isotime="2012-03-19T06:56+11:00" hour="6" min="56"/>
          <event type="rise" utctime="2012-03-18T20:22" isotime="2012-03-19T07:22+11:00" hour="7" min="22" azimuth="91.3"/>
          <event type="meridian" utctime="2012-03-19T02:28" isotime="2012-03-19T13:28+11:00" hour="13" min="28" altitude="52.6" distance="148942000"/>
          <event type="set" utctime="2012-03-19T08:33" isotime="2012-03-19T19:33+11:00" hour="19" min="33" azimuth="268.9"/>
          <event type="twi6_end" utctime="2012-03-19T08:59" isotime="2012-03-19T19:59+11:00" hour="19" min="59"/>
          <event type="twi12_end" utctime="2012-03-19T09:30" isotime="2012-03-19T20:30+11:00" hour="20" min="30"/>
          <event type="twi18_end" utctime="2012-03-19T10:01" isotime="2012-03-19T21:01+11:00" hour="21" min="1"/>
        </day>
        <day date="2012-03-20" daylength="12:08">
          <event type="antimeridian" utctime="2012-03-19T14:28" isotime="2012-03-20T01:28+11:00" hour="1" min="28"/>
          <event type="twi18_start" utctime="2012-03-19T18:55" isotime="2012-03-20T05:55+11:00" hour="5" min="55"/>
          <event type="twi12_start" utctime="2012-03-19T19:26" isotime="2012-03-20T06:26+11:00" hour="6" min="26"/>
          <event type="twi6_start" utctime="2012-03-19T19:57" isotime="2012-03-20T06:57+11:00" hour="6" min="57"/>
          <event type="rise" utctime="2012-03-19T20:23" isotime="2012-03-20T07:23+11:00" hour="7" min="23" azimuth="90.8"/>
          <event type="meridian" utctime="2012-03-20T02:28" isotime="2012-03-20T13:28+11:00" hour="13" min="28" altitude="52.2" distance="148984000"/>
          <event type="set" utctime="2012-03-20T08:32" isotime="2012-03-20T19:32+11:00" hour="19" min="32" azimuth="269.4"/>
          <event type="twi6_end" utctime="2012-03-20T08:58" isotime="2012-03-20T19:58+11:00" hour="19" min="58"/>
          <event type="twi12_end" utctime="2012-03-20T09:28" isotime="2012-03-20T20:28+11:00" hour="20" min="28"/>
          <event type="twi18_end" utctime="2012-03-20T09:59" isotime="2012-03-20T20:59+11:00" hour="20" min="59"/>
        </day>
      </object>
    </astronomy>
  </location>
</data>

Example Request: https://api.xmltime.com/astronomy?object=moon&placeid=152&startdt=2015-01-01&enddt=2015-01-28&types=all&version=2&out=text&template=csvsimple4&accesskey={KEY}&expires={TIMESTAMP}&signature={SIGNATURE}

Date,Rise,Set,RiseAzimuth,SetAzimuth,Meridian,Altitude,Distance,Illuminated,Phase,PhaseTime
2015-01-01,16:58,02:52,69.9,288.2,22:18,35.2,385166,86.0%,waxinggibbous,
2015-01-02,17:57,03:35,67.3,291.4,23:10,33.5,388647,92.6%,waxinggibbous,
2015-01-03,18:52,04:21,66.1,293.3,,,,,waxinggibbous,
2015-01-04,19:43,05:11,66.3,294.0,00:02,32.8,392056,97.1%,waxinggibbous,
2015-01-05,20:29,06:04,67.7,293.3,00:53,33.1,395346,99.4%,fullmoon,15:53
2015-01-06,21:10,06:58,70.1,291.4,01:42,34.4,398426,99.6%,waninggibbous,
2015-01-07,21:48,07:54,73.5,288.5,02:30,36.5,401160,97.8%,waninggibbous,
2015-01-12,,12:28,,266.0,06:08,53.9,403066,65.3%,waninggibbous,
2015-01-13,00:24,13:24,96.4,261.1,06:51,57.8,399999,55.7%,thirdquarter,20:46
2015-01-14,00:56,14:21,101.0,256.6,07:35,61.5,395708,45.7%,waningcrescent,
2015-01-15,01:31,15:19,105.3,252.5,08:22,64.8,390371,35.6%,waningcrescent,
2015-01-21,06:57,20:55,108.5,254.0,13:59,65.5,360099,0.6%,newmoon,00:13
2015-01-22,08:08,21:39,103.8,259.2,14:57,61.5,359738,4.0%,waxingcrescent,
2015-01-23,09:19,22:19,98.1,265.0,15:53,56.9,361225,10.3%,waxingcrescent,
2015-01-26,12:45,,80.2,,18:32,42.9,373343,40.4%,waxingcrescent,
2015-01-27,13:50,00:14,75.2,282.2,19:24,39.1,378464,51.8%,firstquarter,15:48
2015-01-28,14:52,00:53,71.2,286.7,20:16,36.2,383486,62.7%,waxinggibbous,
Terms & Conditions Copyright © Time and Date AS
All data supplied by timeanddate.com