Skip to main content
Diskograf provides a read-only REST API for the public catalogue. You can use it to search songs and artists, browse genres and labels, and build contributor-facing experiences around published Malaysian music data.

Quick start

The production base URL is:
All catalogue routes are under /v1. Every catalogue request uses GET and is available without an API key.
The API also supports browser requests through CORS. Use 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 GET and CORS preflight OPTIONS requests.
  • 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.
  • 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 returns 429 Too Many Requests with a Retry-After: 60 header.

Caching

Catalogue responses include these cache directives:
Treat responses as changeable. Cache them according to the response header rather than assuming that a record is immutable.

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

  • limit is the number of records to return. The default is 20.
  • offset is zero-based. The default is 0.
  • 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:
The genre and role filters use slugs. Empty values are ignored.

Search and ordering

  • q is trimmed and accepts up to 200 characters.
  • order accepts asc or desc where the endpoint supports ordering.
  • Invalid sort, order, filter, or identifier values return 400 Bad Request.
  • When stable ordering matters, provide both sort and order instead of relying on a resource’s default.
The supported ordering fields are:

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:
  • q searches artist names and aliases.
  • letter filters by the first character. Use # for names that begin with a non-letter.
  • status accepts user or not-user.
  • band accepts true or false to 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.

Public users and contributors

For /v1/users:
  • q searches names and usernames.
  • filter accepts everyone, fans, artists, or contributors.
  • sort accepts active, newest, contributions, or name.
The contributions endpoint returns 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 adds published_at, views, claps, and the complete credit and classification data:
Each credit contains order, an artist object, and a role object. A role can be null for an unclassified credit. Each genre contains id, slug, and title; each label contains id and name.

Song contributors

GET /v1/songs/{songId}/contributors returns:
The public user shape inside this response is { "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.

Artist data

Artist cards contain:
Nullable values are returned as null. Artist detail adds:
  • aliases, biodata, country, and place.
  • links with website, instagram, twitter, tiktok, youtube, and facebook keys.
  • roles, each with id, slug, title, and a credit count.
  • genres, each with id, slug, title, and a song count.
  • associated_acts, each with id, name, and slug.

Genre and label data

Genre list items contain id, 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.

User data

A public user profile contains:
artist is either null or an object containing the claimed artist’s id, name, slug, is_group, total_songs, total_credits, first_release_year, last_release_year, and avatar_url. 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.

Search data

GET /v1/search returns one item envelope with three arrays:
The 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 contain id, slug, title, and order. The stats response contains:

Errors

Errors use the same JSON shape:
Common status codes are: 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.