# NASA Image and Video Library API

> Returns NASA photos, videos and audio from search, albums, asset files, metadata links and captions.

Category: Government & Open Data. Region: US. 5 endpoints at `https://api.hoshime.com/v1/nasaimages/<endpoint>`, `GET` with query parameters, answering `{data, meta}` (see https://hoshime.com/docs/responses.md). Reference: https://hoshime.com/docs/platforms/nasaimages
## GET /v1/nasaimages/search

Search the NASA Image and Video Library for photos, videos and audio.

Scope: `social:read` · Units: 1 · Cached: 60 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `query` | string | yes | Words to search for, such as apollo 11. (e.g. apollo 11) |
| `mediaType` | string | no | Only this kind of media: image, video or audio. (one of image, video, audio; e.g. image) |
| `limit` | integer | no | Items per page, from 1 to 100. (default 10) |
| `cursor` | string | no | meta.pagination.nextCursor of the previous page. Omit it for the first page. |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `center` (string), `createdAt` (string), `description` (string), `keywords` (Label[]), `keywords[].name` (string), `mediaType` (string), `nasaId` (string), `thumbnailUrl` (string), `title` (string)

```bash
curl "https://api.hoshime.com/v1/nasaimages/search?query=apollo+11&mediaType=image" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/nasaimages/asset

The files of one NASA item (image sizes, video or audio), by its NASA id.

Scope: `social:read` · Units: 1 · Cached: 1440 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `nasaId` | string | yes | NASA id of the item, such as as11-40-5874. (e.g. as11-40-5874) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `files` (File[]), `files[].url` (string), `nasaId` (string)

```bash
curl "https://api.hoshime.com/v1/nasaimages/asset?nasaId=as11-40-5874" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/nasaimages/album

The items of one curated NASA album, such as Apollo_11, 100 per page.

Scope: `social:read` · Units: 1 · Cached: 60 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `name` | string | yes | Album name as NASA writes it, such as Apollo_11. (e.g. Apollo_11) |
| `cursor` | string | no | meta.pagination.nextCursor of the previous page. Omit it for the first page. |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `center` (string), `createdAt` (string), `description` (string), `keywords` (Label[]), `keywords[].name` (string), `mediaType` (string), `nasaId` (string), `thumbnailUrl` (string), `title` (string)

```bash
curl "https://api.hoshime.com/v1/nasaimages/album?name=Apollo_11" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/nasaimages/metadata

The link to the full metadata file of one NASA item, with its camera and file details.

Scope: `social:read` · Units: 1 · Cached: 1440 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `nasaId` | string | yes | NASA id of the item, such as as11-40-5874. (e.g. as11-40-5874) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `nasaId` (string), `url` (string)

```bash
curl "https://api.hoshime.com/v1/nasaimages/metadata?nasaId=as11-40-5874" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/nasaimages/captions

The link to the captions file (WebVTT) of one NASA video.

Scope: `social:read` · Units: 1 · Cached: 1440 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `nasaId` | string | yes | NASA id of a video, such as ksc_080504_apollo. (e.g. ksc_080504_apollo) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `nasaId` (string), `url` (string)

```bash
curl "https://api.hoshime.com/v1/nasaimages/captions?nasaId=ksc_080504_apollo" -H "Authorization: Bearer $HOSHIME_TOKEN"
```
