apod-webscraper

A easy way to get the Astronaut Picture of the Day

Usage no npm install needed!

<script type="module">
  import apodWebscraper from 'https://cdn.skypack.dev/apod-webscraper';
</script>

README

Info

A easy way to get the Astronaut Picture of the Day

Without an API key you are ratelimited to 30 requests per hour and a daily limit of 50, but when you apply for a free API key you are allowed 1,000 requests per hour with no daily limit. You can get your free API key here

Installation

$npm i apod-webscraper

Usage

getAPOD

Gets the daily APOD for the current date

const APOD = require('apod-webscraper');

const apod = new APOD.Client({
    key: "DEMO_KEY",
});

apod.getAPOD().then((data) => {
    console.log(data)
});

Example Output

{
  copyright: 'Bernard Miller',
  date: '2021-03-27',
  explanation: "Some 60 million light-years away in the southerly constellation Corvus, two large galaxies are colliding. Stars in the two galaxies, cataloged as NGC 4038 and NGC 4039, very rarely collide in the course of the ponderous cataclysm that lasts for hundreds of millions of years. But the galaxies' large clouds of molecular gas and dust often do, triggering furious episodes of star formationi near the center of the cosmic wreckage. Spanning over 500 thousand light-years, this stunning view also reveals new star clusters and matter flung far from the scene of the accident by gravitational tidal forces. The remarkably sharp ground-based image includes narrowband data that highlights the characteristic red glow of atomic hydrogen gas in star-forming regions. The suggestive overall visual appearance of the extended arcing structures gives the galaxy pair its popular name - The Antennae.",
  hdurl: 'https://apod.nasa.gov/apod/image/2103/C60-61_PS2_CROP_FULL.jpg',
  media_type: 'image',
  service_version: 'v1',
  title: 'Exploring the Antennae',
  url: 'https://apod.nasa.gov/apod/image/2103/C60-61_PS2_CROP_FULL1024.jpg'
}