# JSON Output Guide
Use JSON format for machine-readable output and scripting.
## Basic Usage
```bash
solunatus --city "New York" --json
```
## Output Structure
JSON output includes:
- `location` - Latitude, longitude, city name
- `datetime` - Current time, timezone, date
- `events` - Upcoming astronomical events
- `positions` - Current sun and moon positions
- `moon` - Moon phase, illumination, distance
- `lunar_phases` - Monthly phase calendar
## Piping to Other Tools
### Parse with `jq`
```bash
# Get just events
# Get sunrise time
# Get moon phase
### Export to File
```bash
solunatus --city "London" --json > london_astronomy.json
```
### Use in Shell Scripts
```bash
#!/bin/bash
DATA=$(solunatus --city "Sydney" --json)
```
## Use Cases
- Integrate with other applications
- Build custom visualizations
- Automate astronomical alerts
- Store historical data
- Web application backends
## See Also
- **[CLI Reference](cli-reference.md)** - All command options
- **[Features](README.md)** - Available data