How can I get the API output returned?

Quote $(urlfetch https://api.sobabear.com/happiness/random-quote)
Return {“message”:“Quote fetched successfully”,“statusCode”:200,“data”:{“id”:102,“content”:“Just as a person who has not created wealth has no right to consume it, a person who has not created happiness has no right to enjoy it.”,“author”:“George Bernard Shaw”,“description”:null,“link”:null}}

Response: Just as a person who has not created wealth has no right to consume it, a person who has not created happiness has no right to enjoy happiness. George Bernard Shaw

I am a beginner who knows nothing. I want to learn by seeing what has been created.

Try:

$(eval const api = $(urlfetch json https://api.sobabear.com/happiness/random-quote); if (api.statusCode === 200) { 'Quote: ' + api.data.content + ' - ' + api.data.author; } else { 'Error fetching quote'; })

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.