API Reference

/

GET /v1/splats/trending

GET /api/v1/splats/trending

Public, embeddable Integration Splats ranked by engagement over a recent time window — built for "Trending" rails and discovery surfaces.

GET

https://moshpit.studio/api/v1/splats/trending

Auth

Both headers are required:

Authorization: Bearer msk_YOUR_SECRET_KEY
X-Moshpit-Public-Key: mpk_YOUR_PUBLIC_KEY

REST API access

REST API access is included on Free, Pro, and Enterprise. Storage, Scene counts, and integration limits still apply.

How ranking works

Each splat's score over the window is:

–

Plain

score = uniqueViews × 3 + impressions
  • uniqueViews — distinct viewers (deduplicated per viewer per splat).
  • impressions — every recorded view event.
  • Ties break on all-time like count, then all-time views. Likes are not time-windowed (they carry no timestamps), so they never drive the ranking on their own.

Only public splats with allowEmbed: true are eligible. When fewer than limit splats saw activity in the window, the list is backfilled with the integration's all-time most-viewed splats so the rail is never sparse — check trending.source on each item to tell the two apart.

Data horizon

Usage rollups only accrue from mid-June 2026 onward and are retained for 400 days. Windows reaching further back simply see less data.

Query parameters

FieldTypeDescription
window
number
default 7

Ranking window in days. Minimum 1, maximum 90.

limit
number
default 12

Number of splats to return. Minimum 1, maximum 100.

Example

SH

Bash

curl "https://moshpit.studio/api/v1/splats/trending?window=7&limit=12" \
  -H "Authorization: Bearer msk_YOUR_SECRET_KEY" \
  -H "X-Moshpit-Public-Key: mpk_YOUR_PUBLIC_KEY"
{}

JSON

{
  "status": "success",
  "splats": [
    {
      "id": "65f1a2b3c4d5e6f7a8b9c0d1",
      "title": "Living room scan",
      "imageUrl": "https://...",
      "splatUrl": "https://...",
      "visibility": "public",
      "allowEmbed": true,
      "isOwner": false,
      "viewCount": 42,
      "likeCount": 3,
      "featured": false,
      "featuredAt": null,
      "createdAt": "2026-04-12T18:30:00.000Z",
      "updatedAt": "2026-04-15T09:14:21.000Z",
      "trending": {
        "source": "window",
        "score": 15,
        "impressions": 9,
        "uniqueViews": 2
      }
    }
  ],
  "trending": {
    "windowDays": 7,
    "since": "2026-07-09T00:00:00.000Z",
    "count": 12,
    "windowCount": 1
  }
}

Splat items share the list-splats shape, plus a per-item trending object.

Response fields

FieldTypeDescription
splats[].trending.source
"window" | "alltime"

`window` = ranked by engagement inside the window; `alltime` = backfill by lifetime views.

splats[].trending.score
number

Windowed score (`uniqueViews × 3 + impressions`). `0` for backfill items.

splats[].trending.impressions
number

View events recorded inside the window.

splats[].trending.uniqueViews
number

Distinct viewers inside the window.

trending.windowDays
number

The window actually used.

trending.since
string

ISO start of the window (UTC midnight).

trending.windowCount
number

How many returned items were ranked by windowed activity (the rest are backfill).

Error responses

StatusCause
400Invalid window or limit value
401Missing or invalid Bearer / public-key combination
403Plan does not include REST API access

What's next