Skip to main content

An unofficial Python wrapper for Jiosaavn.

Project description

jiosaavnpy: An unofficial API for Jiosaavn

Introduction

jiosaavnpy is a Python 3 library to send requests to the Jiosaavn API. It emulates Jiosaavn web client requests without the need for any authentication.

Table of Contents

Features


Searching:

  • Search for Songs (can specify result limits)
  • Search for Albums (can specify result limits)
  • Search for Artists (can specify result limits)
  • Search for Albums (can specify result limits)
  • Search for Playlists (can specify result limits)

Entity Information:

  • Retrieve information about a specific Song (requires a track_id)
  • Retrieve information about a specific Album (requires an album_id)
  • Retrieve information about a specific Playlist (requires a playlist_id)
  • Retrieve information about a specific Artist (requires a artist_id)

Requirements

Installation

pip install jiosaavnpy

Usage

  • To search for Songs:
"""Example to search for songs."""

from jiosaavnpy import jiosaavn

def main():
    jio = JioSaavn() ## Intialize the main class.
    song_name = input("Search for a Song: ")
    song_results = jio.search_songs(song_name, limit=5) ## Limit can be set to any int, defaults to 5 if not provided.
    track_id = song_results[0]['track_id'] ## Useful for track info in example below.
    return print(song_results)

if __name__ == "__main__":
    main()

Parameters:

  • search_query (str): Name of the track.
    Example: "Never gonna give you up"
  • limit (int, optional): Number of tracks to return.
    Example: 1, 5, 10 (default is 5)

Example response (with limit=1):

[
  {
    "track_id": "e0kCEwoC",
    "title": "Never Gonna Give You Up",
    "primary_artists": "Rick Astley",
    "primary_artists_ids": "512102",
    "primary_artists_urls": "https://www.jiosaavn.com/artist/rick-astley-/tgLD-55V-uc_",
    "featured_artists": "",
    "featured_artists_ids": "",
    "featured_artists_urls": "",
    "track_url": "https://www.jiosaavn.com/song/never-gonna-give-you-up/FVgAcjFHWHA",
    "track_subtitle": "Rick Astley - Whenever You Need Somebody",
    "album_name": "Whenever You Need Somebody",
    "album_id": "26553699",
    "album_url": "https://www.jiosaavn.com/album/whenever-you-need-somebody/Tr67aKPn6fU_",
    "thumbnails": {
      "quality": {
        "50x50": "https://c.saavncdn.com/694/Whenever-You-Need-Somebody-English-1987-20210329114358-50x50.jpg",
        "150x150": "https://c.saavncdn.com/694/Whenever-You-Need-Somebody-English-1987-20210329114358-150x150.jpg",
        "500x500": "https://c.saavncdn.com/694/Whenever-You-Need-Somebody-English-1987-20210329114358-500x500.jpg"
      }
    },
    "release_year": "1987",
    "track_language": "english",
    "label": "BMG Rights Management (UK) Ltd",
    "play_count": "199567",
    "is_explicit": false,
    "duration": "213",
    "copyright_text": "℗ 1987 Sony Music Entertainment UK Limited",
    "stream_urls": {
        "low_quality": "https://aac.saavncdn.com/768/6d5c0e88195f6048dc7e78a06eafde0d_48.mp4",
        "medium_quality": "https://aac.saavncdn.com/768/6d5c0e88195f6048dc7e78a06eafde0d_96.mp4",
        "high_quality": "https://aac.saavncdn.com/768/6d5c0e88195f6048dc7e78a06eafde0d_160.mp4",
        "very_high_quality": "https://aac.saavncdn.com/768/6d5c0e88195f6048dc7e78a06eafde0d_320.mp4"
        }
  }
]
  • To get information on a specific Song:
"""Example to retrieve song info using the track_id.
A song's track_id can be found using the example above and collecting the track_id from the JSON result."""

from jiosaavnpy import jiosaavn

def main():
    jio = JioSaavn() ## Intialize the main class.
    track_id = input("Enter the track id: ") ## The track_id from the previous example
    song_info = jio.song_info(track_id) 
    return print(song_info)

if __name__ == "__main__":
    main()

Parameters:

  • track_id (str): Can be found using search_songs() as track_id.
    Example: "e0kCEwoC"

The JSON response is the same as search_songs.

Check out examples for more usage examples.

API

API methods

search_songs

Parameters:

  • search_query (str): Name of the track.
    Example: "Never gonna give you up"
  • limit (int, optional): Number of tracks to return.
    Example: 1, 5, 10 (default is 5)

song_info

Parameters:

  • track_id (str): Can be found using search_songs() as track_id.
    Example: "e0kCEwoC"

search_albums

Parameters:

  • search_query (str): Name of the album.
  • limit (int, optional): Number of albums to return. Example: 1, 5, 10 (default is 5)

album_info

Parameters:

  • album_id (str): Can be found using search_albums() as album_id.
    Example: "28439174"

search_playlists

Parameters:

  • search_query (str): Name of the playlist.
  • limit (int, optional): Number of playlists to return. Example: 1, 5, 10 (default is 5)

playlist_info

Parameters:

  • playlist_id (str): Can be found using search_playlists() as playlist_id.
    Example: "848372056"

Caveats

  • This is not an official or supported API.
  • Non-English tracks are not returned by Jiosaavn if made from a non-Indian IP address.
  • Any sort of rate limits are not publicly known (?).

Contributing

Pull requests are welcome. There are still some endpoints that have not yet implemented.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jiosaavnpy-0.1.0.tar.gz (32.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jiosaavnpy-0.1.0-py3-none-any.whl (34.3 kB view details)

Uploaded Python 3

File details

Details for the file jiosaavnpy-0.1.0.tar.gz.

File metadata

  • Download URL: jiosaavnpy-0.1.0.tar.gz
  • Upload date:
  • Size: 32.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for jiosaavnpy-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f65e912f40dd97cbca15c28096cef972af8b0c681583683998beb08cee33b5e6
MD5 5faca5f6505b30ad0c4b4890ce27a131
BLAKE2b-256 47830aaf9a07cab3e66d7ac1d56ba0d9cb5cbed8030b22af39404b23d8630d66

See more details on using hashes here.

File details

Details for the file jiosaavnpy-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: jiosaavnpy-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 34.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for jiosaavnpy-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 91fbc41243d7cd71be761fa607b4579d958e3ad8bd8c5f9852470a6dc947384f
MD5 3c85d7e42fe26027fc4fe2def893504a
BLAKE2b-256 1af457f57bfced660cd344fccc0a7bab0e4aaf3837fe609b6d17d742d0af5711

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page