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.
| @@ -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`.
| "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
clarkd
left a comment
There was a problem hiding this comment.
A few small tweaks @BusinessPlatformAutomation but looks awesome! 👾
| @@ -0,0 +1,32 @@ | |||
| const byDate = data.near_earth_objects || {}; | |||
There was a problem hiding this comment.
| const byDate = data.near_earth_objects || {}; | |
| const byDate = (data || {}).near_earth_objects || {}; |
| { "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.
| "value": "{{new Date(Date.now() + 7 * 24 * 60 * 60 * 1000).toISOString().split('T')[0]}}" | |
| "value": "{{new Date(Date.now() + 6 * 24 * 60 * 60 * 1000).toISOString().split('T')[0]}}" |
| 2. NASA emails you an API key immediately — no approval wait. | ||
| 3. Use that key when configuring this plugin. | ||
|
|
||
| You can use the public `DEMO_KEY` to try the plugin out, but it's rate-limited to 30 requests/hour and 50/day shared across *all* users of that key — a real key raises this to 1,000 requests/hour tied to you personally. Get a real key before relying on this plugin for anything ongoing. |
There was a problem hiding this comment.
@BusinessPlatformAutomation I think worth adding a note here that the user will need to add https://apod.nasa.gov/ to their Allowed domains for embedding for the photo of the day to work.
| "displayName": "NASA", | ||
| "version": "1.2.0", | ||
| "author": { | ||
| "name": "sam.jacobs@squaredup.com", |
There was a problem hiding this comment.
| "name": "sam.jacobs@squaredup.com", | |
| "name": "@BusinessPlatformAutomation", |
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