JSON by default
Successful responses and errors use JSON. Send Content-Type: application/json when a request has a body.
REST API · Version 1
Access account data, mood insights, privacy-aware social profiles, API usage, and playlists through a consistent JSON API.
https://api.moodtrue.com/v1
Quickstart
Create a developer token in MoodTrue account settings and send it in the standard Bearer authorization header. Tokens must never be included in query strings, client-side source code, or public repositories.
curl https://api.moodtrue.com/v1/user \
-H "Authorization: Bearer YOUR_DEV_TOKEN" \
-H "Accept: application/json"
Successful responses and errors use JSON. Send Content-Type: application/json when a request has a body.
Use HTTPS for every request. Treat developer tokens like passwords and rotate them immediately if exposed.
Platform policy
Limits are enforced across the authenticated account. Responses expose remaining burst, minute, daily, and monthly capacity through X-RateLimit-* headers. A rejected request returns 429 Too Many Requests with Retry-After.
| Plan | Burst | Per minute | Per day | Per month |
|---|---|---|---|---|
| Free | 10 / 10 sec | 30 | 100 | 2,000 |
| Premium | 30 / 10 sec | 180 | 3,000 | 75,000 |
| Pro | 100 / 10 sec | 600 | 20,000 | 500,000 |
Response conventions
{
"error": "Valid developer token required",
"code": "AUTH_REQUIRED"
}
400 The request or a parameter is invalid.
401 A valid developer token is required.
403 Privacy settings or permissions deny access.
404 The requested resource does not exist.
429 A rate limit has been reached.
500 The service could not complete the request.
API reference
Open an endpoint and try it from the panel. Every example is ready to copy and uses the production API.
Account and profile details for the token owner.
GET/v1/user
Returns the authenticated user's basic account information.
curl https://api.moodtrue.com/v1/user \
-H "Authorization: Bearer YOUR_DEV_TOKEN" \
-H "Accept: application/json"Responses 200 user data · 401 authentication required
GET/v1/user/profile
Returns profile details, connected services, subscription state, and developer token information.
curl https://api.moodtrue.com/v1/user/profile \
-H "Authorization: Bearer YOUR_DEV_TOKEN" \
-H "Accept: application/json"Responses 200 profile data · 401 authentication required
Current mood, history, and aggregate statistics.
GET/v1/user/mood
Returns the token owner's current mood, emoji, and available translations.
curl https://api.moodtrue.com/v1/user/mood \
-H "Authorization: Bearer YOUR_DEV_TOKEN"GET/v1/user/mood/history
Returns paginated saved mood history with optional date filtering, plus an activity object containing the profile mood calendar and listening activity, including browser extension events. Pagination and record counts apply to saved mood records; activity covers whole calendar days independently of pagination.
Without a start date, activity covers 42 days ending on end_date or today. Longer requested ranges are capped at 366 days and report activity.range_truncated: true. See activity fields and measurement rules.
curl "https://api.moodtrue.com/v1/user/mood/history?limit=50&offset=0" \
-H "Authorization: Bearer YOUR_DEV_TOKEN"GET/v1/user/mood/statistics
Returns mood distribution and trends for a selected period, plus an activity object with the profile mood calendar and listening activity for that period. statistics_basis: "saved_mood_records" identifies the basis of the original statistics; listening counts are in activity.summary.
curl "https://api.moodtrue.com/v1/user/mood/statistics?period=monthly&limit=20" \
-H "Authorization: Bearer YOUR_DEV_TOKEN"The same listening data and daily mood calculation shown on the authenticated user's profile.
GET/v1/user/listening/activity
Returns browser extension listening events, connected music services, daily moods, platform and client breakdowns, and up to 20 top tracks. Only the token owner's activity is accessible.
| Query parameter | Type | Behavior |
|---|---|---|
days | integer | 1–366 inclusive; defaults to 42. |
end_date | date | Optional YYYY-MM-DD, inclusive. Defaults to today in the response's timezone. |
curl "https://api.moodtrue.com/v1/user/listening/activity?days=7&end_date=2026-10-22" \
-H "Authorization: Bearer YOUR_DEV_TOKEN"The response contains start_date, end_date, timezone, summary, calendar, platforms, clients, top_tracks, and measurement. Unknown total durations are null; known_listened_ms contains the known subtotal. Snapshot observations and track-duration estimates are identified separately. See field definitions and measurement rules or the OpenAPI schemas.
Responses 200 listening activity · 400 invalid date range · 401 authentication required
Public data with privacy and block rules enforced on every response.
GET/v1/users/{username}
Returns profile, public counters, relationship state, and applicable privacy flags.
curl https://api.moodtrue.com/v1/users/{username} \
-H "Authorization: Bearer YOUR_DEV_TOKEN"GET/v1/users/{username}/posts
Returns visible posts using cursor pagination.
curl "https://api.moodtrue.com/v1/users/{username}/posts?limit=20" \
-H "Authorization: Bearer YOUR_DEV_TOKEN"GET/v1/users/{username}/mood
Returns the current mood only when the requester is permitted to view activity.
curl https://api.moodtrue.com/v1/users/{username}/mood \
-H "Authorization: Bearer YOUR_DEV_TOKEN"GET/v1/users/{username}/followers
Returns a privacy-filtered, cursor-paginated list of followers.
curl "https://api.moodtrue.com/v1/users/{username}/followers?limit=20" \
-H "Authorization: Bearer YOUR_DEV_TOKEN"GET/v1/users/{username}/following
Returns a privacy-filtered, cursor-paginated list of followed accounts.
curl "https://api.moodtrue.com/v1/users/{username}/following?limit=20" \
-H "Authorization: Bearer YOUR_DEV_TOKEN"POST/v1/users/{username}/follow
Creates a follow relationship owned by the authenticated token user. Private accounts continue to require approval.
curl -X POST https://api.moodtrue.com/v1/users/{username}/follow \
-H "Authorization: Bearer YOUR_DEV_TOKEN"DELETE/v1/users/{username}/follow
Removes only the authenticated token user's own follow relationship. The console asks for confirmation before sending.
curl -X DELETE https://api.moodtrue.com/v1/users/{username}/follow \
-H "Authorization: Bearer YOUR_DEV_TOKEN"Account and token consumption.
GET/v1/usage
Returns token usage and account-wide rate-limit windows.
curl https://api.moodtrue.com/v1/usage \
-H "Authorization: Bearer YOUR_DEV_TOKEN"Responses 200 usage snapshot · 429 limit reached
Read and manage playlists owned by the token user.
GET/v1/playlists
Returns every playlist available to the authenticated user.
curl https://api.moodtrue.com/v1/playlists \
-H "Authorization: Bearer YOUR_DEV_TOKEN"GET/v1/playlists/{id}
Returns metadata and tracks for a playlist owned by the authenticated user.
curl https://api.moodtrue.com/v1/playlists/{id} \
-H "Authorization: Bearer YOUR_DEV_TOKEN"DELETE/v1/playlists/{id}
Permanently deletes a playlist owned by the authenticated user. The console asks for confirmation before sending.
curl -X DELETE https://api.moodtrue.com/v1/playlists/{id} \
-H "Authorization: Bearer YOUR_DEV_TOKEN"