NASA announced last week that they are making their research data available to the public. The key change seems to be the creation of PubSpace, an online, free-to-access archive of original science journal articles produced by NASA-funded research. The data will be available for download, reading and analysis within one year of publication.
Much of NASA’s data can be explored using their APIs (Application Programming Interfaces). NASA’s APIs let you access photos from Mars Rover Curiosity, space sounds, the Astronomy Picture of the Day, near-earth asteroids, earth observation data, natural event metadata and the NASA patent portfolio easily.
Accessing data using NASA’s APIs
You send a query to the API (that is, you ask it a question) and it returns an answer that may consist of descriptive text, links to images or other information depending on your query.
You can check out satellite images of the Earth in the JSBin code snippet I wrote below:
How to interact with this code snippet:
- Find Latitude and Longitude of your desired location.
- Enter those figures into the lat and lon keys in queryDict.
- Alter the year, month and day variables as you wish. If no image was taken on the day, the API will return the image taken nearest to the date you specified.
Dissecting the query
The query link we’re sending is in the API link:
- Before the query, there is a question mark ?.
- After the question mark, we assign values to each parameter we care about. For example, we want the latitude to be equal to 40.70751, so we type lat=40.70751.
- We want a result that matches all the parameter values we asked for (correct date AND correct latitude AND correct longitude), so we put & signs in between specifying each parameter value.
Note: You will only be allowed to make 30 requests per hour using the DEMO_KEY API key. If you want to make more requests, you will need your own API key which you can obtain for free from NASA by filling in a form. Afterwards, set the key api_key in queryDict to your key.
Developing this into an application where you can choose latitude and longitude without editing the variables.
Aside: Brief hiatus last week as I was at the European Universities Debating Championships.