API Reference
This page provides a reference for the main classes and methods in the Far Out SDK for Unity.
Core Classes
NasaClient
The main client class for interacting with NASA APIs.
Constructor
// Create with a NasaConfig ScriptableObject
public NasaClient(NasaConfig config)
// Create with a configuration provider interface
public NasaClient(INasaConfigProvider configProvider)
Methods
Astronomy Picture of the Day (APOD)
// Get today's APOD
public Task GetApodAsync()
// Get APOD for a specific date
public Task GetApodAsync(DateTime date)
// Get multiple APODs for a date range
public Task> GetApodAsync(DateTime startDate, DateTime endDate)
// Get a random APOD
public Task> GetRandomApodAsync(int count = 1)
// Download the image for an APOD
public Task GetApodTextureAsync(ApodData apod)
Mars Rover Photos
// Get photos from a specific rover, sol, and camera
public Task> GetMarsRoverPhotosAsync(
MarsRover rover,
int sol,
MarsRoverCamera? camera = null)
// Get photos from a specific rover, Earth date, and camera
public Task> GetMarsRoverPhotosAsync(
MarsRover rover,
DateTime earthDate,
MarsRoverCamera? camera = null)
// Get the latest photos from a rover
public Task> GetLatestMarsRoverPhotosAsync(
MarsRover rover,
MarsRoverCamera? camera = null)
// Download the image for a Mars rover photo
public Task GetMarsRoverPhotoTextureAsync(MarsRoverPhotoData photo)
Near Earth Objects (NEO)
// Get near Earth objects for a date range (max 7 days)
public Task GetNeoFeedAsync(DateTime startDate, DateTime endDate)
// Get a specific asteroid by ID
public Task GetNeoAsync(string asteroidId)
Earth API
// Get Earth imagery for a specific location
public Task GetEarthImageryAsync(
float lat,
float lon,
float? dim = null,
DateTime? date = null)
// Download the Earth imagery as a texture
public Task GetEarthImageryTextureAsync(EarthImageryData imagery)
// Get available Earth imagery dates for a location
public Task> GetEarthImageryDatesAsync(float lat, float lon)
EPIC (Earth Polychromatic Imaging Camera)
// Get natural color EPIC images for a date
public Task> GetEpicNaturalAsync(DateTime? date = null)
// Get enhanced color EPIC images for a date
public Task> GetEpicEnhancedAsync(DateTime? date = null)
// Get available EPIC image dates
public Task> GetEpicDatesAsync(EpicCollection collection = EpicCollection.Natural)
// Download the EPIC image as a texture
public Task GetEpicImageTextureAsync(EpicImageData image)
Data Models
The SDK uses the following data models to represent API responses:
ApodData
- Astronomy Picture of the Day dataMarsRoverPhotoData
- Mars rover photo dataNeoFeedData
- Near Earth object feed dataNeoObjectData
- Individual asteroid dataEarthImageryData
- Earth imagery dataEpicImageData
- EPIC image data
Enums
MarsRover
public enum MarsRover
{
Curiosity,
Opportunity,
Spirit,
Perseverance
}
MarsRoverCamera
public enum MarsRoverCamera
{
FHAZ, // Front Hazard Avoidance Camera
RHAZ, // Rear Hazard Avoidance Camera
MAST, // Mast Camera
CHEMCAM, // Chemistry and Camera Complex
MAHLI, // Mars Hand Lens Imager
MARDI, // Mars Descent Imager
NAVCAM, // Navigation Camera
PANCAM, // Panoramic Camera
MINITES, // Miniature Thermal Emission Spectrometer
// Perseverance cameras
EDL_RUCAM, // Rover Up-Look Camera
EDL_RDCAM, // Rover Down-Look Camera
EDL_DDCAM, // Descent Stage Down-Look Camera
EDL_PUCAM1, // Parachute Up-Look Camera A
EDL_PUCAM2, // Parachute Up-Look Camera B
NAVCAM_LEFT, // Navigation Camera - Left
NAVCAM_RIGHT, // Navigation Camera - Right
MCZ_RIGHT, // Mastcam-Z Right
MCZ_LEFT, // Mastcam-Z Left
FRONT_HAZCAM_LEFT_A, // Front Hazard Avoidance Camera - Left
FRONT_HAZCAM_RIGHT_A, // Front Hazard Avoidance Camera - Right
REAR_HAZCAM_LEFT, // Rear Hazard Avoidance Camera - Left
REAR_HAZCAM_RIGHT, // Rear Hazard Avoidance Camera - Right
SKYCAM, // MEDA Skycam
SHERLOC_WATSON // SHERLOC WATSON Camera
}
EpicCollection
public enum EpicCollection
{
Natural,
Enhanced
}
Exceptions
The SDK uses custom exceptions to provide detailed error information:
// Base exception for all NASA API errors
public class NasaApiException : Exception
// Specific exception types
public class NasaApiRateLimitException : NasaApiException
public class NasaApiKeyInvalidException : NasaApiException
public class NasaApiTimeoutException : NasaApiException
public class NasaApiNotAvailableException : NasaApiException
Back to Top