apod.js
A small JS wrapper around NASA's APOD API.
To use this, you'll need an api.data.gov API key - you can request one here: https://data.nasa.gov/developer/external/planetary/#apply-for-an-api-key
Installation
$ npm install apod
Usage
var apod = ; apodapiKey = "YOUR_API_KEY"; { // do cool stuff with APOD data here} // get today's APOD; // APOD for December 31, 1999 (JS has 0-indexed months); // the same; // once more, with feeling; // get a random APODapod;
Assuming success, all methods trigger the callback with an object like the following, direct from NASA's API:
HTTPS Proxy
Sending via an HTTP/HTTPS proxy is supported.
Just set the environment variable https_proxy
and it will be used when making requests to the API.
Alternatively, set the apod.proxy
string.
Here's examples of both usage patterns:
$ https_proxy="https://my.secure.proxy" node script.js
// script.jsapodproxy = "https://my.secure.proxy"
Version History
Version | Notes |
---|---|
0.2.0 | Update endpoint URL, remove concept_tags |
0.2.0 | Add support for HTTPS proxy, refactors. |
0.1.0 | Interface change, use new NASA APOD API |
0.0.1 | Initial release |
License
MIT. For more details, see the LICENSE
file.