Welcome, this guide will walk you through how to use yutify to retrieve music information from various streaming platforms as well as how to request your listening activity data by calling OAuth 2.0 protected endpoints.
Search for Music
Prerequisites
- Make sure your are familier working with CLI (Command Line Interface).
- We will be using cURL for making API requests, so make sure you have it installed on your system. But you can also use any HTTP client of your choice. You may download it from here and scroll down to find download for your operating system. Or you can use package manager came with your OS to install it.
We can use the Search endpoint
to find music information. You just need to provide the artist and song or album name.
So, let's search for "Shelter" by "Porter Robinson". We will make a GET request to the
/api/search
endpoint like this:
curl -X GET "https://yutify.cheapnightbot.me/api/search/Porter%20Robinson:Shelter"
Notice we are not using query parameters to search for music, instead we are using a path parameter to pass the search query. And a colon (:
) is used to separate the artist and song name in the URL. This is how the API is designed and the primary reason for this is to avoid issues with special characters in the query string. For example, if the song or artist name contains a slash (/
), it is misunderstood as a path separator when using query parameters.
If everything goes well, the API will return the a JSON response with the metadata about requested music.
✨ Congratulations, you just used the search endpoint to retrieve music information!
What's Next?
You can explore the Search Reference
for more details on how to use the search endpoint, including how to retrieve music information from a specific
streaming platform by using the platform
query parameter.
Retrieve Listening Activity
To retrieve a user's listening activity, we need to use the Activity endpoint.
- Create an Account: If you haven't already, you need to create an account on the yutify. Go to Sign Up page and create an account.
- Link a Service: After creating an account and/or logging in, Follow the Activity guide to link a service to your account.
- Now go to the
/api/me
route in your browser.
✨ Congratulations, if you are listening to music on a linked service, you will see metadata about your current listening activity in JSON format!
What's Next?
You can explore the Activity Reference.