Interactive elements of this application require JavaScript to be enabled in the browser
— Reset all filters
Data API
Table of contents
API syntax
The data can be retrieved programmatically with queries sent as a GET request to https://visualization.osdr.nasa.gov/radlab/api. Queries can be constructed using one of two approaches: either as key-value pairs (a simple approach, but with limited complexity with regard to nesting logical expressions), or as boolean expressions (which allow combining AND, OR, NOT, and comparison operators with optional parentheticals).These two approaches are mutually exclusive: see notes. Click on the field names in the table below for more information.
Several example requests are provided at the bottom of this guide.
Key-value pair syntax; data fields
Key | Type | Description | Unit | Value format | Examples |
---|---|---|---|---|---|
celestial_body | string | A celestial body that an instrument of interest is associated with, or another identifier (e.g. "deep space") if none |
| celestial_body | |
trajectory | resolved string | Name or type of trajectory; can be an exact identifier (e.g. "LEO") or one of "Orbit", "Surface", "BLEO", etc. For example, "BLEO" will resolve to "Moon surface", "Heliocentric orbit at 1 AU" and anything else outside of LEO. | trajectory | ||
spacecraft | string | Name of spacecraft | spacecraft | ||
module | string (Note: may become resolved string in the future) | Module within the spacecraft; currently only applicable for the ISS and is blank (NA) for others | module | ||
instrument_family | string | Instrument family, which is a loosely defined characteristic: e.g., for REM-type instruments it is Timepix, while instruments of unique design, e.g. LND, constitute a family in themselves. | instrument_family | ||
instrument | resolved string | Name, family, type, ID, or configuration of an instrument. This is the recommended way to query for instruments: e.g., "TEPC" will match all TEPC and IV-TEPC instruments; "ALTEA" will match different configurations of ALTEA, such as ALTEA-Survey; while "ALTEA-Survey" (which is also an instrument_id, described below) will match only that configuration specifically. | instrument | ||
instrument_id | string | Note: case-sensitive. A specific ID of an instrument, detector, or configuration; this is guaranteed to be unique in the database. E.g.: REM-Lid, the REM instrument affixed to the lid of Lidal and included in the DORELI project; or Liulin-5-D2, the second detector of the Liulin-5 instrument. Note: is always returned, even when not explicitly requested. The ID can be used to look up the specifics of the instrument and the dataset in the knowledgebase. | instrument_id | ||
timestamp | ISO-formatted string (or Unix timestamp) | Timestamp of recorded value(s). Note: case-sensitive if passed as an ISO-formatted string. |
Note: special characters (<, >, :) may need to be URL-encoded (see notes below). | timestamp | |
absorbed_dose_rate | number | Absorbed radiation dose rate | absorbed_dose_rate | ||
dose_equivalent_rate | number | Dose equivalent rate | dose_equivalent_rate | ||
flux | number | Particle flux | flux | ||
latitude | number | Latitude of a spacecraft at given timestamp, where available. This and the values below are currently only tracked for the ISS and are blank (NA) for others. | deg | latitude | |
longitude | number | Longitude of spacecraft at given timestamp, where available. | deg | longitude | |
altitude | number | Altitude of spacecraft at given timestamp, where available. | km | altitude | |
B | number | B value, where available. | nT | B | |
L | number | L value, where available. | unitless | L |
Boolean expression syntax
Key | Aliases | Type | Description | Examples |
---|---|---|---|---|
query | string | A boolean query referencing fields described in the "data fields" table above, and using AND, OR, =, <=, >= operators and parentheses ((, )) | query=(timestamp>=2023-05-16)AND((instrument=REM)OR(spacecraft=LND)) Note: spaces inside the query string are allowed (e.g. spacecraft = LND); the query can be optionally encased in single or double quotes. However, spaces and quotes may need to be URL-encoded (see notes below). | |
fields+ | fields columns columns+ | string | A comma-separated list of additional fields to retrieve (i.e. fields not already implicated in the boolean query) | fields+=absorbed_dose_rate,flux |
Auxiliary keys (used with both syntaxes)
Key | Type | Description | Unit | Value format | Examples |
---|---|---|---|---|---|
format | string | output format |
| format=tsv format=json |
Resolved strings
Fields of type "resolved string" are fields that can be queried by an ambiguous value.trajectory is an example of such a field: e.g. if you are interested in all instruments in BLEO, you can pass trajectory=BLEO as part of the query, and the API will match any instrument in Heliocentric orbit at 1 AU, Moon surface, etc.
Because of that, the field "trajectory" in the API output may not contain the exact term that you queried for: instead, in this example, it will resolve to the actual value stored in the database, e.g. "Moon surface".
The following fields are of type "resolved string":
- trajectory, e.g.:
- "Orbit" may match "LEO", "Heliocentric orbit at 1 AU", etc;
- but "Low Earth Orbit" will only match "LEO";
- instrument, e.g.:
- "Liulin-5" may match "Liulin-5-D1", "Liulin-5-D2", "Liulin-5-D3";
- "TEPC" may match "TEPC", "IV-TEPC";
- but "IV-TEPC" will only match "IV-TEPC".
- module, e.g.:
- "US Lab" is currently the only term that matches "US Lab";
- however, in the future, "Destiny" may also match "US Lab".
E.g. queries with module=SM will continue to produce outputs with readings from the SM module, but users will gain the ability to use its other names (module=Zvezda or module=Zvezda%20Service%20Module).
Case sensitivity
- Field names are case-insensitive (i.e. timestamp is the same as TimeStamp).
- Most string values are case-insensitive as well (e.g. spacecraft=iss is OK), except for the outlined below.
- Instrument IDs are case-sensitive.
instrument_id=LND will match, instrument_id=lnd will not.
This is intentional and aligns with the uniqueness constraint of this field. - Timestamps passed as ISO-formatted strings are case-sensitive.
timestamp=2024-01-01T00:00 will work, timestamp=2024-01-01t00:00 (lowercase t) will not.
This is intentional and conforms to the ISO 8601 standard.
Notes
- The key-value pair syntax and the boolean expression syntax are mutually exclusive. The API will return an error if there is an attempt to mix the two syntaxes:
e.g., query='spacecraft=ISS'&instrument=REM×tamp will not be accepted; instead, either the key-value pair syntax should be used,i.e. spacecraft=ISS&instrument=REM×tamp, or the boolean expression syntax,i.e. query='(spacecraft=ISS)AND(instrument=REM)'&fields+=timestamp. - Special characters (spaces, |, <, >, :, ', ") may need to be URL-encoded (although e.g. Python will only complain if spaces are not encoded and will accept all other characters as-is; therefore, this depends on the use case):
- → %20 (space)
- | → %7C
- < → %3C
- > → %3E
- : → %3A
- ' → %27
- " → %22
- Boolean expression operators are case-sensitive, i.e. AND is understood as an operator, while and will result in a syntax error. Only the operators listed in the tables above are accepted.
Examples
- Key-value pair syntax
- Dose rate and flux readings from DosTel-type instruments on the ISS between 11 PM on 01 Apr 2022, inclusive, and 1:05 AM on 02 Apr 2022, non-inclusive, only where the dose rate is above 2 μGy/hour, together with the spatial and magnetic coordinates of the ISS, formatted as HTML:
- Conceptually:
https://visualization.osdr.nasa.gov/radlab/api/
?spacecraft=ISS
&instrument=DosTel
×tamp>=2022-04-01T23:00
×tamp<2022-04-02T01:05
&absorbed_dose_rate>2
&flux
&latitude
&longitude
&altitude
&b
&l
&format=html - URL-encoded (may not be necessary):
https://visualization.osdr.nasa.gov/radlab/api/
?spacecraft=ISS
&instrument=DosTel
×tamp%3E=2022-04-01T23%3A00
×tamp%3C2022-04-02T01%3A05
&absorbed_dose_rate%3E2
&flux
&latitude
&longitude
&altitude
&b
&l
&format=html - Full URL: https://visualization.osdr.nasa.gov/radlab/api/?spacecraft=ISS&instrument=DosTel×tamp%3E=2022-04-01T23%3A00×tamp%3C2022-04-02T01%3A05&absorbed_dose_rate%3E2&flux&latitude&longitude&altitude&b&l&format=html
- Full URL without encoding (should work in most browsers, Python, ...): https://visualization.osdr.nasa.gov/radlab/api/?spacecraft=ISS&instrument=DosTel×tamp>=2022-04-01T23:00×tamp<2022-04-02T01:05&absorbed_dose_rate>2&flux&latitude&longitude&altitude&b&l&format=html
- Conceptually:
- Dose rate and flux readings from DosTel-type instruments on the ISS between 11 PM on 01 Apr 2022, inclusive, and 1:05 AM on 02 Apr 2022, non-inclusive, only where the dose rate is above 2 μGy/hour, together with the spatial and magnetic coordinates of the ISS, formatted as HTML:
- Boolean expression syntax
- Dose rate readings from all detectors in either the Cupola or JPM modules, between 5 Dec 2019 inclusive and 25 Dec 2019, non-inclusive; also retrieve the value of "instrument_family" for each reading and format the output as TSV:
- Conceptually:
query: timestamp >= 2019-12-05 AND timestamp < 2019-12-25 AND (module = Cupola OR module = JPM)
additional fields: absorbed_dose_rate,instrument_family
format: tsv - URL-encoded, and strategically using parentheses to avoid having to also encode spaces in the query (may not be necessary):
https://visualization.osdr.nasa.gov/radlab/api/
?query=(timestamp%3E=2019-12-05)AND(timestamp%3C2019-12-25)AND((module=Cupola)OR(module=JPM))
&fields+=absorbed_dose_rate,instrument_family
&format=tsv - Full URL: https://visualization.osdr.nasa.gov/radlab/api/?query=(timestamp%3E=2019-12-05)AND(timestamp%3C2019-12-25)AND((module=Cupola)OR(module=JPM))&fields+=absorbed_dose_rate,instrument_family&format=tsv
- Full URL without encoding (should work in most browsers, Python, ...): https://visualization.osdr.nasa.gov/radlab/api/?query=(timestamp>=2019-12-05)AND(timestamp<2019-12-25)AND((module=Cupola)OR(module=JPM))&fields+=absorbed_dose_rate,instrument_family&format=tsv
- Conceptually:
- Dose rate readings from all detectors in either the Cupola or JPM modules, between 5 Dec 2019 inclusive and 25 Dec 2019, non-inclusive; also retrieve the value of "instrument_family" for each reading and format the output as TSV:
- Additional notes on URL-encoding
- While the Python standard library and most external modules can handle the majority of unencoded URLs, spaces always have to be encoded as %20 for use in Python.
- While URL-encoding can be avoided in the majority of cases (as shown above), values containing apostrophes must always be encoded and encased in double quotes to prevent confusion with syntactic quotations.
For example, the name of the Chang'e 4 lunar lander should be passed as "Chang%27e%204": the quotation marks are part of the query, %27 codes for the apostrophe, and %20 for space.
E.g.: https://visualization.osdr.nasa.gov/radlab/api/?query=(timestamp>=2020-07-15)AND(timestamp<2020-07-23)AND(spacecraft="Chang%27e%204")&fields+=absorbed_dose_rate,instrument&format=tsv – this URL minimizes the need for escaping everywhere except for the name of the lander and should work in most browsers, Python, etc, but may still need to be escaped fully if used in other environments.