https://github.com/codedotjs/apod-nasa
:earth_americas: Astronomy Picture of the Day!
https://github.com/codedotjs/apod-nasa
api day extract fetch nodejs picture picture-of-the-day scrap
Last synced: 12 months ago
JSON representation
:earth_americas: Astronomy Picture of the Day!
- Host: GitHub
- URL: https://github.com/codedotjs/apod-nasa
- Owner: CodeDotJS
- License: mit
- Created: 2017-07-03T14:11:48.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-02-11T19:01:30.000Z (about 7 years ago)
- Last Synced: 2025-03-20T00:41:16.624Z (about 1 year ago)
- Topics: api, day, extract, fetch, nodejs, picture, picture-of-the-day, scrap
- Language: JavaScript
- Size: 35.2 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
## Install
```
$ npm install --save apod-nasa
```
## Usage
- __`For current date`__
```js
const apod = require('apod-nasa');
apod().then(data => {
console.log(data);
/*
{
title: 'The Summer Triangle over the Great Wall',
image: 'https://apod.nasa.gov/apod/image/1707/GreatWallMilkyWay_Yu_1686.jpg'
}
*/
});
```
- __`For specific date`__
```js
apod.date('951010').then(data => {
console.log(data);
/*
{
day: 'October 10, 1995',
title: 'Dione\'s Lagrange Moon Helene',
image: 'https://apod.nasa.gov/apod/image/helene_vg2.gif'
}
*/
});
```
#### __`Date`__
In `apod.date()` the following format is only supported format -
- __`yy/mm/dd`__
__`Example : `__
- For `16th of March, 1998` `:` __`980316`__
- For `1st January, 2000` `:` __`000101`__
__NOTE :__
__[`APOD-NASA`](https://apod.nasa.gov/apod/)__ started to post pictures since __`June 16, 1995`__ , so the least date will be __`950616`__ and max will be the __`current date`__
## API
- __`apod()`__
- __`apod.date('date')`__
__`date`__
`Type :` __`string`__
`Format :` __`yy/mm/dd`__
## Related
- __[`apod`](https://github.com/CodeDotJS/apod)__ `: Astronomy Picture of the Day form command line done right!`
## License
MIT © [Rishi Giri](http://codedotjs.github.io)