Quick start
The production base URL is:/v1. Every catalogue request uses GET and is available without an API key.
GET /v1 to retrieve the current route index, or GET /health to check whether the service can reach its database.
The API is for reading public data. Use Diskograf’s web app to sign in, contribute catalogue data, or manage an account.
Access, visibility, and limits
Access
- No authentication or API key is required.
- The API accepts
GETand CORS preflightOPTIONSrequests. - The API is read-only. It does not expose write, account, or administrative operations.
Public data rules
The API applies the same public visibility rules as the web app:- Song endpoints return published, non-deleted songs only.
- User endpoints return public, claimed, non-banned member profiles.
- Loved-song endpoints return only published, non-deleted songs.
- A public user profile may link to a claimed artist profile. Private account fields are never returned.
- Labels are included when they are associated with at least one published song.
Rate limits
Production traffic is limited to 60 requests per 60 seconds per IP address. When the limit is reached, the API returns429 Too Many Requests with a Retry-After: 60 header.
Caching
Catalogue responses include these cache directives:Response format
Most endpoints use one of these envelopes:
For list responses,
meta.total is the number of matching or returned records, depending on the endpoint. Full lists such as genres and roles use the list envelope even though they do not accept pagination parameters.
The health endpoint is the exception. It returns a direct status object rather than a data envelope.
Pagination and filtering
limit and offset
limitis the number of records to return. The default is20.offsetis zero-based. The default is0.- Invalid, negative, or out-of-range values return
400 Bad Request. - The effective maximum depends on the collection:
Genres and roles return their complete public lists and do not use
limit or offset query parameters.
Repeated filters
Array filters accept either comma-separated values or repeated query parameters. These requests are equivalent:genre and role filters use slugs. Empty values are ignored.
Search and ordering
qis trimmed and accepts up to 200 characters.orderacceptsascordescwhere the endpoint supports ordering.- Invalid
sort,order, filter, or identifier values return400 Bad Request. - When stable ordering matters, provide both
sortandorderinstead of relying on a resource’s default.
Endpoint reference
Service endpoints
Songs
For
/v1/songs, q searches song titles and credited artists. artist_id and label_id accept positive integer IDs. Song list responses contain song cards; see Song data.
Artists
Artist-specific routes return
404 when the artist is unknown or not publicly available. For the directory endpoint:
qsearches artist names and aliases.letterfilters by the first character. Use#for names that begin with a non-letter.statusacceptsuserornot-user.bandacceptstrueorfalseto filter groups or individuals.
Genres
An unknown genre slug returns
404 rather than an empty collection.
Labels
An unknown label returns
404. The label detail endpoint intentionally returns only public label metadata; internal import metadata is not part of the API.
Albums and curated lists
An unknown album, song, or curated list returns
404. Album and curated-list responses exclude unpublished and deleted songs.
Public users and contributors
For
/v1/users:
qsearches names and usernames.filteracceptseveryone,fans,artists, orcontributors.sortacceptsactive,newest,contributions, orname.
404 for an unavailable username. The songs endpoint also returns 404 when the member does not have a claimed artist profile.
Search and reference data
Search is not paginated. It currently returns up to 50 songs, 30 artists, and 20 labels in the response.
Resource data
Song data
Song card
Song cards are used by song lists, search results, similar songs, artist and label discographies, and contribution history.Song detail
Song detail addspublished_at, views, claps, and the complete credit and classification data:
order, an artist object, and a role object. A role can be null for an unclassified credit. Each artist includes a resolved avatar_url. Each role includes id, title, slug, tag, and order. Each genre contains id, slug, and title; each label contains id and name.
Song detail also includes notes, lyrics, and love_count. The media object contains named YouTube, Spotify, Apple Music, date-type, and duration fields. The youtube object contains duration, views, views-per-day, and last-fetched fields. Raw song and YouTube JSON are not returned.
Song contributors
GET /v1/songs/{songId}/contributors returns:
{ "username", "name", "avatar_url" }. The contributions array contains the action name, timestamp, and public user for each event. This is a timeline, not a full historical snapshot of every version of a song.
Song provider stats
GET /v1/songs/{songId}/provider-stats returns the last stored provider snapshots:
views_per_dayis the lifetime average: total views divided by the days since the video was published.views_per_day_currentis the rate between the last two fetches. It isnulluntil the video has two fetches, and0when views did not grow.video_published_atis the publish time that YouTube reports. It can differ from the song’sreleased_at.- Any field can be
nullwhen the provider has no value. Comparelast_fetchedto decide how fresh a snapshot is.
Artist data
Artist cards contain:null. Artist detail adds:
aliases,biodata,country,place, birth and death fields, job, and status.alias_artists, each withid,name, andprefix_title.linkswithwebsite,instagram,twitter,tiktok,youtube,facebook,spotify, andapplemusickeys.roles, each withid,slug,title, and a creditcount.genres, each withid,slug,title, and a songcount.associated_acts, each withid,name,slug,username, andavatar_url.
Genre and label data
Genre list items containid, slug, title, color, and song_count. A genre detail item also includes description.
Label list items contain id, name, slug, and song_count. Label detail contains id and name.
Album and curated-list data
An album summary containsid, title, album_type, artwork_url, song_count, and latest_released_at.
Album detail contains id, title, album_type, artwork_url, released_at, an artists array, and a songs array. album_type is album, ep, or single. Its released_at uses the manual album date when set, otherwise the latest release date among visible tracks. Each album artist contains id, name, prefix_title, and is_group.
Each album track is a song card plus position, date_type, duration_ms, and youtube_duration_seconds. duration_ms is the manually-entered track length; youtube_duration_seconds is the auto-fetched YouTube length, used as a fallback when duration_ms is null.
A song’s album membership (/v1/songs/{songId}/albums) contains id, title, artwork_url, and the track position.
A curated list contains id, title, description, and a songs array of song cards.
User data
A public user profile contains:profile contains named biography, location, date, job, status, alias, and social-link fields.
artist is either null or an object containing the claimed artist’s id, name, slug, prefix_title, aliases, is_group, total_songs, total_credits, first_release_year, last_release_year, avatar_url, and associated_acts.
User directory items also include joined_at and contribution_count. The overview endpoint returns:
active represents the recent 30-day window. active and all_time contain the top public contributors and are capped at 10 entries each.
Contribution history items contain id, action, action_at, and song. song is either a song card or null when the related song is no longer publicly available.
GET /v1/users/{username}/loves returns published, non-deleted song cards in love order. Its list metadata reports the total visible songs.
Search data
GET /v1/search returns one item envelope with three arrays:
songs array contains song cards. Artist search results contain the public artist card fields needed for discovery. Label search results contain id, name, and slug.
Roles and stats
Role items containid, slug, title, and order.
The stats response contains:
Errors
Errors use the same JSON shape:
Unknown routes return
404 and include a message pointing you to GET /v1. The health endpoint uses 503 for a database connectivity failure and returns its direct health status shape.
Versioning
Use the/v1 prefix in production integrations. Backward-compatible fields and routes may be added. Treat existing fields and route behavior as stable within the version, and handle unknown response fields without failing.
The API is intentionally read-only. For contributions, account features, and authenticated workflows, direct users to diskograf.com.