Media API Documentation

Set Up Nexpher Images API In Your System

This guide helps your team integrate search and download endpoints so users can retrieve licensed images without leaving your product.

Quick Start Checklist

1

Request API access

The Media API is included with a Nexpher Images subscription. Email [email protected] to request keys for staging and production.

2

Store secrets securely

Save your API key in server-side environment variables. Never expose private keys in frontend code.

3

Search and display images

Call the search endpoint from your backend, then render image previews and metadata in your application.

4

Download via tokenized URL

Request a download token and fetch the file with a secure URL so users can download inside your own system.

Environment Setup

Keep credentials server-side and route API calls through your backend service.

# .env.local (server only)
NEXPHER_API_BASE_URL=https://media-api.nexpherimages.com/v1
NEXPHER_API_KEY=your_private_api_key

# Never expose private key in browser bundle

# Live API docs: https://media-api.nexpherimages.com/docs

Sample Integration Flow (Node.js)

Example server-side flow: search image, request token, then download through your application.

const API_BASE = process.env.NEXPHER_API_BASE_URL; // https://media-api.nexpherimages.com/v1
const API_KEY = process.env.NEXPHER_API_KEY;

const headers = { Authorization: 'Bearer ${API_KEY}' };

// 1) Search images
const searchRes = await fetch(API_BASE + '/images/search?q=election&limit=20', { headers });
const searchData = await searchRes.json();
const imageId = searchData.items[0]?.id;

// 2) Request secure download token
const tokenRes = await fetch(API_BASE + '/images/' + imageId + '/download-token?size=article', { headers });
const tokenData = await tokenRes.json();

// 3) Download image with tokenized URL (302 redirect to S3)
const fileRes = await fetch(API_BASE + '/images/' + imageId + '/download?token=' + tokenData.token, { headers });

// Or use @nexpher/media-api-client npm package

Core Endpoints

MethodPathPurpose
GET/v1/images/searchSearch image library by keyword and filters.
GET/v1/images/:imageIdGet full image metadata, caption, credits, and license info.
GET/v1/images/:imageId/download-tokenCreate short-lived download token for authorized file access.
GET/v1/images/:imageId/download?token=...Download image file directly in your product workflow.
GET/v1/feed/latestCursor-paginated latest published images.
GET/v1/feeds/mrss?token=...Authenticated mRSS feed for newsroom monitors.
GET/v1/account/usageOrganization API and download quota usage.
GET/v1/webhooksList webhook subscriptions.
POST/v1/webhooksRegister webhook for image.published events.
POST/mcpModel Context Protocol endpoint for agent and IDE clients.

MCP server

Subscribers can connect Claude, Cursor, or other MCP clients to the same library. Use your Bearer API key — there is no separate MCP credential.

{
  "mcpServers": {
    "nexpher-media": {
      "url": "https://media-api.nexpherimages.com/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_API_KEY"
      }
    }
  }
}

# Tools: search_images, get_image, create_download_token,
#        get_latest_feed, get_account_usage

Troubleshooting

401 Unauthorized

Check Authorization header format and confirm your API key is active.

403 Forbidden

The image or license tier may be restricted for your account. Contact support for permission updates.

429 Too Many Requests

Apply retry with backoff and review your subscription quota for sustained traffic.

404 Not Found

Verify imageId values and ensure the asset still exists in your account scope.

Need Help With Integration?

Share your platform stack and use case. Our team can guide implementation and rollout planning.

Email [email protected]