Skip to content

NASA Free API Plugin#88

Open
BusinessPlatformAutomation wants to merge 1 commit into
mainfrom
feature/nasa-plugin
Open

NASA Free API Plugin#88
BusinessPlatformAutomation wants to merge 1 commit into
mainfrom
feature/nasa-plugin

Conversation

@BusinessPlatformAutomation

@BusinessPlatformAutomation BusinessPlatformAutomation commented Jul 10, 2026

Copy link
Copy Markdown

Adds a new SquaredUp plugin for NASA's open data APIs, covering near-Earth asteroid close approaches (NeoWs), space weather alerts (DONKI), tracked satellites (Satellite Situation Center), and the Astronomy Picture of the Day (APOD).

  • Near-Earth Object: asteroids with a close approach in the current 7-day window, with summary and close-approach-history data streams
  • Space Weather Notification: DONKI's unified alert feed (solar flares, CMEs, geomagnetic storms, etc.) from the last 30 days
  • Satellite: ~84 actively tracked spacecraft from NASA's Satellite Situation Center, with a position-over-time data stream (GSE X/Y/Z) built against SSC's unusual Java-serialized JSON format
  • APOD: today's astronomy picture plus a date-range gallery stream, kept as dashboard-only content (no natural entity to index/drill into)

EONET (natural events) was scoped in but dropped: NASA's EONET service mislabels JSON responses with an XML content-type on ~90%+ of requests, which crashes this plugin's response parser with no available workaround. Documented as a known limitation.

Switch to the Preview tab above and select the appropriate PR template to use for this change:

Summary by CodeRabbit

  • New Features
    • Added NASA data integration for near-Earth objects, space weather notifications, satellites, and Astronomy Picture of the Day.
    • Added dashboards for overview metrics, asteroid details, close approaches, and space weather notifications.
    • Added APOD gallery views with selectable date ranges.
    • Added custom object types for near-Earth objects, space weather notifications, and satellites.
    • Added API key setup with connection validation and guidance for NASA rate limits.
  • Documentation
    • Added setup instructions, supported data sources, and known limitations.

Adds a new SquaredUp plugin for NASA's open data APIs, covering near-Earth
asteroid close approaches (NeoWs), space weather alerts (DONKI), tracked
satellites (Satellite Situation Center), and the Astronomy Picture of the
Day (APOD).

- Near-Earth Object: asteroids with a close approach in the current 7-day
  window, with summary and close-approach-history data streams
- Space Weather Notification: DONKI's unified alert feed (solar flares,
  CMEs, geomagnetic storms, etc.) from the last 30 days
- Satellite: ~84 actively tracked spacecraft from NASA's Satellite
  Situation Center, with a position-over-time data stream (GSE X/Y/Z)
  built against SSC's unusual Java-serialized JSON format
- APOD: today's astronomy picture plus a date-range gallery stream, kept
  as dashboard-only content (no natural entity to index/drill into)

EONET (natural events) was scoped in but dropped: NASA's EONET service
mislabels JSON responses with an XML content-type on ~90%+ of requests,
which crashes this plugin's response parser with no available workaround.
Documented as a known limitation.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@BusinessPlatformAutomation BusinessPlatformAutomation requested a review from a team July 10, 2026 11:29
@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Changes

The NASA v1 plugin adds API configuration, custom object types, indexed NEO, space-weather, and satellite data, APOD streams, satellite response processing, documentation, and three default dashboards with scoped views.

NASA Plugin

Layer / File(s) Summary
Plugin contracts and indexing
plugins/NASA/v1/metadata.json, plugins/NASA/v1/ui.json, plugins/NASA/v1/custom_types.json, plugins/NASA/v1/configValidation.json, plugins/NASA/v1/indexDefinitions/default.json, plugins/NASA/v1/docs/README.md
Defines NASA plugin metadata, API key input and validation, custom object types, indexed data mappings, and documented configuration and limitations.
NASA data streams and transformations
plugins/NASA/v1/dataStreams/apodToday.json, plugins/NASA/v1/dataStreams/apodGallery.json, plugins/NASA/v1/dataStreams/donkiNotifications.json, plugins/NASA/v1/dataStreams/neoFeed.json, plugins/NASA/v1/dataStreams/neoSummary.json, plugins/NASA/v1/dataStreams/neoCloseApproaches.json, plugins/NASA/v1/dataStreams/scripts/*
Adds APOD, DONKI, and NEO HTTP streams with metadata schemas and scripts for NEO deduplication, normalization, and summary generation.
Satellite streams and SSC response processing
plugins/NASA/v1/dataStreams/satellites.json, plugins/NASA/v1/dataStreams/satelliteLocation.json, plugins/NASA/v1/dataStreams/scripts/satellites.js, plugins/NASA/v1/dataStreams/scripts/satelliteLocation.js
Adds satellite catalog and location requests, unwraps SSC response payloads, filters active observatories, and emits satellite coordinate rows.
Scopes and default dashboards
plugins/NASA/v1/defaultContent/manifest.json, plugins/NASA/v1/defaultContent/scopes.json, plugins/NASA/v1/defaultContent/overview.dash.json, plugins/NASA/v1/defaultContent/nearEarthObject.dash.json, plugins/NASA/v1/defaultContent/spaceWeatherNotification.dash.json
Registers three dashboards and configures overview, NEO, and space-weather tiles with data-stream bindings, scopes, sorting, columns, and hidden fields.

Sequence Diagram(s)

sequenceDiagram
  participant Dashboard
  participant NASADataStream
  participant NASAAPI
  participant TransformScript
  Dashboard->>NASADataStream: request configured NASA data
  NASADataStream->>NASAAPI: send API request with api_key
  NASAAPI-->>NASADataStream: return NASA response
  NASADataStream->>TransformScript: normalize configured responses
  TransformScript-->>Dashboard: return dashboard-ready rows
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately reflects the new NASA plugin being added.
Description check ✅ Passed The description covers the plugin scope, major data sources, and the documented EONET limitation.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown

🧩 Plugin PR Summary

📦 Modified Plugins

  • plugins/NASA/v1

📋 Results

Step Status
Validation ✅ Passed
Deployment 🚀 Deployed

🔍 Validation Details

nasa
{
  "valid": true,
  "pluginName": "nasa",
  "pluginType": "hybrid",
  "summary": {
    "Data Streams": 8,
    "Import Definitions": 1,
    "UI Configuration": true,
    "Has Icon": true,
    "Has Default Content": true,
    "Config Validation": true,
    "Custom Types": true
  }
}

@clarkd clarkd added the new-plugin Used to PR newly added plugins label Jul 10, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 6

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@plugins/NASA/v1/dataStreams/neoFeed.json`:
- Around line 11-15: Update the end_date expression in the NeoWs feed parameters
to add 6 days instead of 7, while preserving the existing ISO date formatting
and start_date behavior.

In `@plugins/NASA/v1/dataStreams/satelliteLocation.json`:
- Line 6: Add "objectLimit": 1 to the satellite location stream configuration
associated with baseDataSourceName "httpRequestScopedSingle", ensuring the
stream enforces a single returned object despite the NASA UI only defining
apiKey.

In `@plugins/NASA/v1/dataStreams/scripts/neoFeed.js`:
- Line 1: Update the `byDate` initialization in `neoFeed.js` to guard against
null or undefined `data`, using the same null-safe pattern as `neoSummary.js` or
optional chaining before accessing `near_earth_objects`.

In `@plugins/NASA/v1/dataStreams/scripts/satelliteLocation.js`:
- Around line 41-49: Guard the coordinate-row construction loop by verifying
that xs[i], ys[i], and zs[i] are all defined before pushing a row; skip
iterations with incomplete coordinate data while retaining the existing
coordinateSystem assignment.

In `@plugins/NASA/v1/metadata.json`:
- Around line 5-7: Replace the email value in the metadata.json author.name
field with the contributor’s corresponding GitHub username or organisation,
keeping the author.type value unchanged.

In `@plugins/NASA/v1/ui.json`:
- Around line 2-9: Update the apiKey field in the UI configuration to use
displayName instead of label, and add the required placeholder and title
properties following the ui.json conventions. Because DEMO_KEY is a valid
default, remove validation.required or set it to false.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: ASSERTIVE

Plan: Pro

Run ID: 04707802-cb3b-446e-8d4e-26bf4089b1d7

📥 Commits

Reviewing files that changed from the base of the PR and between 18219a1 and a79cffe.

⛔ Files ignored due to path filters (1)
  • plugins/NASA/v1/icon.svg is excluded by !**/*.svg
📒 Files selected for processing (23)
  • plugins/NASA/v1/configValidation.json
  • plugins/NASA/v1/custom_types.json
  • plugins/NASA/v1/dataStreams/apodGallery.json
  • plugins/NASA/v1/dataStreams/apodToday.json
  • plugins/NASA/v1/dataStreams/donkiNotifications.json
  • plugins/NASA/v1/dataStreams/neoCloseApproaches.json
  • plugins/NASA/v1/dataStreams/neoFeed.json
  • plugins/NASA/v1/dataStreams/neoSummary.json
  • plugins/NASA/v1/dataStreams/satelliteLocation.json
  • plugins/NASA/v1/dataStreams/satellites.json
  • plugins/NASA/v1/dataStreams/scripts/neoFeed.js
  • plugins/NASA/v1/dataStreams/scripts/neoSummary.js
  • plugins/NASA/v1/dataStreams/scripts/satelliteLocation.js
  • plugins/NASA/v1/dataStreams/scripts/satellites.js
  • plugins/NASA/v1/defaultContent/manifest.json
  • plugins/NASA/v1/defaultContent/nearEarthObject.dash.json
  • plugins/NASA/v1/defaultContent/overview.dash.json
  • plugins/NASA/v1/defaultContent/scopes.json
  • plugins/NASA/v1/defaultContent/spaceWeatherNotification.dash.json
  • plugins/NASA/v1/docs/README.md
  • plugins/NASA/v1/indexDefinitions/default.json
  • plugins/NASA/v1/metadata.json
  • plugins/NASA/v1/ui.json

Comment on lines +11 to +15
{ "key": "start_date", "value": "{{new Date().toISOString().split('T')[0]}}" },
{
"key": "end_date",
"value": "{{new Date(Date.now() + 7 * 24 * 60 * 60 * 1000).toISOString().split('T')[0]}}"
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🌐 Web query:

What is the maximum date range for the NASA NeoWs feed endpoint (/neo/rest/v1/feed)? Does it count the range inclusively or exclusively?

💡 Result:

The maximum date range for the NASA NeoWs feed endpoint (/neo/rest/v1/feed) is 7 days [1][2][3][4]. While some earlier documentation or external sources might have occasionally cited different limits, the consensus among technical documentation is that the API restricts queries to a span of no more than 7 days [1][2][3][5][4]. Regarding inclusivity, the date range is inclusive of both the start_date and the end_date [5][6]. When you perform a request, the API returns near-Earth object data for the entire duration of the specified range, including all records from the start and end dates provided in the query parameters [5].

Citations:


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf 'FILE CONTEXT\n'
git ls-files plugins/NASA/v1/dataStreams/neoFeed.json
wc -l plugins/NASA/v1/dataStreams/neoFeed.json
cat -n plugins/NASA/v1/dataStreams/neoFeed.json | sed -n '1,80p'

printf '\nDOC SEARCH\n'
python3 - <<'PY'
import urllib.parse, json, sys, textwrap, subprocess, os
queries = [
    "site:api.nasa.gov neo/rest/v1/feed 7 days inclusive start_date end_date",
    "NASA NeoWs feed endpoint 7 days inclusive date range",
]
for q in queries:
    print(f"\nQUERY: {q}")
    # no network fetch here; just print for the record if external browsing isn't available
PY

Repository: squaredup/plugins

Length of output: 3427


Cap the NeoWs feed window at 6 days
start_date to end_date is inclusive, so today + 7 requests 8 calendar days and can return a 400. Use today + 6 instead.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@plugins/NASA/v1/dataStreams/neoFeed.json` around lines 11 - 15, Update the
end_date expression in the NeoWs feed parameters to add 6 days instead of 7,
while preserving the existing ISO date formatting and start_date behavior.

"displayName": "Satellite Location",
"description": "GSE coordinate position of a satellite over time",
"tags": ["Astronomy"],
"baseDataSourceName": "httpRequestScopedSingle",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Check ui.json for a scope parameter related to satelliteLocation and its objectLimit setting.

# Find ui.json in the NASA plugin directory
fd -t f "ui.json" plugins/NASA/v1/ --exec cat -n {}

Repository: squaredup/plugins

Length of output: 596


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '--- plugins/NASA/v1/dataStreams/satelliteLocation.json ---'
cat -n plugins/NASA/v1/dataStreams/satelliteLocation.json

echo
echo '--- scoped streams with httpRequestScopedSingle and objectLimit in plugins/NASA/v1/dataStreams ---'
rg -n '"baseDataSourceName"\s*:\s*"httpRequestScopedSingle"|"objectLimit"\s*:' plugins/NASA/v1/dataStreams

Repository: squaredup/plugins

Length of output: 3364


Add objectLimit: 1 to this stream. The NASA UI only defines apiKey, so nothing enforces the single-object constraint for httpRequestScopedSingle.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@plugins/NASA/v1/dataStreams/satelliteLocation.json` at line 6, Add
"objectLimit": 1 to the satellite location stream configuration associated with
baseDataSourceName "httpRequestScopedSingle", ensuring the stream enforces a
single returned object despite the NASA UI only defining apiKey.

Source: Learnings

@@ -0,0 +1,32 @@
const byDate = data.near_earth_objects || {};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Add null guard on data for consistency with other post-request scripts.

data.near_earth_objects will throw a TypeError if data is null or undefined. The companion script neoSummary.js line 1 uses (data || {}) for null safety, and the Algolia topCountries.js uses optional chaining (data?.countries?.map(...)).

🛡️ Proposed fix
-const byDate = data.near_earth_objects || {};
+const byDate = (data || {}).near_earth_objects || {};
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@plugins/NASA/v1/dataStreams/scripts/neoFeed.js` at line 1, Update the
`byDate` initialization in `neoFeed.js` to guard against null or undefined
`data`, using the same null-safe pattern as `neoSummary.js` or optional chaining
before accessing `near_earth_objects`.

Comment on lines +41 to +49
for (let i = 0; i < times.length; i++) {
rows.push({
time: times[i],
x: xs[i],
y: ys[i],
z: zs[i],
coordinateSystem: coordBlock.CoordinateSystem || "",
});
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Guard against mismatched array lengths in the coordinate loop.

The loop iterates based on times.length and indexes xs[i], ys[i], zs[i] in parallel. If any coordinate array is shorter than times (e.g., due to API truncation or malformed responses), undefined values will be pushed into the result rows. Add a length guard to skip incomplete entries.

🛡️ Proposed fix: add bounds guard
         for (let i = 0; i < times.length; i++) {
+            if (i >= xs.length || i >= ys.length || i >= zs.length) {
+                break;
+            }
             rows.push({
                 time: times[i],
                 x: xs[i],
                 y: ys[i],
                 z: zs[i],
                 coordinateSystem: coordBlock.CoordinateSystem || "",
             });
         }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@plugins/NASA/v1/dataStreams/scripts/satelliteLocation.js` around lines 41 -
49, Guard the coordinate-row construction loop by verifying that xs[i], ys[i],
and zs[i] are all defined before pushing a row; skip iterations with incomplete
coordinate data while retaining the existing coordinateSystem assignment.

Comment on lines +5 to +7
"author": {
"name": "sam.jacobs@squaredup.com",
"type": "community"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

author.name should be a GitHub username or organisation, not an email.

Per the metadata.json coding guidelines, author.name must contain a GitHub username or organisation. Replace the email with the corresponding GitHub handle.

🔧 Proposed fix
     "author": {
-        "name": "sam.jacobs@squaredup.com",
+        "name": "sam-jacobs",
         "type": "community"
     },
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"author": {
"name": "sam.jacobs@squaredup.com",
"type": "community"
"author": {
"name": "sam-jacobs",
"type": "community"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@plugins/NASA/v1/metadata.json` around lines 5 - 7, Replace the email value in
the metadata.json author.name field with the contributor’s corresponding GitHub
username or organisation, keeping the author.type value unchanged.

Source: Coding guidelines

Comment thread plugins/NASA/v1/ui.json
Comment on lines +2 to +9
{
"type": "password",
"name": "apiKey",
"label": "API Key",
"defaultValue": "DEMO_KEY",
"help": "Get a free API key at [api.nasa.gov](https://api.nasa.gov/). `DEMO_KEY` works for testing but is rate-limited to 30 requests/hour and 50/day shared across all DEMO_KEY users.",
"validation": { "required": true }
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Field is missing displayName, placeholder, and title properties, and uses label instead of displayName.

Per the ui.json coding guidelines, each field should enforce displayName, name, help, placeholder, and title conventions. The current field uses label instead of displayName and omits placeholder and title.

Additionally, required: true is set on apiKey despite DEMO_KEY being a working default. Per guidelines, only strictly required fields should be marked required: true.

🔧 Proposed fix
 [
     {
         "type": "password",
         "name": "apiKey",
-        "label": "API Key",
+        "displayName": "API Key",
+        "title": "API Key",
+        "placeholder": "Enter your NASA API key",
         "defaultValue": "DEMO_KEY",
         "help": "Get a free API key at [api.nasa.gov](https://api.nasa.gov/). `DEMO_KEY` works for testing but is rate-limited to 30 requests/hour and 50/day shared across all DEMO_KEY users.",
-        "validation": { "required": true }
+        "validation": { "required": false }
     }
 ]
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{
"type": "password",
"name": "apiKey",
"label": "API Key",
"defaultValue": "DEMO_KEY",
"help": "Get a free API key at [api.nasa.gov](https://api.nasa.gov/). `DEMO_KEY` works for testing but is rate-limited to 30 requests/hour and 50/day shared across all DEMO_KEY users.",
"validation": { "required": true }
}
{
"type": "password",
"name": "apiKey",
"displayName": "API Key",
"title": "API Key",
"placeholder": "Enter your NASA API key",
"defaultValue": "DEMO_KEY",
"help": "Get a free API key at [api.nasa.gov](https://api.nasa.gov/). `DEMO_KEY` works for testing but is rate-limited to 30 requests/hour and 50/day shared across all DEMO_KEY users.",
"validation": { "required": false }
}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@plugins/NASA/v1/ui.json` around lines 2 - 9, Update the apiKey field in the
UI configuration to use displayName instead of label, and add the required
placeholder and title properties following the ui.json conventions. Because
DEMO_KEY is a valid default, remove validation.required or set it to false.

Source: Coding guidelines

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new-plugin Used to PR newly added plugins

Development

Successfully merging this pull request may close these issues.

2 participants