Skip to content

Recommendation

For most use cases, we recommend using our software packages instead of the API directly. The libraries help organize the data returned into helpful objects, handle asynchronous requests seamlessly, deal with authentication, and lots more. The API is available for custom integrations or languages without a dedicated library.

API

We provide two main APIs, both of which are RESTful web services. First, the SRS Core API provides endpoints to support functionality such as data discovery, file URL listing, and access to the Auroral Transport Model (ATM) (available at api.phys.ucalgary.ca). Secondly, the AuroraX API provides the ability to interact with the AuroraX Data Platform, such as performing conjunction and ephemeris searches (available at api.aurorax.space)

Below are a few examples for interacting with the data distribution endpoints and the TREx ATM. If you have any questions about using the API, please reach out to us.

Postman

If you want to explore the API using Postman or a similar kind of tool, you can load in the OpenAPI specification file.

List Datasets

Retrieve available datasets, optionally filtered by name.

GET /api/v1/data_distribution/datasets

python
import requests

response = requests.get(
    "https://api.phys.ucalgary.ca/api/v1/data_distribution/datasets",
    params={"name": "THEMIS_ASI"},
)
data = response.json()
print(data)
javascript
const response = await fetch(
  "https://api.phys.ucalgary.ca/api/v1/data_distribution/datasets?name=THEMIS_ASI"
);
const data = await response.json();
console.log(data);
java
import java.net.http.*;
import java.net.URI;

HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://api.phys.ucalgary.ca/api/v1/data_distribution/datasets?name=THEMIS_ASI"))
    .GET()
    .build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
cpp
#include <cpr/cpr.h>
#include <iostream>

int main() {
    cpr::Response r = cpr::Get(
        cpr::Url{"https://api.phys.ucalgary.ca/api/v1/data_distribution/datasets"},
        cpr::Parameters{{"name", "THEMIS_ASI"}}
    );
    std::cout << r.text << std::endl;
    return 0;
}
rust
use reqwest;

#[tokio::main]
async fn main() -> Result<(), reqwest::Error> {
    let response = reqwest::get(
        "https://api.phys.ucalgary.ca/api/v1/data_distribution/datasets?name=THEMIS_ASI"
    ).await?.text().await?;
    println!("{}", response);
    Ok(())
}
go
package main

import (
    "fmt"
    "io"
    "net/http"
)

func main() {
    resp, _ := http.Get("https://api.phys.ucalgary.ca/api/v1/data_distribution/datasets?name=THEMIS_ASI")
    defer resp.Body.Close()
    body, _ := io.ReadAll(resp.Body)
    fmt.Println(string(body))
}
perl
use strict;
use warnings;
use LWP::UserAgent;
use URI;

my $uri = URI->new('https://api.phys.ucalgary.ca/api/v1/data_distribution/datasets');
$uri->query_form(name => 'THEMIS_ASI');

my $ua = LWP::UserAgent->new;
my $response = $ua->get($uri);
print $response->decoded_content;
txt
; This method is only supported on IDL 9.0+
; 
; Docs: https://www.nv5geospatialsoftware.com/docs/HttpRequest.html
response = HttpRequest.Get( $
  'https://api.phys.ucalgary.ca/api/v1/data_distribution/datasets', $
  params=hash('name', 'THEMIS_ASI'), $
  /escape $
)
print, response.status_code
print, response.text
bash
curl "https://api.phys.ucalgary.ca/api/v1/data_distribution/datasets?name=THEMIS_ASI"

List Observatories

Retrieve observatory information for a given instrument array.

GET /api/v1/data_distribution/observatories

python
import requests

response = requests.get(
    "https://api.phys.ucalgary.ca/api/v1/data_distribution/observatories",
    params={"instrument_array": "themis_asi"},
)
data = response.json()
print(data)
javascript
const response = await fetch(
  "https://api.phys.ucalgary.ca/api/v1/data_distribution/observatories?instrument_array=themis_asi"
);
const data = await response.json();
console.log(data);
java
import java.net.http.*;
import java.net.URI;

HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://api.phys.ucalgary.ca/api/v1/data_distribution/observatories?instrument_array=themis_asi"))
    .GET()
    .build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
cpp
#include <cpr/cpr.h>
#include <iostream>

int main() {
    cpr::Response r = cpr::Get(
        cpr::Url{"https://api.phys.ucalgary.ca/api/v1/data_distribution/observatories"},
        cpr::Parameters{{"instrument_array", "themis_asi"}}
    );
    std::cout << r.text << std::endl;
    return 0;
}
rust
use reqwest;

#[tokio::main]
async fn main() -> Result<(), reqwest::Error> {
    let response = reqwest::get(
        "https://api.phys.ucalgary.ca/api/v1/data_distribution/observatories?instrument_array=themis_asi"
    ).await?.text().await?;
    println!("{}", response);
    Ok(())
}
go
package main

import (
    "fmt"
    "io"
    "net/http"
)

func main() {
    resp, _ := http.Get("https://api.phys.ucalgary.ca/api/v1/data_distribution/observatories?instrument_array=themis_asi")
    defer resp.Body.Close()
    body, _ := io.ReadAll(resp.Body)
    fmt.Println(string(body))
}
perl
use strict;
use warnings;
use LWP::UserAgent;
use URI;

my $uri = URI->new('https://api.phys.ucalgary.ca/api/v1/data_distribution/observatories');
$uri->query_form(instrument_array => 'themis_asi');

my $ua = LWP::UserAgent->new;
my $response = $ua->get($uri);
print $response->decoded_content;
txt
; This method is only supported on IDL 9.0+
; 
; Docs: https://www.nv5geospatialsoftware.com/docs/HttpRequest.html
response = HttpRequest.Get( $
  'https://api.phys.ucalgary.ca/api/v1/data_distribution/observatories', $
  params=hash('instrument_array', 'themis_asi'), $
  /escape $
)
print, response.status_code
print, response.text
bash
curl "https://api.phys.ucalgary.ca/api/v1/data_distribution/observatories?instrument_array=themis_asi"

List Files for a Specific Day and Site

Retrieve data file URLs for a specific dataset, date range, and site.

GET /api/v1/data_distribution/urls

python
import requests

response = requests.get(
    "https://api.phys.ucalgary.ca/api/v1/data_distribution/urls",
    params={
        "name": "THEMIS_ASI_RAW",
        "start": "2024-01-01T00:00:00",
        "end": "2024-01-01T23:59:59",
        "site_uid": "gill",
    },
)
data = response.json()
print(data)
javascript
const params = new URLSearchParams({
  name: "THEMIS_ASI_RAW",
  start: "2024-01-01T00:00:00",
  end: "2024-01-01T23:59:59",
  site_uid: "gill",
});
const response = await fetch(
  `https://api.phys.ucalgary.ca/api/v1/data_distribution/urls?${params}`
);
const data = await response.json();
console.log(data);
java
import java.net.http.*;
import java.net.URI;

HttpClient client = HttpClient.newHttpClient();
String url = "https://api.phys.ucalgary.ca/api/v1/data_distribution/urls"
    + "?name=THEMIS_ASI_RAW"
    + "&start=2024-01-01T00:00:00"
    + "&end=2024-01-01T23:59:59"
    + "&site_uid=gill";
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create(url))
    .GET()
    .build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
cpp
#include <cpr/cpr.h>
#include <iostream>

int main() {
    cpr::Response r = cpr::Get(
        cpr::Url{"https://api.phys.ucalgary.ca/api/v1/data_distribution/urls"},
        cpr::Parameters{
            {"name", "THEMIS_ASI_RAW"},
            {"start", "2024-01-01T00:00:00"},
            {"end", "2024-01-01T23:59:59"},
            {"site_uid", "gill"}
        }
    );
    std::cout << r.text << std::endl;
    return 0;
}
rust
use reqwest;

#[tokio::main]
async fn main() -> Result<(), reqwest::Error> {
    let client = reqwest::Client::new();
    let response = client
        .get("https://api.phys.ucalgary.ca/api/v1/data_distribution/urls")
        .query(&[
            ("name", "THEMIS_ASI_RAW"),
            ("start", "2024-01-01T00:00:00"),
            ("end", "2024-01-01T23:59:59"),
            ("site_uid", "gill"),
        ])
        .send()
        .await?
        .text()
        .await?;
    println!("{}", response);
    Ok(())
}
go
package main

import (
    "fmt"
    "io"
    "net/http"
    "net/url"
)

func main() {
    params := url.Values{}
    params.Set("name", "THEMIS_ASI_RAW")
    params.Set("start", "2024-01-01T00:00:00")
    params.Set("end", "2024-01-01T23:59:59")
    params.Set("site_uid", "gill")

    resp, _ := http.Get("https://api.phys.ucalgary.ca/api/v1/data_distribution/urls?" + params.Encode())
    defer resp.Body.Close()
    body, _ := io.ReadAll(resp.Body)
    fmt.Println(string(body))
}
perl
use strict;
use warnings;
use LWP::UserAgent;
use URI;

my $uri = URI->new('https://api.phys.ucalgary.ca/api/v1/data_distribution/urls');
$uri->query_form(
    name     => 'THEMIS_ASI_RAW',
    start    => '2024-01-01T00:00:00',
    end      => '2024-01-01T23:59:59',
    site_uid => 'gill',
);

my $ua = LWP::UserAgent->new;
my $response = $ua->get($uri);
print $response->decoded_content;
txt
; This method is only supported on IDL 9.0+
; 
; Docs: https://www.nv5geospatialsoftware.com/docs/HttpRequest.html
response = HttpRequest.Get( $
  'https://api.phys.ucalgary.ca/api/v1/data_distribution/urls', $
  params=hash( $
    'name', 'THEMIS_ASI_RAW', $
    'start', '2024-01-01T00:00:00', $
    'end', '2024-01-01T23:59:59', $
    'site_uid', 'gill' $
  ), $
  /escape $
)
print, response.status_code
print, response.text
bash
curl "https://api.phys.ucalgary.ca/api/v1/data_distribution/urls?name=THEMIS_ASI_RAW&start=2024-01-01T00:00:00&end=2024-01-01T23:59:59&site_uid=gill"

TREx ATM

Navigate to the API docs to see examples of using the TREx ATM endpoints, and load the examples available in the dropdown boxes for the respective endpoints.

AuroraX

Explore the interactive documentation to see what is available as part of the AuroraX API.

UCalgary Space Remote Sensing