Astrodata Service

Our Astrodata service offer the altitude, azimuth and distance to the Moon and the Sun for any specific points in time — down to the second. For the Moon you can also get the current phase of the moon, the fraction of the moon illuminated and the midpoint angle of the Moons illuminated side for any location on Earth.

Locations can be queried by:

  • Location ID (obtained by Places Service).
  • Geographical coordinates.
  • IATA and ICAO Aiport codes.

A single query can return results for up to 10 locations, and 50 different intervals.

The service provides the following data:

  • Azimuth – the horizontal direction – of the Moon and the Sun.
  • The distance from the Earth's center to the Moon and the Sun.
  • The altitude to the Moon and the Sun from an ideal horizon
  • Moon phase and illuminated fraction.
  • The midpoint angle of Moon's bright limb.

Data coverage

Browse supported locations

List all supported countries

Sample Data

Example Request: https://api.xmltime.com/astrodata?object=sun,moon&placeid=198&interval=2019-11-20T08:00:15,2019-11-26T04:30:15&version=3&out=json&prettyprint=1&accesskey={KEY}&expires={TIMESTAMP}&signature={SIGNATURE}

{
	"version": 3,
	"billing": {
		"credits": 1
	},
	"locations": [{
		"id": "198",
		"geo": {
			"name": "Philadelphia",
			"state": "Pennsylvania",
			"country": {
				"id": "us",
				"name": "United States"
			},
			"latitude": 39.952,
			"longitude": -75.164
		},
		"matchparam": "198",
		"astronomy": {
			"objects": [{
				"name": "sun",
				"results": [{
					"azimuth": 78.6,
					"altitude": -44.0,
					"distance": 147825792
				},{
					"azimuth": 347.6,
					"altitude": -70.6,
					"distance": 147658736
				}]
			},{
				"name": "moon",
				"results": [{
					"azimuth": 103.5,
					"altitude": 36.3,
					"distance": 370477,
					"illuminated": 45,
					"posangle": 252.2,
					"moonphase": "waningcrescent"
				},{
					"azimuth": 2.1,
					"altitude": -66.8,
					"distance": 371362,
					"illuminated": 0,
					"posangle": 224.7,
					"moonphase": "waningcrescent"
				}]
			}]
		}
	}]
}

Example Request: https://api.xmltime.com/astrodata?object=sun,moon&placeid=198&interval=2019-11-20T08:00:15,2019-11-26T04:30:15&version=3&out=xml&prettyprint=1&accesskey={KEY}&expires={TIMESTAMP}&signature={SIGNATURE}

<?xml version="1.0" encoding="UTF-8"?>
<data version="3">
  <billing>
    <credits>1</credits>
  </billing>
  <location id="198" matchparam="198">
    <geo>
      <name>Philadelphia</name>
      <state>Pennsylvania</state>
      <country id="us">United States</country>
      <latitude>39.952</latitude>
      <longitude>-75.164</longitude>
    </geo>
    <astronomy>
      <object name="sun">
        <result>
          <azimuth>78.6</azimuth>
          <altitude>-44.0</altitude>
          <distance>147825792</distance>
        </result>
        <result>
          <azimuth>347.6</azimuth>
          <altitude>-70.6</altitude>
          <distance>147658736</distance>
        </result>
      </object>
      <object name="moon">
        <result>
          <azimuth>103.5</azimuth>
          <altitude>36.3</altitude>
          <distance>370477</distance>
          <illuminated>45</illuminated>
          <posangle>252.2</posangle>
          <moonphase>waningcrescent</moonphase>
        </result>
        <result>
          <azimuth>2.1</azimuth>
          <altitude>-66.8</altitude>
          <distance>371362</distance>
          <illuminated>0</illuminated>
          <posangle>224.7</posangle>
          <moonphase>waningcrescent</moonphase>
        </result>
      </object>
    </astronomy>
  </location>
</data>
Terms & Conditions Copyright © Time and Date AS
All data supplied by timeanddate.com