# NASA API

> NASA returns astronomy pictures, space media, asteroid approaches, natural events, and ISS sightings as a workflow and API.

NASA (National Aeronautics and Space Administration) returns dated astronomy pictures when you provide a date, or uses today by default. Search images finds photos, videos, or audio using required search words and optional year and media filters. List near earth asteroids, List natural events, and Get iss sightings return approaches, events, and city sightings using dates, filters, or a city.

- Page: https://fous.com/tools/nasa
- Handle: `@nasa`
- Category: [Science](https://fous.com/tools/category/science)
- Source website: https://nasa.gov
- Last verified: Oct 7, 2026

## Methods

### Get astronomy picture of the day

Operation `get_astronomy_picture_of_the_day`, version 1. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.

Get the Astronomy Picture of the Day, its explanation, media links, and credits for a date. Dates start June 16, 1995; today’s entry may not be published yet.

**Input**

| Field | Type | Required | Example | Description |
|---|---|---|---|---|
| `date` | string | no | `"2025-09-14"` | Picture date in YYYY-MM-DD, such as 2025-09-14. Defaults to today. |

**Input schema**

```json
{
  "type": "object",
  "properties": {
    "date": {
      "type": "string",
      "format": "date",
      "description": "Picture date in YYYY-MM-DD, such as 2025-09-14. Defaults to today.",
      "examples": [
        "2025-09-14",
        "2026-09-28",
        "1995-06-16"
      ]
    }
  },
  "additionalProperties": false,
  "examples": [
    {
      "date": "2025-09-14"
    },
    {
      "date": "2026-09-28"
    },
    {
      "date": "1995-06-16"
    }
  ]
}
```

**Output**

| Field | Type | Example | Description |
|---|---|---|---|
| `date` | string | `"2025-09-14"` | Date of this APOD entry. |
| `title` | string | `"Planets of the Solar System: Tilts and Spins"` | Title of the picture. |
| `credit` | string or null | `"NASA ,  Animation:  James O'Donoghue ( U. Reading )"` | Image or video credit as plain text, if listed. |
| `copyright` | string or null | `"Telescope Live, Heaven's Mirror Observatory ; Processing: Chris Cantrell"` | Copyright information as plain text, if listed. |
| `page_link` | string | `"https://apod.nasa.gov/apod/ap250914.html"` | APOD page for this date. |
| `media_link` | string | `"https://www.youtube.com/embed/my1euFQHH-o?feature=oembed"` | Link to the featured image or video. |
| `media_type` | string | `"video"` | Type of featured media. |
| `explanation` | string |  | Explanation in plain text. |
| `high_resolution_image_link` | string or null | `"https://assets.science.nasa.gov/content/dam/science/cds/apod/apod/1995/june/e_lens.gif?w=204&h=204&fit=clip&crop=faces%` | Higher-resolution image link, if one is provided. |

**Example input**

```json
{
  "date": "2025-09-14"
}
```

**Example output**

```json
{
  "date": "2025-09-14",
  "title": "Planets of the Solar System: Tilts and Spins",
  "credit": "NASA ,  Animation:  James O'Donoghue ( U. Reading )",
  "copyright": null,
  "page_link": "https://apod.nasa.gov/apod/ap250914.html",
  "media_link": "https://www.youtube.com/embed/my1euFQHH-o?feature=oembed",
  "media_type": "video",
  "explanation": "How does your favorite planet spin? Does it spin rapidly around a nearly vertical axis, or horizontally, or backwards? The featured video animates NASA images of all eight planets in our Solar System …",
  "high_resolution_image_link": null
}
```

### Get iss sightings

Operation `get_iss_sightings`, version 1. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.

Find upcoming International Space Station sightings for a city in NASA’s city list, with local start times, visibility and sky directions. Cities without scheduled passes return an empty list.

**Input**

| Field | Type | Required | Example | Description |
|---|---|---|---|---|
| `city` | string | yes | `"London, United Kingdom"` | City followed by its state or country, for example Chicago, Illinois or Manchester, United Kingdom. |
| `max_results` | integer | no | `1` | Maximum number of upcoming sightings to return, for example 10. |

**Input schema**

```json
{
  "type": "object",
  "required": [
    "city"
  ],
  "properties": {
    "city": {
      "type": "string",
      "description": "City followed by its state or country, for example Chicago, Illinois or Manchester, United Kingdom.",
      "examples": [
        "London, United Kingdom",
        "Chicago, Illinois",
        "Manchester, United Kingdom"
      ]
    },
    "max_results": {
      "type": "integer",
      "default": 10,
      "maximum": 30,
      "minimum": 1,
      "description": "Maximum number of upcoming sightings to return, for example 10.",
      "x-fous-developer": true,
      "examples": [
        1
      ]
    }
  },
  "additionalProperties": false,
  "examples": [
    {
      "city": "London, United Kingdom",
      "max_results": 1
    },
    {
      "city": "Chicago, Illinois"
    },
    {
      "city": "Manchester, United Kingdom"
    }
  ]
}
```

**Output**

| Field | Type | Example | Description |
|---|---|---|---|
| `sightings` | array |  |  |
| `sightings[].date` | string | `"2026-09-29"` |  |
| `sightings[].appears` | string | `"10° above WSW"` |  |
| `sightings[].page_link` | string | `"https://iss-sts.hqmce.nasa.gov/iss-sts-cities-html/United_Kingdom-England-London.html"` |  |
| `sightings[].disappears` | string | `"10° above SSW"` |  |
| `sightings[].local_start_time` | string | `"2026-09-29T19:38:00+01:00"` |  |
| `sightings[].maximum_height_degrees` | integer | `11` |  |
| `sightings[].visible_duration_minutes` | integer | `2` |  |
| `matched_city` | string | `"London, England, United Kingdom"` | Matched city and region or country. |

**Example input**

```json
{
  "city": "London, United Kingdom",
  "max_results": 1
}
```

**Example output**

```json
{
  "sightings": [
    {
      "date": "2026-09-29",
      "appears": "10° above WSW",
      "page_link": "https://iss-sts.hqmce.nasa.gov/iss-sts-cities-html/United_Kingdom-England-London.html",
      "disappears": "10° above SSW",
      "local_start_time": "2026-09-29T19:38:00+01:00",
      "maximum_height_degrees": 11,
      "visible_duration_minutes": 2
    }
  ],
  "matched_city": "London, England, United Kingdom"
}
```

### List natural events

Operation `list_natural_events`, version 1. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.

List EONET natural events with latest observations in the past number of days, most recent first. A country or region filter matches reported event locations against mapped boundaries; locations and ongoing status are approximate, and not all events have a reported size or strength.

**Input**

| Field | Type | Required | Example | Description |
|---|---|---|---|---|
| `days_back` | integer | no | `30` | Include observations from this many days including today, for example 30. |
| `open_only` | boolean | no | `true` | Include only ongoing events, for example true. |
| `event_type` | string | no | `"wildfires"` | Event category, for example wildfires. |
| `max_results` | integer | no | `20` | Maximum number of events to return, for example 50. |
| `country_or_region` | string | no | `"California"` | Country or region name to restrict results, for example California or Australia. Leave blank for anywhere. |

**Input schema**

```json
{
  "type": "object",
  "properties": {
    "days_back": {
      "type": "integer",
      "default": 30,
      "maximum": 365,
      "minimum": 1,
      "description": "Include observations from this many days including today, for example 30.",
      "examples": [
        30,
        14
      ]
    },
    "open_only": {
      "type": "boolean",
      "default": true,
      "description": "Include only ongoing events, for example true.",
      "examples": [
        true,
        false
      ]
    },
    "event_type": {
      "enum": [
        "any",
        "wildfires",
        "volcanoes",
        "severe_storms",
        "sea_and_lake_ice",
        "floods",
        "dust_and_haze"
      ],
      "type": "string",
      "default": "any",
      "description": "Event category, for example wildfires.",
      "examples": [
        "wildfires",
        "severe_storms",
        "volcanoes"
      ]
    },
    "max_results": {
      "type": "integer",
      "default": 50,
      "maximum": 200,
      "minimum": 1,
      "description": "Maximum number of events to return, for example 50.",
      "x-fous-developer": true,
      "examples": [
        20,
        15
      ]
    },
    "country_or_region": {
      "type": "string",
      "default": "",
      "description": "Country or region name to restrict results, for example California or Australia. Leave blank for anywhere.",
      "examples": [
        "California"
      ]
    }
  },
  "additionalProperties": false,
  "examples": [
    {
      "days_back": 30,
      "open_only": true,
      "event_type": "wildfires",
      "max_results": 20,
      "country_or_region": "California"
    },
    {
      "days_back": 30,
      "open_only": false,
      "event_type": "severe_storms",
      "max_results": 15
    },
    {
      "days_back": 14,
      "open_only": true,
      "event_type": "volcanoes",
      "max_results": 20
    }
  ]
}
```

**Output**

| Field | Type | Example | Description |
|---|---|---|---|
| `events` | array |  | Matching natural events, most recent observation first. |
| `events[].ongoing` | string | `"yes"` | Whether EONET still considers the event open. |
| `events[].latitude` | number or null | `36.601661` | Latest reported latitude. |
| `events[].longitude` | number or null | `-118.9721` | Latest reported longitude. |
| `events[].page_link` | string | `"https://eonet.gsfc.nasa.gov/api/v3/events/EONET_24810"` | Page for this event at EONET. |
| `events[].event_name` | string | `"Prescribed Fire CRAWFORD CORRAL RX, Tulare, California"` | Natural event name. |
| `events[].event_type` | string | `"Wildfires"` | EONET event category. |
| `events[].source_links` | array |  | Links supplied by event sources. |
| `events[].eonet_event_id` | string | `"EONET_24810"` | EONET event identifier. |
| `events[].size_or_strength` | string or null | `"690 acres"` | Latest reported magnitude and unit, when available. |
| `events[].latest_observation_date` | string | `"2026-09-19"` | Date of the latest reported observation. |

**Example input**

```json
{
  "days_back": 30,
  "open_only": true,
  "event_type": "wildfires",
  "max_results": 20,
  "country_or_region": "California"
}
```

**Example output**

```json
{
  "events": [
    {
      "ongoing": "yes",
      "latitude": 36.601661,
      "longitude": -118.9721,
      "page_link": "https://eonet.gsfc.nasa.gov/api/v3/events/EONET_24810",
      "event_name": "Prescribed Fire CRAWFORD CORRAL RX, Tulare, California",
      "event_type": "Wildfires",
      "source_links": [
        "https://irwin.doi.gov/observer/incidents/2026-CATUU-000092"
      ],
      "eonet_event_id": "EONET_24810",
      "size_or_strength": "690 acres",
      "latest_observation_date": "2026-09-19"
    },
    {
      "ongoing": "yes",
      "latitude": 39.394425,
      "longitude": -120.025216,
      "page_link": "https://eonet.gsfc.nasa.gov/api/v3/events/EONET_24488",
      "event_name": "Wildfire FLORISTON, Nevada, California",
      "event_type": "Wildfires",
      "source_links": [
        "https://irwin.doi.gov/observer/incidents/2026-CANEU-029037"
      ],
      "eonet_event_id": "EONET_24488",
      "size_or_strength": "610 acres",
      "latest_observation_date": "2026-09-16"
    },
    {
      "ongoing": "yes",
      "latitude": 37.5662,
      "longitude": -119.616167,
      "page_link": "https://eonet.gsfc.nasa.gov/api/v3/events/EONET_24484",
      "event_name": "Wildfire DOME, Mariposa, California",
      "event_type": "Wildfires",
      "source_links": [
        "https://irwin.doi.gov/observer/incidents/2026-CAYNP-000100"
      ],
      "eonet_event_id": "EONET_24484",
      "size_or_strength": "1177 acres",
      "latest_observation_date": "2026-09-15"
    }
  ]
}
```

### List near earth asteroids

Operation `list_near_earth_asteroids`, version 1. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.

List near-Earth asteroids approaching Earth between two dates within a chosen distance, with UTC approach times, size ranges, speed, and hazard status. Dates are inclusive UTC calendar days; measured size ranges use one standard deviation, and other sizes are estimated from brightness.

**Input**

| Field | Type | Required | Example | Description |
|---|---|---|---|---|
| `end_date` | string | no | `"2026-10-06"` | Last UTC calendar day to include, for example 2026-10-06. Defaults to seven days after the start date and cannot be later. |
| `start_date` | string | no | `"2026-09-29"` | First UTC calendar day to include, for example 2026-09-29. Defaults to today. |
| `max_distance_miles` | number | no | `5000000` | Maximum Earth miss distance in miles, for example 5000000. Defaults to 5,000,000 miles. |

**Input schema**

```json
{
  "type": "object",
  "properties": {
    "end_date": {
      "type": "string",
      "format": "date",
      "description": "Last UTC calendar day to include, for example 2026-10-06. Defaults to seven days after the start date and cannot be later.",
      "examples": [
        "2026-10-06",
        "2029-04-20",
        "2029-04-13"
      ]
    },
    "start_date": {
      "type": "string",
      "format": "date",
      "description": "First UTC calendar day to include, for example 2026-09-29. Defaults to today.",
      "examples": [
        "2026-09-29",
        "2029-04-13"
      ]
    },
    "max_distance_miles": {
      "type": "number",
      "default": 5000000,
      "minimum": 0,
      "description": "Maximum Earth miss distance in miles, for example 5000000. Defaults to 5,000,000 miles.",
      "examples": [
        5000000,
        100
      ]
    }
  },
  "additionalProperties": false,
  "examples": [
    {
      "end_date": "2026-10-06",
      "start_date": "2026-09-29"
    },
    {
      "end_date": "2029-04-20",
      "start_date": "2029-04-13",
      "max_distance_miles": 5000000
    },
    {
      "end_date": "2029-04-13",
      "start_date": "2029-04-13",
      "max_distance_miles": 100
    }
  ]
}
```

**Output**

| Field | Type | Example | Description |
|---|---|---|---|
| `asteroids` | array |  | Asteroid approaches ordered by closest approach time in UTC. Empty if none match. |
| `asteroids[].speed_kmh` | number | `55952.26` |  |
| `asteroids[].speed_mph` | number | `34767.13` |  |
| `asteroids[].size_basis` | string | `"estimated from brightness"` | Measured diameter or estimated from brightness; unavailable if no size or brightness is known. |
| `asteroids[].asteroid_name` | string | `"2026 RE51"` | Asteroid name or designation. |
| `asteroids[].jpl_page_link` | string | `"https://ssd.jpl.nasa.gov/tools/sbdb_lookup.html#/?sstr=2026%20RE51"` |  |
| `asteroids[].size_max_feet` | number or null | `263.41` |  |
| `asteroids[].size_min_feet` | number or null | `117.8` |  |
| `asteroids[].size_max_meters` | number or null | `80.29` |  |
| `asteroids[].size_min_meters` | number or null | `35.91` |  |
| `asteroids[].miss_distance_km` | number | `7716401.84` |  |
| `asteroids[].miss_distance_miles` | number | `4794749.81` |  |
| `asteroids[].potentially_hazardous` | string | `"no"` |  |
| `asteroids[].closest_approach_time_utc` | string | `"2026-09-29T16:21:21+00:00"` | Closest approach in UTC (ISO 8601). |
| `asteroids[].miss_distance_moon_distances` | number | `20.0739` |  |

**Example input**

```json
{
  "end_date": "2026-10-06",
  "start_date": "2026-09-29"
}
```

**Example output**

```json
{
  "asteroids": [
    {
      "speed_kmh": 55952.26,
      "speed_mph": 34767.13,
      "size_basis": "estimated from brightness",
      "asteroid_name": "2026 RE51",
      "jpl_page_link": "https://ssd.jpl.nasa.gov/tools/sbdb_lookup.html#/?sstr=2026%20RE51",
      "size_max_feet": 263.41,
      "size_min_feet": 117.8,
      "size_max_meters": 80.29,
      "size_min_meters": 35.91,
      "miss_distance_km": 7716401.84,
      "miss_distance_miles": 4794749.81,
      "potentially_hazardous": "no",
      "closest_approach_time_utc": "2026-09-29T16:21:21+00:00",
      "miss_distance_moon_distances": 20.0739
    },
    {
      "speed_kmh": 37043.73,
      "speed_mph": 23017.91,
      "size_basis": "estimated from brightness",
      "asteroid_name": "2026 SB12",
      "jpl_page_link": "https://ssd.jpl.nasa.gov/tools/sbdb_lookup.html#/?sstr=2026%20SB12",
      "size_max_feet": 167.04,
      "size_min_feet": 74.7,
      "size_max_meters": 50.91,
      "size_min_meters": 22.77,
      "miss_distance_km": 3887673.64,
      "miss_distance_miles": 2415688.41,
      "potentially_hazardous": "no",
      "closest_approach_time_utc": "2026-09-30T09:17:28+00:00",
      "miss_distance_moon_distances": 10.1136
    },
    {
      "speed_kmh": 21657.12,
      "speed_mph": 13457.11,
      "size_basis": "estimated from brightness",
      "asteroid_name": "2026 RS",
      "jpl_page_link": "https://ssd.jpl.nasa.gov/tools/sbdb_lookup.html#/?sstr=2026%20RS",
      "size_max_feet": 137.6,
      "size_min_feet": 61.54,
      "size_max_meters": 41.94,
      "size_min_meters": 18.76,
      "miss_distance_km": 4279439.48,
      "miss_distance_miles": 2659120.41,
      "potentially_hazardous": "no",
      "closest_approach_time_utc": "2026-09-30T10:16:52+00:00",
      "miss_distance_moon_distances": 11.1328
    }
  ]
}
```

### Search images

Operation `search_images`, version 1. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.

Search NASA public photos, videos, or audio by words and creation year. Returns up to 100 matches in relevance order; thumbnails and credits may be missing.

**Input**

| Field | Type | Required | Example | Description |
|---|---|---|---|---|
| `query` | string | yes | `"Saturn rings"` | Words to search for, for example Saturn rings. |
| `end_year` | integer | no | `1970` | Latest creation year, for example 1970. |
| `media_type` | string | no | `"video"` | Type of media to find, for example image. |
| `start_year` | integer | no | `1969` | Earliest creation year, for example 1969. |
| `max_results` | integer | no | `3` | Maximum matches to return, for example 20. |

**Input schema**

```json
{
  "type": "object",
  "required": [
    "query"
  ],
  "properties": {
    "query": {
      "type": "string",
      "minLength": 1,
      "description": "Words to search for, for example Saturn rings.",
      "examples": [
        "Saturn rings",
        "Apollo 11 launch",
        "Apollo 11"
      ]
    },
    "end_year": {
      "type": "integer",
      "maximum": 2100,
      "minimum": 1800,
      "description": "Latest creation year, for example 1970.",
      "examples": [
        1970
      ]
    },
    "media_type": {
      "enum": [
        "image",
        "video",
        "audio"
      ],
      "type": "string",
      "default": "image",
      "description": "Type of media to find, for example image.",
      "examples": [
        "video",
        "audio"
      ]
    },
    "start_year": {
      "type": "integer",
      "maximum": 2100,
      "minimum": 1800,
      "description": "Earliest creation year, for example 1969.",
      "examples": [
        1969
      ]
    },
    "max_results": {
      "type": "integer",
      "default": 20,
      "maximum": 100,
      "minimum": 1,
      "description": "Maximum matches to return, for example 20.",
      "x-fous-developer": true,
      "examples": [
        3,
        4,
        2
      ]
    }
  },
  "additionalProperties": false,
  "examples": [
    {
      "query": "Saturn rings"
    },
    {
      "query": "Apollo 11 launch",
      "media_type": "video",
      "max_results": 3
    },
    {
      "query": "Apollo 11 launch",
      "end_year": 1970,
      "start_year": 1969,
      "max_results": 4
    }
  ]
}
```

**Output**

| Field | Type | Example | Description |
|---|---|---|---|
| `results` | array |  |  |
| `results[].title` | string or null | `"Saturn Rings"` |  |
| `results[].keywords` | array |  |  |
| `results[].page_link` | string | `"https://images.nasa.gov/details/PIA02241"` |  |
| `results[].description` | string or null | `"Saturn Rings"` |  |
| `results[].nasa_center` | string or null | `"Jet Propulsion Laboratory"` |  |
| `results[].date_created` | string or null | `"2000-02-07"` |  |
| `results[].nasa_media_id` | string | `"PIA02241"` |  |
| `results[].full_size_link` | string or null | `"https://images-assets.nasa.gov/image/PIA02241/PIA02241~orig.jpg"` |  |
| `results[].thumbnail_link` | string or null | `"https://images-assets.nasa.gov/image/PIA02241/PIA02241~thumb.jpg"` |  |
| `results[].photographer_or_credit` | string or null | `"NASA/JPL"` |  |

**Example input**

```json
{
  "query": "Saturn rings"
}
```

**Example output**

```json
{
  "results": [
    {
      "title": "Saturn Rings",
      "keywords": [
        "S Rings",
        "Voyager"
      ],
      "page_link": "https://images.nasa.gov/details/PIA02241",
      "description": "Saturn Rings",
      "nasa_center": "Jet Propulsion Laboratory",
      "date_created": "2000-02-07",
      "nasa_media_id": "PIA02241",
      "full_size_link": "https://images-assets.nasa.gov/image/PIA02241/PIA02241~orig.jpg",
      "thumbnail_link": "https://images-assets.nasa.gov/image/PIA02241/PIA02241~thumb.jpg",
      "photographer_or_credit": "NASA/JPL"
    },
    {
      "title": "Saturn A-ring",
      "keywords": [
        "S Rings",
        "Voyager"
      ],
      "page_link": "https://images.nasa.gov/details/PIA01952",
      "description": "Saturn A-ring",
      "nasa_center": "Jet Propulsion Laboratory",
      "date_created": "1999-04-11",
      "nasa_media_id": "PIA01952",
      "full_size_link": "https://images-assets.nasa.gov/image/PIA01952/PIA01952~orig.jpg",
      "thumbnail_link": "https://images-assets.nasa.gov/image/PIA01952/PIA01952~thumb.jpg",
      "photographer_or_credit": "NASA/JPL"
    },
    {
      "title": "Saturn A-Ring",
      "keywords": [
        "S Rings",
        "Voyager"
      ],
      "page_link": "https://images.nasa.gov/details/PIA01988",
      "description": "Saturn A-Ring",
      "nasa_center": "Jet Propulsion Laboratory",
      "date_created": "1999-07-23",
      "nasa_media_id": "PIA01988",
      "full_size_link": "https://images-assets.nasa.gov/image/PIA01988/PIA01988~orig.jpg",
      "thumbnail_link": "https://images-assets.nasa.gov/image/PIA01988/PIA01988~thumb.jpg",
      "photographer_or_credit": "NASA/JPL"
    }
  ]
}
```

## Quick start

Replace `YOUR_API_KEY` with a Fous API key. To create one, open Developers at the bottom of Fous Studio, turn on Developer mode, then go to API keys (https://app.fous.com/keys). Change the values in `input` to run the same tool on new data.

```bash
curl 'https://api.fous.com/v1/query' \
  --fail-with-body --silent --show-error --max-time 180 \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "api": "@nasa",
  "visibility": "public",
  "operation": "get_astronomy_picture_of_the_day",
  "version": 1,
  "input": {
    "date": "2025-09-14"
  },
  "response": {
    "format": "json"
  }
}'
```

```python
# Save as fous.py and run with python3 fous.py. No packages needed.
import json
import urllib.error
import urllib.request

api_key = "YOUR_API_KEY"

body = json.loads("{\n  \"api\": \"@nasa\",\n  \"visibility\": \"public\",\n  \"operation\": \"get_astronomy_picture_of_the_day\",\n  \"version\": 1,\n  \"input\": {\n    \"date\": \"2025-09-14\"\n  },\n  \"response\": {\n    \"format\": \"json\"\n  }\n}")
request = urllib.request.Request(
    "https://api.fous.com/v1/query",
    data=json.dumps(body).encode("utf-8"),
    headers={
        "Authorization": f"Bearer {api_key}",
        "Content-Type": "application/json",
    },
    method="POST",
)
try:
    with urllib.request.urlopen(request, timeout=180) as response:
        result = json.load(response)
except urllib.error.HTTPError as error:
    raise RuntimeError(f"HTTP {error.code}: {error.read().decode('utf-8', errors='replace')}") from error
if result.get("success") is False:
    raise RuntimeError(result.get("error", {}).get("message", "Request failed"))
print(json.dumps(result["data"]["output"], indent=2))
```

```typescript
// Save as fous.mts and run with npx tsx fous.mts.
const apiKey = "YOUR_API_KEY";

const response = await fetch("https://api.fous.com/v1/query", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${apiKey}`,
    "Content-Type": "application/json",
  },
  signal: AbortSignal.timeout(180_000),
  body: JSON.stringify({
  "api": "@nasa",
  "visibility": "public",
  "operation": "get_astronomy_picture_of_the_day",
  "version": 1,
  "input": {
    "date": "2025-09-14"
  },
  "response": {
    "format": "json"
  }
}),
});
type ApiResult = { success: boolean; data?: { output: unknown }; error?: { message: string } };
const result: ApiResult = await response.json();
if (!response.ok || result.success === false) {
  throw new Error(result.error?.message ?? `HTTP ${response.status}`);
}
if (!result.data) throw new Error("Missing API response data");
console.log(result.data.output);
```

## Use from an AI assistant

Connect this tool to Claude Code, Claude Desktop, Cursor, VS Code, Codex and any MCP client as its own MCP server. Each method is a typed tool whose arguments are the method’s input.

- Server URL: `https://api.fous.com/mcp/tools/nasa`
- Authorization: `Authorization: Bearer <Fous API key>`

**Tools**

- `get_astronomy_picture_of_the_day`: Get astronomy picture of the day. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.
- `get_iss_sightings`: Get iss sightings. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.
- `list_natural_events`: List natural events. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.
- `list_near_earth_asteroids`: List near earth asteroids. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.
- `search_images`: Search images. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.
- `fous_get_run`: the result of a run that was still going, by its `request_id`. Free.

Claude Code:

```bash
claude mcp add --scope user --transport http fous-nasa https://api.fous.com/mcp/tools/nasa --header "Authorization: Bearer ${FOUS_API_KEY:?Set FOUS_API_KEY to your Fous API key}"
```

To give the assistant every tool, connect `https://api.fous.com/mcp`: it finds one with `fous_search_tools` and runs it with `fous_run_tool`. Setup for other clients: https://fous.com/llms-full.txt.

## Use cases

- Find NASA media about a topic and creation year
- Review asteroid approach distances, speeds, sizes, and hazard status
- Track recent natural events by type or region
- Plan when to watch the ISS from a city
- Retrieve astronomy pictures and explanations for selected dates

## FAQ

### Can I run it with my own inputs?

Yes. Change the inputs in Studio and press Run, or send new inputs from your code, or ask a connected AI assistant.

### Can I call this NASA tool as an API?

Yes. Send a POST request to /v1/query with your Fous API key and the inputs, and get JSON back.

### How much does it cost?

Each completed run costs 1 credit. Failed runs without a completed receipt are free; completed work can remain charged if delivery is interrupted. With pay as you go, a credit costs 1¢. Monthly plans cost less per credit.

### Do I need a NASA account?

No. You only need a Fous account.

### How current is the data?

Fous gets the data from nasa.gov when you run it. Some results are reused for up to 24 hours, and results that use your account or key are never reused. It was last verified on Oct 7, 2026.

### What is NASA’s astronomy picture for a date?

Get astronomy picture of the day returns the picture title, explanation, media links, and credits for the date you provide.

### Which asteroids will approach Earth during a date range?

List near earth asteroids returns matching approaches, closest approach times, distances, speeds, size ranges, and hazard status.

### When can I see the ISS from my city?

Get iss sightings returns upcoming sightings for a city, including local start times, visibility duration, and sky directions.

## Related

- [USGS Earthquakes API](https://fous.com/tools/usgs-earthquakes.md): USGS Earthquakes provides recent event details, nearby earthquake distances and local times, and significant worldwide events from the past day, week, or month; some impact, felt, and alert information may be unavailable.
- [National Archives API](https://fous.com/tools/national-archives.md): Search the public U.S. National Archives Catalog for historical records.
- [NPR API](https://fous.com/tools/npr.md): NPR returns displayed section headlines, searchable articles with summaries and publication details, and available article text; date-filtered searches may miss older stories edited much later.
- [AP News API](https://fous.com/tools/ap-news.md): AP News provides reporting, up to 50 public-page headlines, searchable articles visible in its search, and full text when accessible.
- [The Space Devs API](https://fous.com/tools/the-space-devs.md): The Space Devs provides worldwide rocket launch schedules and mission details; public development listings may lag, and some launch details may be missing.
- [Google Search API](https://fous.com/tools/google-search.md): Google Search returns public web, image, job, event, related-question, and autocomplete results in Google’s order, with answers and details when available; results may be fewer, omit information, or be empty.
- [NOAA Space Weather API](https://fous.com/tools/noaa-space-weather.md): NOAA Space Weather provides near-term aurora chances, current geomagnetic activity, a three-day Kp outlook, and NOAA alerts from the past 1–7 days.
- [Wayback Machine API](https://fous.com/tools/wayback-machine.md): Wayback Machine lets you explore archived websites, find the closest page capture to a past date, and review captures over time; the nearest capture may fall outside the requested period.
- [All Science tools](https://fous.com/tools/category/science)
