NASA Free API Plugin#88
Conversation
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>
📝 WalkthroughWalkthroughChangesThe 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
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
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
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. Comment |
🧩 Plugin PR Summary📦 Modified Plugins
📋 Results
🔍 Validation Details✅
|
There was a problem hiding this comment.
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
⛔ Files ignored due to path filters (1)
plugins/NASA/v1/icon.svgis excluded by!**/*.svg
📒 Files selected for processing (23)
plugins/NASA/v1/configValidation.jsonplugins/NASA/v1/custom_types.jsonplugins/NASA/v1/dataStreams/apodGallery.jsonplugins/NASA/v1/dataStreams/apodToday.jsonplugins/NASA/v1/dataStreams/donkiNotifications.jsonplugins/NASA/v1/dataStreams/neoCloseApproaches.jsonplugins/NASA/v1/dataStreams/neoFeed.jsonplugins/NASA/v1/dataStreams/neoSummary.jsonplugins/NASA/v1/dataStreams/satelliteLocation.jsonplugins/NASA/v1/dataStreams/satellites.jsonplugins/NASA/v1/dataStreams/scripts/neoFeed.jsplugins/NASA/v1/dataStreams/scripts/neoSummary.jsplugins/NASA/v1/dataStreams/scripts/satelliteLocation.jsplugins/NASA/v1/dataStreams/scripts/satellites.jsplugins/NASA/v1/defaultContent/manifest.jsonplugins/NASA/v1/defaultContent/nearEarthObject.dash.jsonplugins/NASA/v1/defaultContent/overview.dash.jsonplugins/NASA/v1/defaultContent/scopes.jsonplugins/NASA/v1/defaultContent/spaceWeatherNotification.dash.jsonplugins/NASA/v1/docs/README.mdplugins/NASA/v1/indexDefinitions/default.jsonplugins/NASA/v1/metadata.jsonplugins/NASA/v1/ui.json
| { "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]}}" | ||
| } |
There was a problem hiding this comment.
🎯 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:
- 1: https://proulxp.github.io/CS290-How-To-Guide/neo.html
- 2: https://learn.microsoft.com/en-us/connectors/nearearthobjectwebip/
- 3: https://observablehq.com/@justingosses/asteroids-api-a-href-https-api-nasa-gov-api-neows-swagger-n-e-o
- 4: https://apis.io/apis/nasa/neo/
- 5: https://stackoverflow.com/questions/46163658/get-data-from-last-3-days-from-nasa-neo-api
- 6: https://rdrr.io/github/Liu-Zhichao/nasaR/src/R/Neo_Feed.R
🏁 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
PYRepository: 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", |
There was a problem hiding this comment.
🗄️ 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/dataStreamsRepository: 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 || {}; | |||
There was a problem hiding this comment.
🩺 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`.
| 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 || "", | ||
| }); | ||
| } |
There was a problem hiding this comment.
🩺 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.
| "author": { | ||
| "name": "sam.jacobs@squaredup.com", | ||
| "type": "community" |
There was a problem hiding this comment.
📐 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.
| "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
| { | ||
| "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 } | ||
| } |
There was a problem hiding this comment.
📐 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.
| { | |
| "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
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).
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
Previewtab above and select the appropriate PR template to use for this change:Summary by CodeRabbit