USNO Astronomical Almanac Scraper
parseforge/usno-astronomical-almanac-scraper
Developer toolsAutomationOther
Scrapes daily sun and moon rise, set, transit, and twilight times from the USNO Astronomical Almanac for given coordinates and dates. Returns one flat row per location per day with time zone and DST adjustments.
- Total users
- 1
- Monthly active
- 1
- Total runs
- 87
- Bookmarked
- 0
- Rating
- Not rated yet
- Last modified
- 12 days ago
Overview
USNO Astronomical Almanac Scraper
Scrape sun and moon rise, set, and twilight times for any location and date range from the USNO Astronomical Almanac. Each record includes phase, illumination, and transit data, with time zone and DST adjustments. Export to CSV, JSON, Excel, or XML.
The USNO Astronomical Almanac provides authoritative solar and lunar data, but querying it manually for multiple locations and dates is slow and repetitive. This Actor reads the public almanac service directly, letting you pull structured sunrise, sunset, moonrise, moonset, and twilight times for any latitude and longitude pair across a date range. No API key or browser needed.
| Who uses it | What they scrape USNO Astronomical Almanac for |
|---|---|
| Photographers and filmmakers | Plan outdoor shoots around golden hour, blue hour, and moon phase. |
| Astronomy hobbyists | Build a local ephemeris of rise, set, and transit times for observation planning. |
| Researchers and scientists | Gather consistent solar and lunar timing data for environmental or behavioral studies. |
| App developers | Populate a database with almanac data for a weather or outdoor recreation app. |
What it does
This Actor collects daily sun and moon almanac data from the USNO for specified coordinates and dates, returning one flat row per location per day.
- ๐ Multiple locations: feed a list of latitude,longitude pairs and get a unified dataset for all of them.
- ๐ Date ranges: set a start and end date to pull a continuous daily sequence, or leave end empty for a single day.
- ๐ Time zone control: offset hours from UTC and optionally apply daylight saving time for local clock times.
- ๐ Sun and moon data: each row includes rise, set, transit, and twilight phases plus moon illumination and phase.
Results export to CSV, JSON, Excel, or XML, or straight from the API.
What you can do with USNO Astronomical Almanac data
๐ธ Plan a photography trip.
A landscape photographer pulls sunrise, sunset, and golden hour times for a list of scenic coordinates across a week to schedule the best light.
๐ญ Schedule telescope sessions.
An amateur astronomer fetches moonrise, moonset, and illumination data for their observatory location to pick nights with dark skies.
๐ Feed a research model.
An ecologist collects daily sun and moon timing for multiple field sites over a year to correlate animal activity with lunar cycles.
๐ Build a location-aware feature.
A developer scrapes almanac data for hundreds of cities to preload a hiking app with daylight and twilight information.
Why choose this scraper
| What you get | |
|---|---|
| No API registration | Reads the public USNO almanac pages directly, no account or key required. |
| Batch automation | Pull data for dozens of locations and months of dates in a single run. |
| Structured output | Every record follows a fixed schema, ready for analysis or database import. |
| Local time handling | Built-in UTC offset and DST flagging so you get clock times, not UTC. |
How it compares
No other Store actor targets USNO Astronomical Almanac the same way, so the honest comparison is with the alternatives teams actually weigh.
| USNO Astronomical Almanac Scraper | Build it in-house | By hand | |
|---|---|---|---|
| Setup | Run it now, zero config | Days of engineering | None, but hours per pull |
| When USNO Astronomical Almanac changes | Maintained for you | You fix it | You re-learn the page |
| Proxies, retries, anti-bot | Built in | Your problem | Browser only |
| Output | Fixed JSON schema, CSV/Excel export | Whatever you build | Copy-paste |
| Cost | Pay per result | Engineering time | Analyst hours |
Configure the run
Drive the Actor with one or more latitude,longitude pairs and a date range. Time zone offset and DST are applied as each record is fetched so all times match the local context. The Input tab lists every parameter.
A first run with the defaults:
{
"locations": [
"38.9,-77.0"
],
"startDate": "2026-06-08",
"maxItems": 10
}
A larger pull:
{
"locations": [
"38.9,-77.0"
],
"startDate": "2026-06-08",
"maxItems": 200
}
Pricing
Pay-per-result: $0.006 per result collected. You pay only for the results written to your dataset.
| Results collected | Approximate cost |
|---|---|
| 100 results | $0.60 |
| 1,000 results | $6.00 |
| 10,000 results | $60.00 |
New Apify accounts start with $5 in free credit.
Free users
Free-plan runs return up to 10 results as a preview. Upgrade your Apify plan to collect up to 1,000,000 results per run.
Run it
- Create a free Apify account with $5 in credit.
- Open the USNO Astronomical Almanac Scraper.
- Set your inputs and any filters, then click Start.
- Export the results as CSV, Excel, JSON, or XML from the Dataset tab.
Run it programmatically through the Apify API (run-sync-get-dataset-items) or the ApifyClient for JavaScript and Python.
Use with AI agents (MCP)
Give an AI agent live access to USNO Astronomical Almanac through the Model Context Protocol. Add the Actor to Claude, Cursor, or any MCP client:
claude mcp add --transport http apify "https://mcp.apify.com?tools=parseforge/usno-astronomical-almanac-scraper"
Then prompt it in plain language to run the scraper and read back the results.
Troubleshooting
Why am I getting no results?
Check that your latitude is between -90 and 90 and longitude between -180 and 180. Also verify the date format is YYYY-MM-DD and the start date is not in the far future.
The times in my output look wrong.
Confirm your time zone offset is correct for the location and date. If you need daylight saving time applied, make sure the DST checkbox is enabled.
The run stopped before my date range finished.
Check the maximum records limit. If it is lower than the number of location-date combinations, the Actor will stop early. Increase the limit to cover your full range.
I see an error about the USNO service.
The USNO public service may occasionally be slow or unavailable. Retry the run after a few minutes. If the problem persists, check if the USNO website itself is reachable.
FAQ
| Question | Answer |
|---|---|
| What data does the USNO Astronomical Almanac return? | It returns daily sun and moon rise, set, and transit times, the beginning and end of civil, nautical, and astronomical twilight, moon phase, and moon illumination fraction. |
| How do I format the location input? | Enter one or more locations as comma-separated latitude and longitude pairs, like '38.9,-77.0'. Latitude ranges from -90 to 90, longitude from -180 to 180. |
| Can I get data for a single date? | Yes. Set the start date and leave the end date empty. The Actor will fetch data for that one day only. |
| How does the time zone offset work? | Set the offset in hours from UTC. For US Eastern Standard Time use -5. The returned times will be shifted accordingly, and you can optionally apply daylight saving time. |
| Does this Actor handle daylight saving time? | Yes. Enable the DST checkbox to shift times forward by one hour and mark each record with a DST flag in the output. |
| What is the maximum number of records I can pull? | You can set a limit up to 1,000,000 records per run. One record is produced per location per date. |
| Do I need an API key or account? | No. The Actor reads the publicly available USNO almanac web service. No registration, API key, or authentication is required. |
| What export formats are supported? | You can export your dataset in CSV, JSON, Excel, or XML format from the Apify platform. |
| Can I scrape data for locations outside the United States? | Yes. The USNO almanac service works for any valid latitude and longitude worldwide. |
Related actors
Browse the full ParseForge collection for more scrapers.
๐ Need help? Email parseforge@protonmail.com with your run ID, your input, and what you expected.
โ ๏ธ Disclaimer. This Actor is unofficial and is not affiliated with, endorsed by, or sponsored by United States Naval Observatory. It collects only publicly available data. You are responsible for using the collected data in compliance with the source's terms of service and applicable data-protection laws, including GDPR, CCPA, and PIPL. Do not use it to collect personal data unlawfully.
Input
| Field | Type | What it does | Default |
|---|---|---|---|
| locations | array | One or more locations as 'latitude,longitude' pairs. Latitude from -90 to 90, longitude from -180 to 180. Example: '38.9,-77.0' for Washington DC. Leave empty to use 38.9,-77.0. | ["38.9,-77.0"] |
| startDate | string | First date to fetch, in YYYY-MM-DD form. Defaults to today if left empty. | 2026-06-08 |
| endDate | string | Last date to fetch, in YYYY-MM-DD form. Leave empty to fetch only the start date. A record is produced for every day in the range. | not set |
| tz | integer | Hours offset from UTC for the returned times, from -12 to 14. For example -5 for US Eastern Standard Time. Use 0 for UTC. | 0 |
| dst | boolean | When on, times are shifted one hour forward for daylight saving and marked with a DST flag in the output. | false |
| maxItems | integer | How many almanac records to collect per run. | 10 |
Pricing
from $4.00 per 1,000 results
| Charged for | What it is | Price each |
|---|---|---|
| result | Single result in the default dataset. | $0.004 to $0.006 |
Tiered: the lower figure is the price on a higher Apify plan. Billing and the free credit live on Apify.
API
One POST returns the dataset directly. Same shape for every scraper in the library, so swapping the slug is the only change.
curl -X POST "https://api.apify.com/v2/acts/parseforge~usno-astronomical-almanac-scraper/run-sync-get-dataset-items?token=$APIFY_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"helloWorld": 123
}' Examples
Input that runs as-is.
{
"helloWorld": 123
} Reviews
No reviews yet. Be the first.
Issues
We build and maintain this scraper, so a problem with it comes to us. Report it on the Apify listing and the thread stays attached to the scraper where the next person can find it: open an issue.
Broken and urgent, or you would rather not post in public? Write to parseforge@protonmail.com and it reaches the people who wrote it.
