Niland Logo Niland API

Tracks

Overview

Endpoints for retrieving, searching and managing tracks.

List Tracks

Use this endpoint to list tracks.

GET /tracks

Input

Name Type Description
ids Array Array of Track IDs that must be retrieved
references Array Array of Track references that must be retrieved
page Integer Page number (default 1)
page_size Integer Result number per page (default 20, max 1000)

Response

For a valid query

Status: 200 OK

For an invalid query

Status: 400 Bad Request

Search for Tracks

Use this endpoint to find tracks.

GET /tracks/search

Input

Name Type Description
title String Track title
artist String Artist name
album String Album name
combined String Query title artist and album fields
similar_artist String Commercial artist
similar_track String Commercial track title
similar_ids String List of comma separated similar Niland track IDs
similar_references String List of comma separated similar track references from your system
similar_url String A Youtube video or Soundcloud track URL
similar_url_analysis_start Integer Integer representing when the similar_url track analysis should start, expressed in seconds from the begining of the track
similar_url_analysis_duration Integer Integer representing how long the analysis of the similar_url track should last, expressed in seconds. This value will be ignored if you do not provide the similar_url_analysis_start parameter. If not provided, the value is set to 60 seconds by default
tag_ids String List of comma separated tag IDs
or_tag_ids String List of comma separated tag IDs
subsample String List of comma separated track IDs which defines in which tracks your are searching
page Integer Page number (default 1)
page_size Integer Result number per page (default 20, max 1000)

Important: You agree that any User Content Sound that you post does not and will not violate third-party rights of any kind. You hereby represent that you are the owner of all the copyright rights and don't infringe anyone else's right.

Notice: The results are ordered by relevance, the first one being the most relevant. There is also a search_match_score which gives the similarity index between the search made and every result.

Example

GET /tracks/search?key=...&similar_ids=1234&tag_ids=5678

Response

For a valid query

Status: 200 OK

For an invalid query

Status: 400 Bad Request

Get a Track

Use those endpoints to retrieve a specific track using a track ID or a reference.

GET /tracks/{track_id}
GET /tracks/reference/{reference}

Response

For a valid track id

Status: 200 OK

For an invalid track id or reference

Status: 404 Not Found

Create a Track

Use this endpoint to create a new track.

POST /tracks

Input

Name Type Description
title String [Required]
reference String [Required]
popularity Float
duration Float
isrc String
album String
artist String
audio File
year Integer
tags Array Array of Tag IDs

Important: If you include the audio file, the content-type must be multipart/form-data.

Example

Response

For a valid query

Status: 201 Created

For an invalid query

Status: 400 Bad Request

Upload a Temporary Track

Use this endpoint to upload and analyze a track on the fly. This track can then be used in the similarity search.

POST /tracks/temporaries

Input

Name Type Description
file File [Required] Audio file to upload and analyze

Important: You agree that any User Content Sound that you post does not and will not violate third-party rights of any kind. You hereby represent that you are the owner of all the copyright rights and don't infringe anyone else's right.

Notice: The content-type must be multipart/form-data.

Response

For a valid query

Status: 201 Created

For an invalid query

Status: 400 Bad Request

Edit a Track

Use those endpoints to edit track metadata using a Niland track ID or a reference.

PATCH /tracks/{track_id}
PATCH /tracks/reference/{reference}

Input

Name Type Description
title String
reference String
popularity Float
duration Float
isrc String
album String
artist String
year Integer
tags Array Array of Tag IDs

Example

PATCH /tracks/18706931?key=...

Response

For a valid query

Status: 200 OK

For an invalid track id or reference

Status: 404 Not Found

For an invalid query

Status: 400 Bad Request

Edit Track Audio File

Use those endpoints to add or change the audio file of the track using a Niland track ID or a reference.

POST /tracks/{track_id}/audio
POST /tracks/reference/{reference}/audio

Input

Name Type Description
file File

Important: If you include the audio file, the content-type must be multipart/form-data.

Response

For a valid query

Status: 200 OK

For an invalid track id or reference

Status: 404 Not Found

For an invalid query

Status: 400 Bad Request

Delete a Track

Use those endpoints to delete a track using a Niland track ID or a reference.

DELETE /tracks/{track_id}
DELETE /tracks/reference/{reference}

Response

For a valid track id or reference

Status: 204 No Content

For an invalid track id or reference

Status: 404 Not Found

Get Track Tags

Use those endpoints to retrieve track tags (automatic tagging included) using a Niland track ID or a reference.

GET /tracks/{track_id}/tags
GET /tracks/reference/{reference}/tags

Response

For a valid track id or reference

Status: 200 OK

For an invalid track id or reference

Status: 404 Not Found
  • Overview
  • List Tracks
  • Search for Tracks
  • Get a Track
  • Create a Track
  • Upload a Temporary Track
  • Edit a Track
  • Edit Track Audio File
  • Delete a track
  • Get track tags
  • Overview
  • API Reference
    • Suggestions
    • Tracks
    • Tags
    • Users
    • Radios
    • Playlists
  • Tutorials
    • Getting Started
    • Search For Tracks
    • Personalized Radio (soon)

© 2016 Niland