DEV Community

Lucian (LKB)
Lucian (LKB)

Posted on

I pulled a year of NASA & NOAA data into the browser with 3 keyless APIs — here's what it showed

Public science agencies expose a surprising amount of live data over plain HTTP — no key, no OAuth, no backend needed. You can fetch() it straight from a browser tab. I spent a while doing exactly that for three questions I was curious about, and the answers were sharp enough to write up. Here's each one, the actual call, and what it found.

1. How many asteroids passed closer than the Moon this year?

NASA/JPL's Close-Approach Data API logs every known object that comes within a set distance. Ask it for one lunar distance:

const url = 'https://ssd-api.jpl.nasa.gov/cad.api'
          + '?date-min=2025-08-22&date-max=2026-08-22&dist-max=1LD&sort=dist';
const { fields, data } = await (await fetch(url)).json();
const di = fields.indexOf('dist');            // AU, from Earth's centre
const LD = 384400, AU = 149597870.7;
const ld = r => +r[di] * AU / LD;
console.log({
  within1LD:  data.length,
  insideGEO:  data.filter(r => ld(r) <= 0.11).length, // geostationary belt
  closest:    data[0][fields.indexOf('des')],
});
// → { within1LD: 204, insideGEO: 12, closest: '2025 UC11' }
Enter fullscreen mode Exit fullscreen mode

204 known asteroids passed within a lunar distance in the last 12 months. Twelve crossed inside the geostationary satellite belt. The closest, 2025 UC11, passed about 228 km above the surface — below the ISS. (All small, all tracked, all missed — the full write-up has the distance histogram and why 204 is a floor, not a ceiling.)

2. How far south did the aurora reach?

Whether you can see the northern lights comes down to the planetary K-index (Kp). GFZ Potsdam serves the definitive series as JSON:

const url = 'https://kp.gfz.de/app/json/?start=2025-08-22T00:00:00Z'
          + '&end=2026-08-22T00:00:00Z&index=Kp';
const { Kp, datetime } = await (await fetch(url)).json();
const rows = datetime.map((t, i) => [t, Kp[i]]).filter(([, k]) => k >= 0);
const peak = Math.max(...rows.map(([, k]) => k));
const stormNights = new Set(rows.filter(([, k]) => k >= 5).map(([t]) => t.slice(0,10))).size;
console.log({ peakKp: peak, stormNights });
// → { peakKp: 8.67, stormNights: 62 }
Enter fullscreen mode Exit fullscreen mode

Activity peaked at Kp 8.67 — a G4 severe storm — and 62 of 366 nights hit storm level. Under NOAA's own scale, a G4 can bring the aurora as far south as Alabama. Full post + NOAA G-scale table.

3. Where do the climate vital signs stand?

The four headline climate indicators each come from a primary agency (NOAA, the Met Office, NSIDC). I keep them as small JSON files with latest/trend/source fields:

const base = 'https://lkforge.com/tools/climate/data/';
for (const m of ['co2', 'global-temperature', 'methane', 'arctic-sea-ice']) {
  const d = await (await fetch(base + m + '.json')).json();
  console.log(m, '', d.latest.v, d.unit, '|', d.trend.pct + '% vs', d.first.t);
}
// co2 → 429.12 ppm | +35.9% vs 1958
// global-temperature → 1.39 °C | ... vs 1850
// methane → 1937.59 ppb | +19.2% vs 1983
// arctic-sea-ice → 4.75 million km² | -32.7% vs 1979
Enter fullscreen mode Exit fullscreen mode

CO₂ at 429 ppm, global temperature +1.39 °C above the 1850s, methane 1,938 ppb, Arctic summer sea ice down 32.7%. The dated snapshot charts each series behind the number.

The point

None of these needed a key or a server — three fetch() calls against public agency endpoints. If you build anything data-driven, these feeds (JPL CAD, GFZ Kp, NOAA GML) are underused and genuinely fun to poke at. Every figure above is reproducible from the snippets; the linked posts have the charts and the caveats.

I build free, no-signup space and climate tools at LK Forge that run on exactly these feeds — all client-side.

Top comments (0)