This repository has been archived by the owner on Jul 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 100
Fetch Lyrics
Tuhin Kanti Pal edited this page Dec 13, 2020
·
1 revision
http://[Your-Url]/lyrics?id={Song-ID}
//example
https://jiosaavn-api.vercel.app/lyrics?id=iX_FM-ow
- Only available if has_lyrics object is true.
- id is previously fetched from song search (id Object) or album search (song_pids Object).
{
"lyrics": "jab se hua hai ye achchha sa lagtaa hai<br>dil ho gaya phir se baccha sa lagtaa hai<br>Ishq ragon mein jo behta rahe<br>jaakay kaanon mein chupke se kehta rahe<br><br>Taare ginn taare ginn soe binn saare ginn<br>ek haseen mazaa hai ye mazaa hai ya sazaa hai ye<br><br>jab se hua hai ye achchha sa lagtaa hai<br>dil ho gaya phir se baccha sa lagtaa hai<br>Ishq ragon mein jo behta rahe<br>jaakay kaanon mein chupke se kehta rahe<br><br>Taare ginn taare ginn soe binn saare ginn<br>ek haseen mazaa hai ye mazaa hai ya sazaa hai ye<br><br>roko ise jitna mahsoos ho ye utana<br>dard zaraa sa hai thoda dava sa hai<br>ismain hai joh taairra vo hi toh dooba hai<br>dhokhaa zaraa sa hai thoda vafaa sa hai<br><br>ye vaadaa hai ya iraada hai<br>kabhi ye zyaada hai kabhi ye aadha hai<br><br>Taare ginn taare ginn soe binn saare ginn<br>ek haseen mazaa hai ye mazaa hai ya sazaa hai ye",
"repo_url": "https://github.com/cachecleanerjeet/JiosaavnAPI"
}
- NodeJS (axios)
var axios = require('axios');
var config = {
method: 'get',
url: 'https://jiosaavn-api.vercel.app/lyrics?id=iX_FM-ow',
headers: { }
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
- XHR
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function() {
if(this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://jiosaavn-api.vercel.app/lyrics?id=iX_FM-ow");
xhr.send();
- PHP Using Curl
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://jiosaavn-api.vercel.app/lyrics?id=iX_FM-ow',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
- Python Using Requests
import requests
url = "https://jiosaavn-api.vercel.app/lyrics?id=iX_FM-ow"
payload={}
headers = {}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)