Skip to content

nikolan123/nikosatapi

Repository files navigation

Niko Sat API

N2YO-compatible satellite tracking REST API with orbital calculations using Skyfield. Drop-in replacement for N2YO API v1.

Warning

This service provides orbital data for informational and educational purposes only. The data should not be relied upon for safety-critical, mission-critical, navigation, or life-dependent applications. All calculations are estimates based on publicly available TLE data and are provided without warranty of any kind.

Features

  • N2YO-compatible endpoints - Works with existing N2YO client code
  • TLE data fetched from Celestrak
  • Accurate orbital calculations using Skyfield library
  • Real-time satellite position tracking
  • Visual and radio pass predictions
  • Transaction tracking per API key
  • All endpoints from the original API

Installation

uv sync

Running the Server

uv run python server.py

The server will start on port 5000 by default.

API Endpoints

Base URL: http://localhost:5000/rest/v1/satellite/

All endpoints require an apiKey query parameter.

1. Get TLE

GET /rest/v1/satellite/tle/:id?apiKey=YOUR_KEY

2. Get Satellite Positions

GET /rest/v1/satellite/positions/:id/:observer_lat/:observer_lng/:observer_alt/:seconds?apiKey=YOUR_KEY

Max seconds: 300

3. Get Visual Passes

GET /rest/v1/satellite/visualpasses/:id/:observer_lat/:observer_lng/:observer_alt/:days/:min_visibility?apiKey=YOUR_KEY

Max days: 10

4. Get Radio Passes

GET /rest/v1/satellite/radiopasses/:id/:observer_lat/:observer_lng/:observer_alt/:days/:min_elevation?apiKey=YOUR_KEY

Max days: 10

5. What's Up? (Above)

GET /rest/v1/satellite/above/:observer_lat/:observer_lng/:observer_alt/:search_radius/:category_id?apiKey=YOUR_KEY

Search radius: 0-90 degrees

Example Usage

# Get TLE for ISS (NORAD ID 25544)
curl "http://localhost:5000/rest/v1/satellite/tle/25544?apiKey=test-key"

# Get positions
curl "http://localhost:5000/rest/v1/satellite/positions/25544/41.702/-76.014/0/2?apiKey=test-key"

# Get visual passes
curl "http://localhost:5000/rest/v1/satellite/visualpasses/25544/41.702/-76.014/0/2/300?apiKey=test-key"

# Get radio passes
curl "http://localhost:5000/rest/v1/satellite/radiopasses/25544/41.702/-76.014/0/2/40?apiKey=test-key"

# Get satellites above
curl "http://localhost:5000/rest/v1/satellite/above/41.702/-76.014/0/70/18?apiKey=test-key"

Known Issues

  • The above endpoint is janky, and the launch dates show only the year.

About

N2YO-compatible API

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors