# Response format

> The data and meta envelope of every hoshime public data endpoint, field naming rules and the common shapes.

Every public data endpoint, and the MCP `call_endpoint` tool, answers in one format. It follows the `data`/`meta` envelope of JSON:API, RFC 9457 for errors, cursor pagination as in Google AIP-158 and Stripe, and the Google JSON style guide for names. The rules are checked on every endpoint's declaration and on live answers, so endpoints stay aligned as they grow.

## Success

`200 OK`, `Content-Type: application/json`:

```json
{
  "data": { "id": "dQw4w9WgXcQ", "title": "…", "author": { "id": "UC…", "name": "Rick Astley" } },
  "meta": {
    "requestId": "req_2Xb…",
    "platform": "youtube",
    "endpoint": "video",
    "cached": false,
    "fetchedAt": "2026-11-06T15:41:53Z",
    "units": 1
  }
}
```

- `data` is an object for an endpoint that returns one item, and an array of objects for a list endpoint. It is never null.
- `meta.cached` is true when the answer came from the cache, which bills 0 units.
- `meta.fetchedAt` is when the source was read.
- `meta.units` is what the call billed, also sent as the `Hoshime-Units` header.
- `meta.pagination` is present on list endpoints only. See [Pagination](/docs/pagination).

## Field names and values

- **Names** are lowerCamelCase with acronyms written as words: `avatarUrl`, `channelId`. Every key is always present: an unknown string is `""`, an unknown count `0`, an unknown optional object `null`.
- **Ids** are strings (`id`, `…Id`, `…Ids`), because ids like TikTok's do not fit a JSON number.
- **Counts** end with `Count` and are integers: `viewCount`, `followerCount`.
- **Times** end with `At` and are RFC 3339 strings, in UTC where the source allows: `createdAt`, `publishedAt`. Never epoch numbers.
- **Dates** without a time are `date` or `…Date`, as `YYYY-MM-DD`.
- **URLs** are `url` or `…Url`, absolute.
- **Money and prices** are decimal strings, so no digit is lost: `{"amount": "15000", "currency": "IDR"}`, ticker prices like `"67012.5"`. Ratios and ratings that are not money may be numbers.
- **Lists** are arrays, never null.
- **Parameters**: free-text search is `query`, paging is `cursor` and `limit`, language is `lang`, and id parameters accept the platform's URL too.

## Common shapes

Items of the same kind have the same shape on every platform. A platform adds its own fields beside the common ones.

| Shape | For | Fields |
|---|---|---|
| `Profile` | users, channels, pages, creators, artists | `id username name url avatarUrl bio verified followerCount followingCount postCount createdAt` |
| `Author` | who made a post, video, comment or article | `id username name url avatarUrl` |
| `Post` | statuses, tweets, threads, pins | `id url text author createdAt likeCount commentCount shareCount viewCount media[]` |
| `Video` | videos, clips, shorts | `id url title description author publishedAt durationSeconds viewCount likeCount commentCount thumbnails[]` |
| `Comment` | comments, replies | `id text author createdAt likeCount replyCount` |
| `Article` | news, blog posts, feed entries | `id url title summary imageUrl author source publishedAt` |
| `Product` | products, apps, listings with a price | `id url title description price{amount,currency} images[] rating reviewCount seller` |
| `Job` | job postings | `id url title company location remote employmentType salary postedAt` |
| `Ticker` | market summary of a pair or instrument | `symbol price open high low change changePercent volume updatedAt` |
| `Candle` | OHLCV bars | `openedAt open high low close volume` |
| `Image` | pictures | `url width height` |

## OpenAPI

[`GET /openapi.json`](https://api.hoshime.com/openapi.json) is an OpenAPI 3.1 document of every endpoint, with its query parameters and the JSON Schema of its response, generated from the type each endpoint returns. Feed it to a client generator, Postman or an AI agent.