Cyanite.ai Public API Docs

Cyanite.ai provides a public API that can be used to extract insights from music. The API returns data on various aspects of the input music, such as mood, genre, and energy. The API output can be customized based on user requirements. The following is an overview of the public API provided by Cyanite.ai.

Authentication

Before using the API, you need to create an account on https://api.cyanite.ai/ and obtain an API key. This key will be required to authenticate with the API and access its functionalities.

Sample Request

The following is an example request to get information on a track using the Cyanite Public API.

const axios = require('axios');

const endpoint = 'https://api.cyanite.ai/v1/track';
const apiKey = 'YOUR_API_KEY';
const url = 'https://www.youtube.com/watch?v=kJQP7kiw5Fk';

const params = {
    apikey: apiKey,
    url: escape(url),
};

axios
    .get(endpoint, { params })
    .then((response) => {
        console.log(response.data);
    })
    .catch((error) => {
        console.log(`Error: ${error}`);
    });

In this example, we are using the Axios library to make an HTTP GET request to the https://api.cyanite.ai/v1/track endpoint. We are passing our API key and the URL of the track we want to analyze as query parameters.

The escape() method is used to encode the URL so it can be used as a query parameter.

Response

The response from the API contains various data points for the requested track. Some of the key data points include:

  • Artist Name
  • Track Name
  • Release Date
  • Lyrics
  • Acousticness
  • Danceability
  • Energy
  • Mood
  • Popularity
  • Tempo

The response is in JSON format and can be easily parsed to extract the required data points.

Conclusion

Cyanite.ai public API is a powerful tool for extracting insights from music. Developers can use the API to build custom applications that require music data analysis. The sample code provided above demonstrates how to use the API to get information on a track, and the response it returns. For more information on the API, refer to the official documentation at https://api-docs.cyanite.ai/.

Related APIs