Overview
The Sunset Tracker API provides developers with programmatic access to accurate sunset times, golden hour data, and weather conditions for 195 world capitals. Build amazing applications with our reliable, fast, and easy-to-use API.
🚀 Join the Waitlist! The API is currently in development. Sign up for early access and be among the first to integrate sunset data into your applications. Early adopters get special pricing.
Why Use Our API?
Accurate
Astronomical calculations with <1 minute precision using advanced algorithms
Fast
Global CDN delivery with <100ms response times worldwide
Comprehensive
Sunset, sunrise, golden hour, blue hour, and weather data included
Reliable
99.9% uptime SLA with automatic failover and monitoring
Simple
RESTful API with JSON responses - integrate in minutes
Global
Coverage for 195 world capitals with plans to expand further
API Endpoints (Preview)
Get Sunset Time
GET /api/v1/sunset/:city
GET https://api.sunset-tracker.com/v1/sunset/london
Response:
{
"city": "London",
"country": "United Kingdom",
"coordinates": {
"latitude": 51.5074,
"longitude": -0.1278
},
"date": "2025-01-02",
"sunset": {
"utc": "16:02",
"local": "16:02",
"timestamp": 1735837320
},
"sunrise": {
"utc": "08:06",
"local": "08:06",
"timestamp": 1735808760
},
"goldenHour": {
"start": "15:02",
"end": "16:02"
},
"blueHour": {
"start": "16:17",
"end": "16:47"
},
"dayLength": "07:56",
"weather": {
"condition": "Clear",
"temperature": 8,
"cloudCover": 15,
"visibility": 10,
"viewingQuality": 5
}
}
Get Sunset by Coordinates
GET /api/v1/sunset/coordinates
GET https://api.sunset-tracker.com/v1/sunset/coordinates?lat=40.7128&lon=-74.0060
Response:
{
"coordinates": {
"latitude": 40.7128,
"longitude": -74.0060
},
"nearestCity": "Washington",
"distance": 328.5,
"sunset": { ... },
"sunrise": { ... }
}
Request Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| city | string | City name (e.g., "london", "paris") | Yes |
| lat | float | Latitude coordinate (-90 to 90) | Yes* |
| lon | float | Longitude coordinate (-180 to 180) | Yes* |
| date | string | Date in YYYY-MM-DD format (default: today) | No |
| days | integer | Number of days forecast (1-30) | No |
* Required for coordinate-based queries
Authentication
All API requests require authentication using an API key. Include your key in the request header:
curl -H "Authorization: Bearer YOUR_API_KEY" \
https://api.sunset-tracker.com/v1/sunset/tokyo
Rate Limits
Rate limits vary by plan:
- 🔹 Free: 100 requests/day
- 🔹 Starter: 10,000 requests/month
- 🔹 Professional: 100,000 requests/month
- 🔹 Enterprise: Unlimited (custom)
Pricing Plans
Free
- 100 requests/day
- Basic sunset data
- 195 capitals coverage
- Community support
Starter
- 10,000 requests/month
- Full sunset data + weather
- Golden & blue hour
- Email support
- 99.9% uptime SLA
Professional
- 100,000 requests/month
- Historical data access
- 30-day forecasts
- Priority support
- Custom integrations
Enterprise
- Unlimited requests
- Dedicated infrastructure
- White-label options
- 24/7 phone support
- Custom SLA
Use Cases
📸 Photography Apps: Help photographers plan perfect shots with golden hour timing
✈️ Travel Platforms: Show sunset times for destinations to help travelers plan activities
🌤️ Weather Apps: Enhance weather forecasts with precise sunset/sunrise data
📅 Event Planning: Plan outdoor events with confidence using accurate sunset predictions
🏠 Smart Home: Automate lighting based on actual sunset times in your location
🎮 Gaming: Create realistic day/night cycles based on real-world data
Developer Resources
Coming soon:
- 📚 Complete API documentation
- 💻 Code examples in Python, JavaScript, PHP, Ruby
- 🔧 Official SDKs and libraries
- 📊 Interactive API playground
- 🎓 Tutorials and guides
- 💬 Developer community forum
Get Early Access
🎁 Early Adopter Benefits
Join the waitlist now and receive:
- 50% off for the first 6 months
- Priority access when we launch
- Lifetime grandfathered pricing
- Input on API features
- Free migration assistance
Contact: [email protected]