# NASA Near-Earth Objects Scraper - Asteroid Data (`thirdwatch/nasa-near-earth-objects-scraper`) Actor

Export NASA near-Earth asteroid data for a date range or exact object IDs. Get hazard flags, size estimates, approach dates, velocity, miss distance, orbit body, and JPL links.

- **URL**: https://apify.com/thirdwatch/nasa-near-earth-objects-scraper.md
- **Developed by:** [Thirdwatch](https://apify.com/thirdwatch) (community)
- **Categories:** Education
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## NASA Near-Earth Objects Scraper

Collect NASA near-Earth asteroid observations for a date range or exact object IDs. Export size estimates, hazard and sentry flags, close-approach timing, velocity, miss distance, orbiting body, and JPL links.

### What you get

- Official NASA NeoWs feed and object lookup data
- One deduplicated row per near-Earth object
- Close-approach measurements in practical units
- Optional potentially hazardous object filtering

### Output fields

`neo_reference_id`, `name`, `absolute_magnitude_h`, `estimated_diameter_min_km`, `estimated_diameter_max_km`, `potentially_hazardous`, `sentry_object`, `observed_date`, `close_approach_date`, `relative_velocity_kph`, `miss_distance_km`, `orbiting_body`, `nasa_jpl_url`, and `source_url`.

### Example output

```json
{"neo_reference_id":"2524474","name":"524474 (2002 KJ3)","estimated_diameter_max_km":0.8129053443,"potentially_hazardous":false,"close_approach_date":"2026-07-20","relative_velocity_kph":16603.2878,"miss_distance_km":28253000.995}
```

### Input parameters

| Parameter | Description |
|---|---|
| `startDate` | Feed start date, or blank for today. |
| `endDate` | Feed end date, or blank for the start date. |
| `asteroidIds` | Optional exact NASA object IDs. |
| `hazardousOnly` | Save only potentially hazardous objects. |
| `apiKey` | Optional NASA API key; blank uses DEMO\_KEY. |
| `maxResults` | Maximum unique objects to save. |

### Use cases

Space-data dashboards, education, astronomy research, news monitoring, hazard-watch workflows, and STEM projects.

### Limitations

NASA limits feed windows to seven days. `DEMO_KEY` has low shared request limits; provide a free NASA key for repeated or scheduled runs. Hazard classification is NASA's and is not a prediction of impact.

### Compared to alternatives

This Actor starts at $2 per 1,000 objects, below a recent competing Store listing around $3 per 1,000, while exposing normalized close-approach fields. Try the [NASA Near-Earth Objects Scraper](https://apify.com/thirdwatch/nasa-near-earth-objects-scraper), browse [Thirdwatch Actors](https://apify.com/thirdwatch), or open the [NASA Actor guide](https://thirdwatch.dev/actors/nasa-near-earth-objects-scraper).

### FAQ

**Do I need a NASA key?** No for light use; the default is NASA's `DEMO_KEY`.

**What is one billable result?** One unique near-Earth object saved to the dataset.

Open the [input form](https://apify.com/thirdwatch/nasa-near-earth-objects-scraper?tab=input) or review [recent runs](https://apify.com/thirdwatch/nasa-near-earth-objects-scraper?tab=runs).

Last verified: 2026-07

# Actor input Schema

## `startDate` (type: `string`):

Start date in YYYY-MM-DD. Leave blank to use today.

## `endDate` (type: `string`):

End date in YYYY-MM-DD. Leave blank to use the start date. NASA supports windows up to seven days.

## `asteroidIds` (type: `array`):

Optional exact NASA near-Earth object IDs to look up after the date feed.

## `hazardousOnly` (type: `boolean`):

Save only objects NASA marks as potentially hazardous.

## `apiKey` (type: `string`):

Optional NASA API key. Leave blank to use DEMO\_KEY with its lower request limits.

## `maxResults` (type: `integer`):

Stop after this many unique near-Earth objects.

## Actor input object example

```json
{
  "startDate": "2026-07-21",
  "endDate": "2026-07-21",
  "asteroidIds": [
    "2524474"
  ],
  "hazardousOnly": false,
  "maxResults": 10
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "startDate": "2026-07-21",
    "endDate": "2026-07-21",
    "asteroidIds": [
        "2524474"
    ],
    "maxResults": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("thirdwatch/nasa-near-earth-objects-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "startDate": "2026-07-21",
    "endDate": "2026-07-21",
    "asteroidIds": ["2524474"],
    "maxResults": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("thirdwatch/nasa-near-earth-objects-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "startDate": "2026-07-21",
  "endDate": "2026-07-21",
  "asteroidIds": [
    "2524474"
  ],
  "maxResults": 10
}' |
apify call thirdwatch/nasa-near-earth-objects-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,thirdwatch/nasa-near-earth-objects-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/fNu62gbo2T00V1gcB/builds/ipv7eybb3frF7BkE2/openapi.json
