BYTETOOLS

NASA NeoWs (Asteroids) API

Free NASA asteroid API: near-Earth objects by date with size, velocity, miss distance and hazard classification. Works with DEMO_KEY. Tested example.

API key requiredCORS enabledHTTPSFree tier

Endpoint tested and returned HTTP 200 on 20 Aug 2026

What is the NASA NeoWs (Asteroids) API?

NASA's Near Earth Object Web Service (NeoWs) is a free API listing asteroids passing near Earth, with estimated diameter, relative velocity, closest approach distance and whether each is classified as potentially hazardous.

NeoWs draws on NASA's Jet Propulsion Laboratory data, giving you every tracked asteroid making a close approach on a given date, along with its orbital parameters and size estimate.

The `is_potentially_hazardous_asteroid` flag is more nuanced than it sounds. It is a formal classification based on size and minimum orbit intersection distance, not a prediction of impact. Presenting it as 'this asteroid is dangerous' would be badly misleading — the vast majority flagged will never come close to hitting anything.

Quick facts

Base URL
https://api.nasa.gov/neo/rest/v1
Authentication
DEMO_KEY works for testing but is shared and heavily limited. Register a free key at api.nasa.gov.
Rate limit
DEMO_KEY: about 30 requests/hour per IP. Personal key: 1,000/hour.
Pricing
Free. NASA data is public domain.
CORS
Enabled — callable directly from browser JavaScript
Official docs
Read the docs

How to use the NASA NeoWs (Asteroids) API

Every request below was executed against the live API on 20 Aug 2026, and the response shown is the real body it returned — not an illustration.

1. List asteroids approaching on a date

GET https://api.nasa.gov/neo/rest/v1/feed?start_date=2026-08-19&end_date=2026-08-19&api_key=DEMO_KEY

curl
curl 'https://api.nasa.gov/neo/rest/v1/feed?start_date=2026-08-19&end_date=2026-08-19&api_key=DEMO_KEY'
JavaScript (fetch)
const res = await fetch("https://api.nasa.gov/neo/rest/v1/feed?start_date=2026-08-19&end_date=2026-08-19&api_key=DEMO_KEY");
if (!res.ok) throw new Error(`Request failed: ${res.status}`);
const data = await res.json();
console.log(data);
Python (requests)
import requests

res = requests.get("https://api.nasa.gov/neo/rest/v1/feed?start_date=2026-08-19&end_date=2026-08-19&api_key=DEMO_KEY", timeout=20)
res.raise_for_status()
print(res.json())
Response — HTTP 200 (truncated)
{
  "links": {
    "next": "http://api.nasa.gov/neo/rest/v1/feed?start_date=2026-08-20&end_date=2026-08-20&detailed=false&api_key=DEMO_KEY",
    "prev": "http://api.nasa.gov/neo/rest/v1/feed?start_date=2026-08-18&end_date=2026-08-18&detailed=false&api_key=DEMO_KEY",
    "self": "http://api.nasa.gov/neo/rest/v1/feed?start_date=2026-08-19&end_date=2026-08-19&detailed=false&api_key=DEMO_KEY"
  },
  "element_count": 4,
  "near_earth_objects": {
    "2026-08-19": [
      {
        "links": {
          "self": "http://api.nasa.gov/neo/rest/v1/neo/3746623?api_key=DEMO_KEY"
        },
        "id": "3746623",
        "neo_reference_id": "3746623",
        "name": "(2016 EF156)",
        "nasa_jpl_url": "https://ssd.jpl.nasa.gov/tools/sbdb_lookup.html#/?sstr=3746623",
        "absolute_magnitude_h": 24.7,
        "estimated_diameter": {
          "kilometers": {
            "estimated_diameter_min": 0.0305179233,
            "estimated_diameter_max": 0.0682401509
          },
          "meters": {
            "estimated_diameter_min": 30.5179232594,
            "estimated_diameter_max": 68.2401509401
          },
          "miles": {
            "estimated_diameter_min": 0.0189629525,
            "estimated_diameter_max": 0.0424024508
          },
          "feet": {
            "estimated_diameter_min": 100.1244233463,
            "estimated_diameter_max": 223.8850168104
          }
        },
        "is_potentially_hazardous_asteroid": false,
        "close_approach_data": [
          {
            "close_approach_date": "2026-08-19",
            "close_approach_date_full": "2026

Parameters

ParameterTypeRequiredDescription
api_keystringRequiredYour NASA key, or DEMO_KEY. DEMO_KEY
start_date / end_datestringOptionalDate range, maximum 7 days apart. 2026-08-19
feedpathOptionalBrowse approaches by date range. feed
neo/<id>pathOptionalFull orbital data for one asteroid. neo/3542519

Response fields

element_countinteger
Number of asteroids in the response.
near_earth_objectsobject
Keyed by date, each holding an array of asteroids.
...name / idstring
Asteroid designation and NASA identifier.
...estimated_diameterobject
Size estimates in km, m, miles and feet, as min/max ranges.
...is_potentially_hazardous_asteroidboolean
Formal PHA classification — not an impact prediction.
...close_approach_data[].miss_distanceobject
Closest approach in km, miles, lunar distances and AU.
...close_approach_data[].relative_velocityobject
Speed in km/s, km/h and mph.

What you can build with the NASA NeoWs (Asteroids) API

  • Build an asteroid tracker or space awareness dashboard
  • Visualise close approaches over time
  • Create astronomy education resources
  • Compare asteroid sizes and velocities

Common errors and how to fix them

400 date range too large

start_date and end_date must be within 7 days.

Fix: Page through longer periods a week at a time.

429 OVER_RATE_LIMIT

DEMO_KEY's shared allowance is exhausted.

Fix: Register a free key at api.nasa.gov for 1,000 requests/hour.

Diameter is a range, not a number

Size is estimated from brightness, so it is uncertain.

Fix: Use estimated_diameter_min and _max; never present a single precise figure.

NASA NeoWs (Asteroids) API — frequently asked questions

Is the NASA asteroid API free?

Yes. DEMO_KEY works for testing, and registering a free key at api.nasa.gov raises the limit from about 30 to 1,000 requests per hour.

Does 'potentially hazardous' mean an asteroid will hit Earth?

No. It is a formal classification based on size and how closely the orbit can approach Earth's. It is not an impact prediction, and presenting it as one would be seriously misleading.

Why is the diameter given as a range?

Asteroid size is estimated from brightness and assumed reflectivity, so it carries real uncertainty. Always show the min-max range rather than a single figure.

How far ahead can I query?

The feed endpoint accepts a maximum seven-day range per request, so page through longer periods a week at a time.

Tools that pair with this API

Alternatives to NASA NeoWs (Asteroids) API

If NASA NeoWs (Asteroids) does not fit, these science & space apis cover similar ground. Every one was called before publishing, and each links to its own reference page with a working curl command and the response it returned.

APIWhat it doesAuthCORSLast verified
NASA APODFree NASA Astronomy Picture of the Day API. Daily space images with expert explanations, HD URLs and archive access back to 1995. Tested curl example.KeyYes19 Aug 2026
Open Notify ISSFree API returning the International Space Station's live latitude and longitude. No key, updates in real time. Tested curl example and live JSON response.No keyYes19 Aug 2026
USGS EarthquakeFree USGS earthquake API with no key: live global seismic events as GeoJSON, filterable by magnitude, time and location. Tested curl example and live response.No keyYes19 Aug 2026
Launch Library 2Free rocket launch API with no key: upcoming and past launches from every space agency, with rockets, missions, pads and live stream links. Tested example.No keyYes19 Aug 2026
NASA EPICFree NASA EPIC API: full-disc Earth photographs taken daily from the DSCOVR satellite a million miles away, with coordinates and metadata. Tested example.KeyYes20 Aug 2026
NASA Exoplanet ArchiveFree NASA Exoplanet Archive TAP API with no key: query 5,000+ confirmed exoplanets and their host stars with SQL-like ADQL, returning JSON, CSV or VOTable.No keyNo21 Aug 2026
All Science & Space APIs

NASA NeoWs (Asteroids) is an independent third-party service and is not affiliated with ByteTools or ByteVancer. Details on this page were verified on 20 Aug 2026; always check the official documentation before relying on this API in production, as terms and limits can change.