Skip to content

Catalog Songs API

Retrieve songs within a specific catalog. Use GET to list catalog songs with pagination. Use POST to batch add songs to a catalog by ISRC. Use DELETE to batch remove songs from a catalog by ISRC. This endpoint joins the catalog_songs table with catalogs, songs, song_artists, and accounts to provide comprehensive song information for a given catalog.

Endpoint

GET https://api.recoupable.com/api/catalogs/songs
POST https://api.recoupable.com/api/catalogs/songs
DELETE https://api.recoupable.com/api/catalogs/songs

GET Parameters

NameTypeRequiredDescription
catalog_idstringYesThe unique identifier of the catalog to query songs for
artistNamestringNoOptional. Filters songs to only include those with matching artist name
pagenumberNoPage number for pagination (default: 1)
limitnumberNoNumber of songs per page (default: 20, max: 100)

POST Parameters

NameTypeRequiredDescription
songsarray of objectsYesArray of songs for batch updates
songs[].catalog_idstringYesCatalog ID to which the song will be added
songs[].isrcstringYesSong ISRC to associate to the catalog
songs[].namestringNoOptional. Applied only if internal search cannot find valid info for ISRC
songs[].albumstringNoOptional. Applied only if internal search cannot find valid info for ISRC
songs[].notesstringNoOptional. Applied only if internal search cannot find valid info for ISRC
songs[].artistsstring[]NoOptional array of artist names. Applied only if internal search lacks info

DELETE Parameters

NameTypeRequiredDescription
songsarray of objectsYesArray of songs for batch deletes
songs[].catalog_idstringYesCatalog ID from which the song will be removed
songs[].isrcstringYesSong ISRC to remove from the catalog

Behavior (DELETE)

  • Deletes the relationship in catalog_songs for each {catalog_id, isrc} pair.
  • If either catalog_id or isrc is missing in any item, an error is returned.
  • Request accepts a bulk array under songs.
  • Response structure is identical to GET and POST (songs array with pagination when applicable).

Request Examples

cURL
curl -X GET "https://api.recoupable.com/api/catalogs/songs?catalog_id=YOUR_CATALOG_ID&artistName=Queen&page=1&limit=20" \
  -H "Content-Type: application/json"

Response Format

The API returns JSON responses with song data including associated artist information and pagination metadata:

{
  "status": "success",
  "songs": [
    {
      "catalog_id": "YOUR_CATALOG_ID",
      "isrc": "USRC17607839",
      "name": "Bohemian Rhapsody",
      "album": "A Night at the Opera",
      "lyrics": "Is this the real life? Is this just fantasy? Caught in a landslide, no escape from reality...",
      "updated_at": "2024-03-06T15:33:27Z",
      "artists": [
        {
          "id": "550e8400-e29b-41d4-a716-446655440000",
          "name": "Queen",
          "timestamp": 1640995200000
        }
      ]
    },
    {
      "catalog_id": "YOUR_CATALOG_ID",
      "isrc": "USRC17607840",
      "name": "We Will Rock You",
      "album": "News of the World",
      "lyrics": "Buddy, you're a boy, make a big noise, playing in the street, gonna be a big man someday...",
      "updated_at": "2024-03-05T18:22:15Z",
      "artists": [
        {
          "id": "550e8400-e29b-41d4-a716-446655440000",
          "name": "Queen",
          "timestamp": 1640995200000
        }
      ]
    }
  ],
  "pagination": {
    "total_count": 42,
    "page": 1,
    "limit": 20,
    "total_pages": 3
  }
}

Response Properties

Response Object

PropertyTypeDescription
statusstringStatus of the request ("success" or "error")
songsarrayArray of song objects with artist information
paginationobjectPagination metadata for the response
errorstringError message (only present if status is "error")

Song Object

PropertyTypeDescription
isrcstringInternational Standard Recording Code (primary key)
namestringName of the song
albumstringName of the album the song belongs to
lyricsstringFull lyrics of the song
updated_atstringISO timestamp of when the song data was last updated
artistsarrayArray of artist objects associated with this song
artists[].idstringUnique identifier for the artist account
artists[].namestringName of the artist (can be null)
artists[].timestampnumberTimestamp associated with the artist account (can be null)
catalog_idstringCatalog ID this song entry is associated with

Pagination Object

PropertyTypeDescription
total_countnumberTotal number of songs in the catalog
pagenumberCurrent page number
limitnumberNumber of songs per page
total_pagesnumberTotal number of pages available

Database Schema

This endpoint queries the following database tables:

Catalog Songs Table

  • Primary Key: id (uuid)
  • Foreign Keys:
    • catalog references catalogs.id
    • song references songs.isrc
  • Unique Constraint: Combination of catalog and song
  • Indexes: On catalog, song, and created_at fields for performance

Catalogs Table

  • Primary Key: id (uuid)
  • Fields: name, created_at, updated_at
  • Indexes: On name and created_at fields for performance

Songs Table

  • Primary Key: isrc (text)
  • Fields: name, album, lyrics, updated_at
  • Indexes: On name and album fields for performance

Song Artists Table

  • Primary Key: id (uuid)
  • Foreign Keys:
    • song references songs.isrc
    • artist references accounts.id