# 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 for Locus Pro. Each call burns credits from your workspace balance.

## Access

**Base URL:** `https://api.paywithlocus.com/api/wrapped/credits/nasa-images/`
**Auth:** `Authorization: Bearer <LOCUS_CREDITS_SECRET_KEY>` (an `lcr_` secret key or a scoped `lcac_` agent credential)
**Required header:** `Idempotency-Key: <fresh UUID per call>`. A retry with the same key replays the stored result without a new charge.
**Response:** the provider response after any endpoint-specific normalization. `X-Locus-Credits-Charged` carries the charge and `X-Locus-Credits-Balance` the remaining balance. Insufficient credits return `402` before the provider is called.
**Pricing:** estimated costs below are USD. Locus debits the credit equivalent at your workspace rate.

Full call contract: https://docs.paywithlocus.com/api-reference/introduction

> Using a Pay With Locus wallet key (`claw_` prefix)? Wallet routes are documented separately: https://docs.paywithlocus.com/wrapped-apis/for-agents

## 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/credits/nasa-images/get-all-trending-image-urls \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -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/credits/nasa-images/get-asset \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -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/credits/nasa-images/get-captions \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -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/credits/nasa-images/get-hd-image-url \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -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/credits/nasa-images/get-item-details \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -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/credits/nasa-images/get-newest-uploads \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -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/credits/nasa-images/get-top3-trending-images \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -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/credits/nasa-images/get-trending-and-popular \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -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/credits/nasa-images/get-trending-images-only \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -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/credits/nasa-images/search \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -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>"}'
```

## Next steps

- [All wrapped API providers](https://paywithlocus.com/wapi/index.md): pick another provider.
- [Find and call tools](https://paywithlocus.com/agent/tools.md): price ceilings, async results, and errors.
- [Credits and billing](https://paywithlocus.com/agent/billing.md): what a call costs and how to add credits.
- [Agent docs index](https://paywithlocus.com/agent/index.md): every Locus agent page.