AI Automation•Completed•1 min read

NASA APOD Multi-Channel Distribution Pipeline

A daily automated pipeline querying NASA's Astronomy Picture of the Day API, enriching descriptions with simplified key concepts, and broadcasting formatted digests across Discord and Telegram.

NASA APOD Multi-Channel Distribution Pipeline

Verified Outcomes & Key Highlights

Daily automated execution at 06:00 UTC without human intervention
Sub-1s multi-platform broadcast throughput

Project Overview

An automated daily media pipeline built to deliver high-resolution astronomical discoveries directly to community science channels. It fetches daily metadata from NASA's official Astronomy Picture of the Day API, parses image and video payloads, cleans scientific explanations, and posts structured cards to Discord and Telegram.

Problem Statement & Context

Curating daily scientific updates across multiple community channels manually is inconsistent and prone to missing updates during weekends or busy periods.

Business Objective

Create a completely headless, zero-maintenance distribution pipeline that broadcasts daily educational astronomy updates punctually at 06:00 UTC every morning.

Methodology & Architecture

1. Cron trigger executes daily at 06:00 UTC. 2. Query NASA Open API endpoint `https://api.nasa.gov/planetary/apod`. 3. Validate payload type (`image` vs. `video/youtube/vimeo`). 4. Format Discord rich embed with thumbnail, author credit, date, and simplified explanation. 5. Format Telegram photo post with HTML caption and direct high-resolution download links.

Approach & Implementation

Engineered with n8n utilizing native HTTP Request nodes, conditional branching based on media type, and rate-limit backoff handling.

Key Findings & Observations

Handling YouTube video embeds separately from high-resolution imagery prevents broken image previews on messaging platforms.
Storing the last successfully processed APOD date prevents duplicate posts if the API updates late.

Business Recommendations

  • Automated scheduled content pipelines should always include error-notification webhooks to alert administrators if an external upstream API fails.

Measurable Results & Deliverables

Achieved 100% scheduled uptime across 60+ consecutive daily runs.
Automated publication to community channels with zero manual effort.

Limitations & Future Improvements

Current Boundaries: Relies strictly on NASA's upstream API availability. Free demo API keys have request rate limits of 30 requests per hour.

  • Integrate automatic language translation for non-English science communities.
  • Store historical archives in a searchable local gallery.

Tools & Technologies Applied

Pythonn8nNASA Open APIsDiscord WebhooksTelegram Bot APICRON Scheduling

Multi-Channel Dispatch Logic

Daily 06:00 UTC Cron
        │
        ▼
[Fetch NASA APOD API]
        │
   (Media Type?)
   ├── "image" ────► Format Discord Rich Embed + Send High-Res Photo to Telegram
   └── "video" ────► Extract YouTube Embed Link + Send Video Card