# Images — Wrapped API

> **You are on:** `https://api.paywithlocus.com/api` | [llms.txt](https://paywithlocus.com/llms.txt) | [docs](https://docs.paywithlocus.com)
>
> Locus runs on multiple environments -- make sure every URL you call matches your expected environment.
> | Environment | Landing | API | Docs |
> |---|---|---|---|
> | Production | paywithlocus.com | api.paywithlocus.com | docs.paywithlocus.com |
> | Beta | beta.paywithlocus.com | api.beta.paywithlocus.com | docs.paywithlocus.com |
> | Stage | stage.paywithlocus.com | api.stage.paywithlocus.com | docs.paywithlocus.com |
>
> If the API URL above doesn't match your expected environment, re-fetch this file from the correct domain.

> Images provides 10 callable API endpoints through the Parse marketplace.

**Category:** Government & Public Data | **Website:** [images.nasa.gov/](https://images.nasa.gov/) | **Docs:** [parse.bot/marketplace/38bcd5fe-af32-4c74-8857-dddbab1ce924/images-nasa-gov-api](https://parse.bot/marketplace/38bcd5fe-af32-4c74-8857-dddbab1ce924/images-nasa-gov-api)

Pay-per-use API proxy. Each call is automatically billed to your wallet in USDC.

## Access

**Base URL:** `https://api.paywithlocus.com/api/wrapped/parse-images-nasa-gov-api-38bcd5fe/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## Endpoints

### get_all_trending_image_urls

Retrieve thumbnail asset links for all trending images. Only includes items with media_type 'image'. Returns an array of asset objects with href URLs.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-images-nasa-gov-api-38bcd5fe/get_all_trending_image_urls \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### get_asset

Retrieve all available asset file URLs for a specific NASA ID. Returns links to various resolutions (orig, medium, small, thumb) and the metadata JSON file. Use this to discover all downloadable formats for an item.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `nasa_id` | string | Yes | The NASA ID of the media item (e.g. 'PIA12235'). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-images-nasa-gov-api-38bcd5fe/get_asset \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"nasa_id":"<string>"}'
```

### get_captions

Retrieve the captions/subtitles location URL for a video asset. Returns the URL to the .srt subtitle file. Only works for video items that have captions available; returns input_not_found for items without captions.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `nasa_id` | string | Yes | The NASA ID of the video (e.g. '172_ISS-Slosh'). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-images-nasa-gov-api-38bcd5fe/get_captions \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"nasa_id":"<string>"}'
```

### get_hd_image_url

Retrieve the HD quality (original resolution) image URL for a specific NASA ID. Looks for the ~orig asset, falling back to ~large then ~medium. Returns the nasa_id and the resolved hd_url.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `nasa_id` | string | Yes | The NASA ID of the image (e.g. 'PIA12235'). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-images-nasa-gov-api-38bcd5fe/get_hd_image_url \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"nasa_id":"<string>"}'
```

### get_item_details

Retrieve comprehensive details for a specific NASA ID including asset file URLs, EXIF/XMP metadata, search data (title, description, keywords, center, date_created, media_type), and preview links. Aggregates data from the asset, metadata, and search APIs into a single response.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `nasa_id` | string | Yes | The NASA ID of the media item (e.g. 'PIA12235'). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-images-nasa-gov-api-38bcd5fe/get_item_details \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"nasa_id":"<string>"}'
```

### get_newest_uploads

Retrieve the most recently uploaded media items from the NASA library ordered by upload date. Returns a flattened collection of items with metadata and preview links. No parameters needed.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-images-nasa-gov-api-38bcd5fe/get_newest_uploads \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### get_top3_trending_images

Retrieve the top 3 trending images with their HD URLs. For each image, fetches the original-resolution asset URL via the asset API. Returns nasa_id, title, thumbnail, and hd_url for each.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-images-nasa-gov-api-38bcd5fe/get_top3_trending_images \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### get_trending_and_popular

Retrieve currently trending and popular media items from the NASA library, ordered by popularity. Returns a flattened collection of items with metadata (nasa_id, title, center, media_type, date_created, description, keywords) and preview links. No parameters needed.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-images-nasa-gov-api-38bcd5fe/get_trending_and_popular \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### get_trending_images_only

Retrieve images only (excluding videos and audio) from the trending/popular section. Returns an array of image objects with nasa_id, title, and thumbnail URL for each.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-images-nasa-gov-api-38bcd5fe/get_trending_images_only \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### search

Search the NASA media library by keyword with optional filtering by media type, year range, keywords, and center. Returns paginated results with metadata and preview links. Pagination uses a page counter; each item carries data (title, nasa_id, media_type, date_created, description, keywords) and links (preview thumbnails). Server-side filtering covers query text, media type, year range, keywords, and center. Total hits are in metadata.total_hits.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `center` | string | No | NASA center that published the item (e.g. 'JPL', 'GSFC', 'JSC'). |
| `keywords` | string | No | Comma-separated keywords to filter results. |
| `media_type` | string | No | Comma-separated media types to include. Accepted values: image, video, audio. |
| `page` | integer | No | Page number for pagination (1-based). |
| `page_size` | string | No | Number of results per page (max 100). |
| `query` | string | No | Search query text (e.g. 'Mars', 'Apollo 11'). If omitted, returns all items matching other filters. |
| `year_end` | string | No | Filter results to items created on or before this year (4-digit year, e.g. '2025'). |
| `year_start` | string | No | Filter results to items created on or after this year (4-digit year, e.g. '2020'). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-images-nasa-gov-api-38bcd5fe/search \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"center":"<string>","keywords":"<string>","media_type":"<string>","page":"<integer>","page_size":"<string>","query":"<string>","year_end":"<string>","year_start":"<string>"}'
```
