cyberboysumanjay / JioSaavnAPI

An unofficial API for JioSaavn written in Python 3
https://saavnapi-nine.vercel.app
MIT License
354 stars 176 forks source link

How to get user-specific information using the API? #27

Open varamsky opened 3 years ago

varamsky commented 3 years ago

Hi @cyberboysumanjay,

I really liked your project. It's a shame that such a popular music streaming service doesn't have an official API.

Anyway, I think that it would be great if you could somehow add the functionality of getting user-specific information from your API.

For example, it would be great if I could get my playlists information from your API. And it would be awesome if you could somehow figure out ways to post changes to saavn through the API. For example, one could use your API to add new songs to a particular playlist. It would be very useful in a large number of projects.

Think about this suggestion :)

cyberboysumanjay commented 3 years ago

Hey! Thanks for your useful suggestions.

First I would like to tell you that the API already supports user created playlist. Just use the results or playlist endpoint and pass your playlist link, it'll fetch all your songs

Regarding the ability to post your changes to your playlist that is something which will require authentication and will make the API complex as per the current structure. I'll definitely try to add support for this in future updates.

varamsky commented 3 years ago

First I would like to tell you that the API already supports user created playlist. Just use the results or playlist endpoint and pass your playlist link, it'll fetch all your songs

Actually, I wished to provide my JioSaavn USER ID and it should fetch all the playlists that I have, and I should be able to add or delete songs to and from my playlists.

This is what I meant, as this can be easily used in a lot of other projects.

I understand that it will require authentication but it will really enhance this project.

Chetan-Goyal commented 3 years ago

@varamsky It is doable but JioSaavn will change their endpoints as soon as they discovers about such unofficial requests and endpoints of this API will break again and again. This will affect the performance of the projects built on this API. In my opinion, It will be good but will also make it difficult for keeping project up and running for long term.

AvTe commented 3 years ago

Hi @cyberboysumanjay,

I really liked your project. It's a shame that such a popular music streaming service doesn't have an official API.

Anyway, I think that it would be great if you could somehow add the functionality of getting user-specific information from your API.

For example, it would be great if I could get my playlists information from your API. And it would be awesome if you could somehow figure out ways to post changes to saavn through the API. For example, one could use your API to add new songs to a particular playlist. It would be very useful in a large number of projects.

Think about this suggestion :)

TheGET /api/v2/users/{id} endpoint allows you to retrieve a specific user using their Auth0 user ID.

This endpoint is immediately consistent, and as such, we recommend that you use this endpoint for:

User searches run during the authentication process.

User searches run as part of the account linking process.

The user ID should be URL encoded since it may contain characters that do not work well in a URL.

Request example

Required Scopes: read:users ### cURL

curl --request GET \
  --url 'https://YOUR_DOMAIN/api/v2/users/USER_ID' \
  --header 'authorization: Bearer YOUR_MGMT_API_ACCESS_TOKEN'
{
  "email": "john.doe@gmail.com",
  "email_verified": false,
  "username": "johndoe",
  "phone_number": "+199999999999999",
  "phone_verified": false,
  "user_id": "usr_5457edea1b8f33391a000004",
  "created_at": "",
  "updated_at": "",
  "identities": [
    {
      "connection": "Initial-Connection",
      "user_id": "5457edea1b8f22891a000004",
      "provider": "auth0",
      "isSocial": false
    }
  ],
  "app_metadata": {},
  "user_metadata": {},
  "picture": "",
  "name": "",
  "nickname": "",
  "multifactor": [
    ""
  ],
  "last_ip": "",
  "last_login": "",
  "logins_count": 0,
  "blocked": false,
  "given_name": "",
  "family_name": ""
}