An alternative interface for NASA's Astronomy Picture of the Day (APOD), providing an alternative interface to explore the daily astronomical images and explanations from APOD. This project builds upon the amazing work of Robert Nemiroff and Jerry Bonnell who created and maintain the original APOD website (apod.nasa.gov). All content and credit goes to the original APOD service and its contributors.
You can embed the Astronomy Picture of the Day (APOD) in your website in two ways:
To display today's APOD image, use the following iframe code:
<iframe
src="https://apod.akatgx.link/embed"
width="250px"
height="250px"
title="Astronomy Picture of The Day"
>
</iframe>
To display an APOD from a specific date, add the date
parameter in YYYY-MM-DD format:
<iframe
src="https://apod.akatgx.link/embed?date=2010-12-10"
width="250px"
height="250px"
title="Astronomy Picture of The Day"
>
</iframe>
The above example loads the APOD from December 10, 2010.
This project utilizes a custom Typescript parser for NASA's APOD service. The parser fetches and processes data from apod.nasa.gov through a CORS proxy, returning structured JSON responses.
The parser is located at src/lib/apod.ts
and exposes the following function:
import { fetchAPOD } from "apod";
interface APODOptions {
startDate?: string | Date | null; // Optional start date to fetch from (by default returns the latest apod)
endDate?: string | Date | null; // Optional end date (defaults to start date)
preserveLinks?: boolean = true; // Optional preserve links in explanations (defaults to true)
}
const apod = await fetchAPOD(options);
The parser returns APOD entries in the following JSON format:
interface APODResponse {
url?: string; // Direct URL to image/video content
hdurl?: string; // High-resolution image URL if available
title?: string; // Title of the astronomy picture
explanation?: string; // Detailed explanation of the image/phenomenon
credits: string | null; // Attribution and credits
copyright: string | null; // Copyright information when applicable
media_type: "image" | "video" | "other"; // Type of media content
date: string; // Date of the APOD (YYYY-MM-DD)
link: string; // Original APOD page URL
error?: boolean; // Indicates if there was a problem during fetching or parsing
}
Contributions to improve this project are welcome! Here's how you can help:
- Fork the repository
- Create a new branch for your feature or fix
- Make your changes and commit them with clear messages
- Push to your fork and submit a pull request
Please ensure your PR:
- Follows the existing code style
- Includes relevant tests if applicable
- Updates documentation as needed
- Describes the changes made and their purpose
For major changes, please open an issue first to discuss what you would like to change.
The Astronomy Picture of the Day (APOD) service is created and maintained by:
- Robert Nemiroff (Michigan Technological University)
- Jerry Bonnell (UMCP)
All images and content are credited to their respective owners and copyright holders as noted in each daily entry. This alternative interface is an independent project that builds upon and showcases APOD's content while respecting all original attributions.