Welcome to API byHrast

Moon Phase & Position API

Get accurate moon data including phase, illumination, moonrise, and moonset times for any location and date.

  • Moon phase and illumination percentage
  • Moonrise and moonset times
  • Support for any location worldwide
  • Historical and future date calculations
  • Fast and reliable REST API
  • JSON response format
  • 🔑 API Key Access:
    After signing in, you'll receive your unique API key to make requests to our endpoints.

    Example API Request:

    GET https://astroapi.byhrast.com/moon.php?date=2024-03-25&lat=45.815399&lon=15.966568&tz=Europe/Zagreb&time=12:00&key=YOUR_API_KEY

    Example Response:

    {
        "date": "25/03/2024",
        "moonrise": "04:03",
        "moonset": "13:27",
        "phase": "Waning Crescent",
        "illumination": "24.1%",
        "phase_details": {
            "phase_angle": 1.28,
            "phase_value": 0.84,
            "fraction": 0.24
        },
        "position": {
            "azimuth": -1.72,
            "altitude": -0.70,
            "distance": 380727.22
        },
        "disclaimer": "Values are approximate and may differ from precise astronomical observations due to factors such as your elevation, atmospheric refraction, calculation precision, and location accuracy. Sea level is assumed for calculations."
    }
    Google Logo Sign in with Google