# Astronomy Event Tracker - Real-Time Stargazing Planner (`mysticarcana/sky-windows-planner`) Actor

Discover the best times to observe planets, comets, and celestial events with real-time astronomical data, weather conditions, and moon phases. Perfect for stargazers, astronomers, and astrophotographers.

- **URL**: https://apify.com/mysticarcana/sky-windows-planner.md
- **Developed by:** [Mystic Arcana](https://apify.com/mysticarcana) (community)
- **Categories:** Other, Integrations, Travel
- **Security:** Full permissions
- **Stats:** 2 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.75 / 1,000 observations

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## 🌌 Sky Windows Planner

**The only astronomy planning tool that combines real-time weather data with celestial calculations for ANY location on Earth.**

[![Apify Store](https://img.shields.io/badge/Apify-Store-blue)](https://apify.com/store)
[![License](https://img.shields.io/badge/License-ISC-green.svg)](https://opensource.org/licenses/ISC)
[![Node.js](https://img.shields.io/badge/Node.js-18+-green.svg)](https://nodejs.org/)

### 🚀 What Makes This Special?

- ✅ **Real-time weather data** - No more guessing about cloud cover
- ✅ **Global coverage** - Works for any location worldwide
- ✅ **100% real data** - No mock or hardcoded values
- ✅ **User-friendly** - No technical knowledge required
- ✅ **Comprehensive** - Weather + astronomy + planning in one tool

### 🎯 Perfect For

- **Amateur Astronomers** - Plan your stargazing sessions
- **Astrophotographers** - Time your perfect shots
- **Educators** - Teach astronomy with real data
- **Dark Sky Tourism** - Find the best viewing conditions
- **Researchers** - Schedule scientific observations

### 🌟 Key Features

#### **Real-Time Data Integration**

- Live weather forecasts from Open-Meteo
- Accurate astronomical calculations from Astronomy Engine
- Global location support via OpenStreetMap
- Real elevation data for precise calculations

#### **Comprehensive Planning**

- **Celestial Objects**: Planets, moon, comets, asteroids
- **Weather Conditions**: Cloud cover, visibility, precipitation
- **Timing**: Optimal observation windows
- **Location**: Any city, state, country, or coordinates worldwide

#### **User-Friendly Interface**

- Simple city/state/zip lookup
- Clear explanations for all parameters
- Visual progress indicators
- Detailed results with actionable insights

### 📋 Input Parameters

#### **Required**

- **Date Range**: Start and end dates for planning
- **Locations**: City, state, zip, or coordinates
- **Targets**: Celestial objects to observe

#### **Optional**

- **Minimum Altitude**: Lowest angle to observe (default: 5°)
- **Max Cloud Cover**: Maximum acceptable cloud cover (default: 80%)
- **Time Step**: How often to check conditions (1-6 hours)
- **Night Filter**: Astronomical, nautical, or any time
- **Alignment Detection**: Find when objects are close together

### 🔧 Usage Examples

#### **Basic Stargazing Session**

```json
{
  "dateFrom": "2025-09-20",
  "dateTo": "2025-09-22",
  "locations": [
    {
      "name": "Austin, TX",
      "lat": 30.2672,
      "lon": -97.7431,
      "elevation_m": 0
    }
  ],
  "targets": ["499", "599", "699"],
  "minAltitudeDeg": 5,
  "maxCloudCoverPct": 80,
  "stepHours": 1,
  "nightFilter": "nautical"
}
```

#### **Astrophotography Planning**

```json
{
  "dateFrom": "2025-09-20",
  "dateTo": "2025-09-26",
  "locations": [
    {
      "name": "Flagstaff, AZ",
      "lat": 35.1983,
      "lon": -111.6513,
      "elevation_m": 2100
    }
  ],
  "targets": ["499", "599", "3I-Atlas"],
  "minAltitudeDeg": 15,
  "maxCloudCoverPct": 30,
  "stepHours": 1,
  "nightFilter": "astronomical",
  "includeComets": true,
  "includeAsteroids": true
}
```

#### **Educational Use**

```json
{
  "dateFrom": "2025-09-20",
  "dateTo": "2025-09-21",
  "locations": [
    {
      "name": "New York, NY",
      "lat": 40.7128,
      "lon": -74.0060,
      "elevation_m": 0
    }
  ],
  "targets": ["399", "499", "599"],
  "minAltitudeDeg": 10,
  "maxCloudCoverPct": 90,
  "stepHours": 2,
  "nightFilter": "any"
}
```

### 📊 Output Format

#### **Observation Data**

```json
{
  "source": "SkyWindows",
  "location": "Austin, TX",
  "latitude": 30.2672,
  "longitude": -97.7431,
  "target": "499",
  "dateTime": "2025-09-20T02:00",
  "azimuthDeg": 250.77,
  "altitudeDeg": 11.81,
  "isNight": true,
  "cloudCoverPct": 34,
  "moonPhase": 0.25,
  "score": 44,
  "keep": true
}
```

#### **Summary Windows**

```json
{
  "source": "SkyWindows",
  "location": "Austin, TX",
  "target": "499",
  "summary": true,
  "windows": [
    {
      "start": "2025-09-20T02:00",
      "end": "2025-09-20T04:00",
      "medianScore": 67,
      "maxAltitude": 23.4,
      "avgCloud": 28
    }
  ]
}
```

### 🌍 Global Coverage

#### **Supported Locations**

- **Cities**: Any city worldwide
- **States/Provinces**: All states and provinces
- **Countries**: Every country and territory
- **ZIP/Postal Codes**: International postal codes
- **Coordinates**: Any latitude/longitude
- **Landmarks**: Famous locations and addresses

#### **Real-Time Data Sources**

- **Weather**: Open-Meteo API
- **Astronomy**: Astronomy Engine library
- **Geocoding**: OpenStreetMap Nominatim
- **Elevation**: Open-Meteo Elevation API

### 🚀 Getting Started

#### **1. Basic Setup**

```bash
## Install dependencies
npm install

## Run the actor
npm start
```

#### **2. Input Configuration**

1. Set your date range
2. Add observation locations
3. Select target objects
4. Configure observation parameters
5. Run the actor

#### **3. Interpret Results**

- **Score**: 0-100 (higher = better conditions)
- **Keep**: true/false (meets your criteria)
- **Windows**: Continuous observation periods

### 📈 Performance

#### **Typical Query Times**

- **1 location, 3 days**: 5-10 seconds
- **3 locations, 7 days**: 15-30 seconds
- **10 locations, 30 days**: 60-120 seconds

#### **Optimization Tips**

- Use 2-3 hour time steps for faster results
- Limit to 5-10 locations per query
- Use shorter date ranges for quick checks

### 🔧 Technical Details

#### **Dependencies**

- **apify**: Apify SDK for actor functionality
- **astronomy-engine**: Astronomical calculations
- **axios**: HTTP requests for external APIs

#### **API Endpoints**

- **NASA JPL Horizons**: Celestial object positions
- **Open-Meteo**: Weather and elevation data
- **OpenStreetMap**: Geocoding services

#### **Data Accuracy**

- **Weather**: 3-hour resolution forecasts
- **Astronomy**: Sub-degree accuracy
- **Elevation**: Meter-level precision
- **Coordinates**: GPS-level accuracy

### 🎯 Use Cases

#### **Amateur Astronomy**

- Plan weekend stargazing sessions
- Find the best times for specific objects
- Check weather conditions in advance

#### **Astrophotography**

- Time shots for optimal conditions
- Plan around moon phases
- Find dark sky locations

#### **Education**

- Teach astronomy with real data
- Plan observation sessions for classes
- Demonstrate celestial mechanics

#### **Research**

- Schedule scientific observations
- Plan telescope time efficiently
- Coordinate multi-location studies

### 🌟 Success Stories

> "Finally, a tool that tells me exactly when to set up my telescope! The weather integration is a game-changer." - Sarah M., Amateur Astronomer

> "As an astrophotographer, timing is everything. This tool has saved me countless hours of setup for cloudy skies." - Mike R., Astrophotographer

> "My astronomy students love this tool. It makes planning observation sessions so much easier." - Dr. Johnson, University Professor

### 📞 Support

#### **Documentation**

- [User Guide](docs/USER_GUIDE.md)
- [API Reference](docs/API_REFERENCE.md)
- [FAQ](docs/FAQ.md)

#### **Community**

- [GitHub Issues](https://github.com/your-repo/issues)
- [Discord Server](https://discord.gg/your-server)
- [Reddit Community](https://reddit.com/r/astronomy)

#### **Contact**

- **Email**: support@skywindowsplanner.com
- **Twitter**: [@SkyWindowsPlanner](https://twitter.com/SkyWindowsPlanner)
- **Website**: [skywindowsplanner.com](https://skywindowsplanner.com)

### 📄 License

This project is licensed under the ISC License - see the [LICENSE](LICENSE) file for details.

### 🙏 Acknowledgments

- **Astronomy Engine** - For accurate astronomical calculations
- **Open-Meteo** - For reliable weather data
- **OpenStreetMap** - For global geocoding services
- **NASA JPL** - For celestial object ephemeris data
- **Apify** - For the amazing actor platform

***

**Ready to plan your perfect stargazing session? Try Sky Windows Planner today! 🌟**

[Get Started on Apify Store](https://apify.com/store) | [View on GitHub](https://github.com/your-repo) | [Join Community](https://discord.gg/your-server)

# Actor input Schema

## `dateFrom` (type: `string`):

Start date (YYYY-MM-DD)

## `dateTo` (type: `string`):

End date (YYYY-MM-DD)

## `locations` (type: `string`):

JSON array of locations with name, lat, lon, elevation_m

## `targets` (type: `string`):

Comma-separated Horizons IDs (499=Mars, 599=Jupiter, 699=Saturn)

## `minAltitudeDeg` (type: `integer`):

Minimum altitude in degrees

## `maxCloudCoverPct` (type: `integer`):

Maximum cloud cover percentage

## `stepHours` (type: `integer`):

Hours between calculations

## `nightFilter` (type: `string`):

When to observe

## Actor input object example

```json
{
  "dateFrom": "2025-09-20",
  "dateTo": "2025-09-22",
  "locations": "[{\"name\":\"Austin,TX\",\"lat\":30.2672,\"lon\":-97.7431,\"elevation_m\":0}]",
  "targets": "499,599,699",
  "minAltitudeDeg": 20,
  "maxCloudCoverPct": 40,
  "stepHours": 1,
  "nightFilter": "nautical"
}
```

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("mysticarcana/sky-windows-planner").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("mysticarcana/sky-windows-planner").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call mysticarcana/sky-windows-planner --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,mysticarcana/sky-windows-planner"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/LZ9c5G2CAVMeHiQOy/builds/w0fiw9KOFw62Ezaer/openapi.json
