Audioscape
API

Analysis

Base URL: https://a.audioscape.skylerx.ir/api
Request Endpoint: /audio/analysis/:trackKey


Generating a track key

You can generate a track on your end without ever having to hit the Search endpoint. If the track is in our database you'd get the results back, if not you have to hit the search endpoint.

Why? Because the search endpoint populates a temporary cache with the metadata for the key that way the aggregator can fetch the proper source.

export const generateTrackId = (artist: string, track: string) => {
  const normalized = `${artist.toLowerCase().trim()}:${track.toLowerCase().trim()}`;
  return crypto.createHash("sha256").update(normalized).digest("hex").slice(0, 16);
};

generateTrackId("Pink Floyd", "Money")
// bc24aaa5a97c70ed

Making a Request

Making a request is very simple. Just hit the API with the trackKey you generated or got from the search endpoint

curl --request GET \
  --url 'http://localhost:8888/api/audio/analysis/:trackId?artist=Pink%2BFloyd&track=Cymbaline' \
  --header 'Authorization: Bearer as_live_079e341779985b0d63f110611c24759c783defd4fd2af388d347545b2c73abc9'
import axios from "axios";

const options = {
  method: 'GET',
  url: 'https://a.audioscape.skylerx.ir/api/audio/analysis/:trackId',
  headers: {
    Authorization: 'Bearer YOU-API-KEY'
  }
};

axios.request(options).then(function (response) {
  console.log(response.data);
}).catch(function (error) {
  console.error(error);
});

Result

The expected results should look something like the code block below.

{
  "success": true,
  "data": {
    "artist": "Brian Adams",
    "trackKey": "43134f5237c98ee9",
    "trackName": "Forgive",
    "duration_ms": 273074,
    "tempo": 135.04905700683594,
    "key": 9,
    "keyString": "A major",
    "mode": 1,
    "timeSignature": 4,
    "energy": 0.8424511647783219,
    "liveness": 0.6680610444810655,
    "danceability": 0.47789607240702026,
    "instrumentalness": 0.47906912973849103,
    "speechiness": 0.5209308643970871,
    "valence": 0.4132167218805669,
    "arousal": 0.3710879431321071,
    "approachability": 0.5510184189367936,
    "engagement": 0.6465092692974738,
    "mood": {
      "happy": 0.867848354857415,
      "sad": 0.361626232159324,
      "relaxed": 0.8018692648038268,
      "aggressive": 0.8255197047255933
    },
    "meta": {
      "artist": "Brian Adams",
      "track": "Forgive"
    }
  }
}
FieldDescription
artistThe performing artist of the track.
trackKeyA unique identifier or hash for the track in the system/database.
trackNameThe title of the song.
duration_msThe total duration of the track in milliseconds (273074 ms ≈ 4 min 33 sec).
tempoEstimated tempo of the track in beats per minute (BPM).
keyNumerical representation of the musical key (9 corresponds to A).
keyStringHuman-readable musical key of the track (A major).
modeMusical mode where 1 = major and 0 = minor.
timeSignatureNumber of beats per measure (4 = common 4/4 time).
energyA measure of intensity and activity; higher values indicate a more energetic track.
livenessProbability that the recording contains a live audience or live performance characteristics.
danceabilityHow suitable the track is for dancing based on rhythm, tempo, and beat stability.
instrumentalnessLikelihood that the track contains little or no vocals.
speechinessPresence of spoken words or speech-like vocals in the track.
valenceMusical positivity; higher values sound happier or more cheerful.
arousalEmotional intensity or stimulation level evoked by the track.
approachabilityEstimate of how accessible or easy the track is for listeners to enjoy.
engagementPredicted ability of the track to retain listener attention or interest.

Mood Metrics

Mood FieldDescription
happyPredicted level of happiness conveyed by the song.
sadPredicted level of sadness conveyed by the song.
relaxedPredicted level of calmness or relaxation in the song.
aggressivePredicted level of aggression or intensity in the song.

Meta Information

Meta FieldDescription
meta.artistDuplicate metadata field containing the artist name.
meta.trackDuplicate metadata field containing the track title.

On this page