What Is an API?
Follow a real public API request and see how software uses the response.
A weather app, for example, can ask a service for a forecast and use the response to fill in its screen.

- Request
- Ask for moon phases for 2026
- Response
- Read the phasedata list in JSON
- Use
- Convert a full moon time to the reader’s time zone
Step by step
Start with the request
In the U.S. Naval Observatory example, the address ends in /api/moon/phases/year?year=2026. The path says which dataset you want. The year=2026 part selects a year. This is a read-only request for public data.
Read the response
The service returns structured data in JSON. In the 2026 result, the phasedata list contains records with fields for the phase, month, day, year and time. One record reports a full moon on November 24 at 14:53 Universal Time.
Turn data into something a person can use
An app could select the records marked Full Moon, convert the times to the user’s time zone, and display a short calendar. The API provides the data. The app decides which details to show and how to label them.
Check how the API handles errors
Documentation explains which requests are supported and which inputs are required. An app should check that the request succeeded and handle missing information before treating a response as usable data.
Official instructions and references · U.S. Naval Observatory API documentation · Example USNO JSON response