Testing Western API - Moon Phase Calendar API Using Postman

Explore moon phases and transitions to better align your activities, moods, and energy with the lunar cycle.

 Last updated : 17 Apr, 2025

 

1. Securing Your API Key

To start, you need an API key. Head over to https://divineapi.com/ and register to initiate your 7-day trial.

  • Select the APIs you are interested in; you can change these selections at any time. You can add or remove APIs in the future.
  • Click on checkout, fill out the sign-up form, and enter your payment details on the next page.

Your trial will begin immediately. You won't be charged during the trial period, and you can cancel anytime without incurring any charges.

Detail Page
Detail Page

 

2. Importing the Postman Collection

Import our Postman collection to facilitate your API testing:

  • After logging into your Postman account:
  • Open This link: https://documenter.getpostman.com/view/27195761/2sA3Qs8rfV 
  • Click “Run in Postman” and then select “Run in Web”.
  • Select your workspace and then select ‘import’.
Detail Page
Detail Page
Detail Page

 

3. Configuring Your API Request

Once the collection is imported:

  • Locate the "Ascendant Report" API request.
  • Ensure the method is set to POST.
  • Use this request URL
https://astroapi-4.divineapi.com/western-api/v1/moon-phase-calendar
Detail Page
Detail Page

 

4. Setting Request Parameters

This API call necessitates only your API key. To find your API key.

  • Go to your DivineAPI dashboard >  API Key page.
  • Click on “Copy” next to the API key

 Notice the difference between the key, and the Access Token.

Detail Page
Detail Page

Go back to Postman to set the parameters.

  • Navigate to “Authorization”, select “Bearer Token” in the Auth type, and then add the token from your Divine API profile.
  • Navigate to 'Body', select 'form_data', and then add:
    • api_key: “<Your_API_Key>” - Your unique API subscription identifier.
    • month: “05” - Enter the month of birth.
    • year: "2023" - The year of interest.
    • place: “New Delhi” - The name of the city.
    • lat: "28.6139" - Latitude for location-specific details.
    • lon: "77.2090" - Longitude for accurate location insights.
    • tzone: "5.5" - Timezone offset from UTC.
    • lan: “en” - Enter the language.
  • Please ensure that the bearer token is exactly the same as in your profile, with no changes in spacing or formatting.
Use translator for other language:
Update translator:  https://divineapi.com/translator

en  For English
hi  For Hindi
pt For Portuguese
fr For French
de For German
ja For Japanese  
tr For turkish
ru For Russian
it For Italian
es For Spanish
nl For Dutch
pl For Polish 
Detail Page
Detail Page

 

5. Making the Request

Hit the 'Send' button to submit your request.

Detail Page

 

6. Deciphering the Response

The API's response will be structured as follows:

{
   "success": 1,
   "data": {
       "month_phases": [
           {
               "date": "2025-04-01",
               "phase_no": 2,
               "phase_name": "Waxing Crescent Moon",
               "phase_degree": 32.6735,
               "moon_age": 2,
               "illumination": 4.46
           },
           {
               "date": "2025-04-02",
               "phase_no": 2,
               "phase_name": "Waxing Crescent Moon",
               "phase_degree": 46.5447,
               "moon_age": 3,
               "illumination": 9.85
           },
           {
               "date": "2025-04-03",
               "phase_no": 2,
               "phase_name": "Waxing Crescent Moon",
               "phase_degree": 60.0906,
               "moon_age": 4,
               "illumination": 17.04
           },
           {
               "date": "2025-04-04",
               "phase_no": 2,
               "phase_name": "Waxing Crescent Moon",
               "phase_degree": 73.2433,
               "moon_age": 5,
               "illumination": 25.73
           },
           {
               "date": "2025-04-05",
               "phase_no": 3,
               "phase_name": "First Quarter Moon",
               "phase_degree": 85.9783,
               "moon_age": 6,
               "illumination": 35.5
           },
           {
               "date": "2025-04-06",
               "phase_no": 4,
               "phase_name": "Waxing Gibbous Moon",
               "phase_degree": 98.308,
               "moon_age": 7,
               "illumination": 45.94
           },
           {
               "date": "2025-04-07",
               "phase_no": 4,
               "phase_name": "Waxing Gibbous Moon",
               "phase_degree": 110.2699,
               "moon_age": 8,
               "illumination": 56.55
           },
           {
               "date": "2025-04-08",
               "phase_no": 4,
               "phase_name": "Waxing Gibbous Moon",
               "phase_degree": 121.9165,
               "moon_age": 9,
               "illumination": 66.87
           },
           {
               "date": "2025-04-09",
               "phase_no": 4,
               "phase_name": "Waxing Gibbous Moon",
               "phase_degree": 133.3055,
               "moon_age": 10,
               "illumination": 76.43
           },
           {
               "date": "2025-04-10",
               "phase_no": 4,
               "phase_name": "Waxing Gibbous Moon",
               "phase_degree": 144.4938,
               "moon_age": 11,
               "illumination": 84.8
           },
           {
               "date": "2025-04-11",
               "phase_no": 4,
               "phase_name": "Waxing Gibbous Moon",
               "phase_degree": 155.5335,
               "moon_age": 12,
               "illumination": 91.59
           },
           {
               "date": "2025-04-12",
               "phase_no": 4,
               "phase_name": "Waxing Gibbous Moon",
               "phase_degree": 166.4707,
               "moon_age": 13,
               "illumination": 96.52
           },
           {
               "date": "2025-04-13",
               "phase_no": 5,
               "phase_name": "Full Moon",
               "phase_degree": 177.3452,
               "moon_age": 14,
               "illumination": 100
           },
           {
               "date": "2025-04-14",
               "phase_no": 6,
               "phase_name": "Waning Gibbous Moon",
               "phase_degree": 188.1924,
               "moon_age": 15,
               "illumination": 99.94
           },
           {
               "date": "2025-04-15",
               "phase_no": 6,
               "phase_name": "Waning Gibbous Moon",
               "phase_degree": 199.0452,
               "moon_age": 16,
               "illumination": 98.28
           },
           {
               "date": "2025-04-16",
               "phase_no": 6,
               "phase_name": "Waning Gibbous Moon",
               "phase_degree": 209.937,
               "moon_age": 17,
               "illumination": 94.45
           },
           {
               "date": "2025-04-17",
               "phase_no": 6,
               "phase_name": "Waning Gibbous Moon",
               "phase_degree": 220.9043,
               "moon_age": 18,
               "illumination": 88.62
           },
           {
               "date": "2025-04-18",
               "phase_no": 6,
               "phase_name": "Waning Gibbous Moon",
               "phase_degree": 231.9892,
               "moon_age": 19,
               "illumination": 81.04
           },
           {
               "date": "2025-04-19",
               "phase_no": 6,
               "phase_name": "Waning Gibbous Moon",
               "phase_degree": 243.24,
               "moon_age": 20,
               "illumination": 72.06
           },
           {
               "date": "2025-04-20",
               "phase_no": 6,
               "phase_name": "Waning Gibbous Moon",
               "phase_degree": 254.7118,
               "moon_age": 21,
               "illumination": 62.09
           },
           {
               "date": "2025-04-21",
               "phase_no": 7,
               "phase_name": "Last Quarter Moon",
               "phase_degree": 266.4642,
               "moon_age": 22,
               "illumination": 51.57
           },
           {
               "date": "2025-04-22",
               "phase_no": 8,
               "phase_name": "Waning Crescent Moon",
               "phase_degree": 278.5569,
               "moon_age": 23,
               "illumination": 40.98
           },
           {
               "date": "2025-04-23",
               "phase_no": 8,
               "phase_name": "Waning Crescent Moon",
               "phase_degree": 291.043,
               "moon_age": 24,
               "illumination": 30.8
           },
           {
               "date": "2025-04-24",
               "phase_no": 8,
               "phase_name": "Waning Crescent Moon",
               "phase_degree": 303.9585,
               "moon_age": 25,
               "illumination": 21.48
           },
           {
               "date": "2025-04-25",
               "phase_no": 8,
               "phase_name": "Waning Crescent Moon",
               "phase_degree": 317.3106,
               "moon_age": 26,
               "illumination": 13.45
           },
           {
               "date": "2025-04-26",
               "phase_no": 8,
               "phase_name": "Waning Crescent Moon",
               "phase_degree": 331.0647,
               "moon_age": 27,
               "illumination": 7.07
           },
           {
               "date": "2025-04-27",
               "phase_no": 8,
               "phase_name": "Waning Crescent Moon",
               "phase_degree": 345.1364,
               "moon_age": 28,
               "illumination": 2.63
           },
           {
               "date": "2025-04-28",
               "phase_no": 1,
               "phase_name": "New Moon",
               "phase_degree": 359.3929,
               "moon_age": 0,
               "illumination": 0
           },
           {
               "date": "2025-04-29",
               "phase_no": 2,
               "phase_name": "Waxing Crescent Moon",
               "phase_degree": 13.6668,
               "moon_age": 1,
               "illumination": 1.13
           },
           {
               "date": "2025-04-30",
               "phase_no": 2,
               "phase_name": "Waxing Crescent Moon",
               "phase_degree": 27.7824,
               "moon_age": 2,
               "illumination": 4.46
           }
       ],
       "phases_change_list": [
           {
               "datetime": "2025-04-01 21:19:00",
               "phase_no": 2,
               "phase_name": "Waxing Crescent Moon",
               "phase_degree": 45
           },
           {
               "datetime": "2025-04-05 07:45:00",
               "phase_no": 3,
               "phase_name": "First Quarter Moon",
               "phase_degree": 90
           },
           {
               "datetime": "2025-04-09 03:37:00",
               "phase_no": 4,
               "phase_name": "Waxing Gibbous Moon",
               "phase_degree": 135
           },
           {
               "datetime": "2025-04-13 05:53:00",
               "phase_no": 5,
               "phase_name": "Full Moon",
               "phase_degree": 180
           },
           {
               "datetime": "2025-04-17 08:55:00",
               "phase_no": 6,
               "phase_name": "Waning Gibbous Moon",
               "phase_degree": 225
           },
           {
               "datetime": "2025-04-21 07:06:00",
               "phase_no": 7,
               "phase_name": "Last Quarter Moon",
               "phase_degree": 270
           },
           {
               "datetime": "2025-04-24 19:55:00",
               "phase_no": 8,
               "phase_name": "Waning Crescent Moon",
               "phase_degree": 315
           },
           {
               "datetime": "2025-04-28 01:02:00",
               "phase_no": 1,
               "phase_name": "New Moon",
               "phase_degree": 0
           }
       ]
   }
}

Daily Moon Phase Details: The "month_phases" array provides day-by-day moon phase data for April 2025, including the date, phase name (e.g., Waxing Crescent, Full Moon), moon age (days since New Moon), and illumination percentage.

Moon Phase Characteristics: Each entry includes the "phase_degree"—indicating the moon's angular position—and "illumination", showing how much of the moon is visible from Earth on that date.

Phase Identification by Number: "phase_no" numerically represents different moon phases (e.g., 1 = New Moon, 5 = Full Moon), helping identify transitions in the lunar cycle.

Exact Phase Transitions: The "phases_change_list" array highlights the exact datetime when major moon phase changes occur (e.g., New Moon, Full Moon), along with the degree and corresponding phase name.

Useful for Lunar Planning: This detailed data can be used for astrology insights, moon-based rituals, farming calendars, or event planning based on lunar phases.

 

7. Error Resolution

Ensure your API key is correctly entered if you encounter errors, as most issues are due to invalid or missing API keys.

8. Further Assistance

For additional support or inquiries, feel free to contact our customer service team at admin@divineapi.com.