The nasa-rs crate provides synchronous client wrappers for Nasa's Open APIs. See below for a list of supported APIs. If the client has not been implemented yet, feel free to open a PR! Check out prelude.rs for client implementation details.
nasa-rs
exposes parameter types for each supported API, which allows for easy query building and execution with the query
function:
Using the APOD API
use nasa_rs::clients::{Apod, ApodParams};
use nasa_rs::prelude::{Client, *};
fn main() {
// Create a client for the APOD endpoint
let client = Client::<Apod>::default();
// The 'parameter type' for APOD
let params = ApodParams::Date("2024-01-01");
// Query the API
let response = client.query(¶ms).unwrap();
}
For more granular control, nasa-rs
exposes the query_with
function, which accepts any type that implements QueryValues
type (see the trait definition for more details).
!warning! - not yet implemented
// ...
let client = Client::<Apod>::default();
let response = client.query_with(
vec![ ("date", "2024-01-01") ]
)
- Astronomy Picture of the Day (APOD)
- Asteroid Near-Earth Objects Web Service (NEO)
- Space Weather Database Of Notifications, Knowledge, Information (DONKI)
- Earth
- EONET
- EPIC
- Exoplanet
- Open Science Data Repository
- Insight: Mars Weather Service API
- Mars Rover Photos
- NASA Image and Video Library
- TechTransfer
- Satellite Situation Center
- SSD/CNEOS
- Techport
- TLE
- Vesta/Moon/Mars Trek WMTS