Shazam

GRATIS CON POSSIBILITร€ DI UPGRADE
Verified
โœ“
Da Api Dojo | Aggiornamento 8 days ago | Music
Popolaritร 

9.8 / 10

Latenza

1,710ms

Livello di servizio

99%

Health Check

N/A

Torna a tutte le discussioni

How to get song lyrics

Rapid account: Neeravtheheroo
neeravtheheroo
2 months ago

How do i get song lyrics from any song id ?

Rapid account: Neeravtheheroo
neeravtheheroo Commented 2 months ago

ok thanks for the help

Rapid account: Apidojo
apidojo Commented 2 months ago

I helped you โ€œHow to get song lyricsโ€. I am sorry I cannot help you with coding. You can use Google to learn coding, and Google is free.

Rapid account: Neeravtheheroo
neeravtheheroo Commented 2 months ago

but first i needed to get inside that object to get the text
to do that i had to loop through the lyrics object to get the id , to go inside that object to get lyrics text

Rapid account: Apidojo
apidojo Commented 2 months ago

I said :
1/ Try pasting the response in a text editor and learn it
2/ Try expanding the โ€œtextโ€ JSON object.
Now, check the screenshot to see your careless and stupid https://prnt.sc/j9WcZQmspHco

Rapid account: Neeravtheheroo
neeravtheheroo Commented 2 months ago

i made it work by doing this ->
const lyricObj = songData?.resources?.lyrics
let lyricId;

for (const key in songData?.resources.lyrics) {
lyricId = key
}

{lyricObj ? lyricObj[lyricId]?.attributes?.text.map((line, i) => (
<p key={i} className=โ€œtext-gray-400 text-base my-1โ€ >{line}</p>
)): <p className=โ€œtext-gray-400 text-base my-1โ€ >Sorry, no lyrics found!</p> }

Rapid account: Neeravtheheroo
neeravtheheroo Commented 2 months ago

i know that lyrics are in text but how do i access it i need to know the id of that object everytime i get lyrics so where do i get it

Rapid account: Apidojo
apidojo Commented 2 months ago

Well, did you ever try expanding the โ€œtextโ€ JSON object?!

Rapid account: Neeravtheheroo
neeravtheheroo Commented 2 months ago


IMAGE: https://imgur.com/a/nXMJn84
I have searched for "lyric"
but to access lyric text we need to get inside the object, to get inside it we need a key which is random for every song which has lyrics

Rapid account: Apidojo
apidojo Commented 2 months ago

You need to spend time learning the response data. For example, you first paste the raw response data in any text editor, then search for โ€œlyricโ€. It will help you locate the correct JSON node. If it is too difficult for you to learn and analyze the response data, you may find a local developer to help you out.

Rapid account: Neeravtheheroo
neeravtheheroo Commented 2 months ago

but how do i get them because they are like this
data = reponse that i got
data.resources.lyrics.[some id that is random and we dont know].attributes.text

Partecipa alla discussione - aggiungi un commento di seguito:

Accedi/Iscriviti per pubblicare nuovi commenti