How can I make calls to spotify api- I want to get episodes listed of a podcast.
There is a problem related to bearer token. I dont even know how to start writing the code
20 Replies
Ive watched videos but its not working
There's extensive documentation on the Spotify developer site, including examples. If you get stuck using those, post your code and error messages, and someone might be able to help
this is the part of code
error
the id of show is correct
tho
You have to define (I think in the Spotify admin panel) what your application can access, did you set that up?
Yes the URI is defined in the panel - localhost:3000
I just can't figure out 😞
Bro i read the docs , but i dont understand one thing -what if we dont want to authorize?
Im making a podcast website for someone and i want users to stream the episodes without logging in in spotify
Am i clear enough idk?
feels like shouldn't have taken this project in the first place, fkin suck at codin
The user doesn't authorize themselves, but you have to authorize using a single account to use the api. It's probably also a bad idea because of that to run it on the front end, because I don't think you want to expose your api key to the user
ohh yes the key was just temporarily there, was goin to create .env after fixing the issue
if your code runs frontend, adding a .env won't fix anything
I dont understand
you posted this in #front-end, which means you're running all your code in the browser right? Just uploading it to a static site somewhere that serves the files and doesn't run any code itself?
In that case, the values in that
.env
file are just going to go through the bundler and straight into the javascript file that's getting sent to the user
.env
isn't magic security. If the code runs in the browser, the user will be able to get the API key with minimal effortwhat im supposed to do then, im using astro
do enough research into what people can do with the API key to see if you're comfortable having it public, or write a backend somewhere that lets you retain control of the key
ok
APII have an api call in app.js- there's a episodeName variable in async 'main' function
The variable is console logging the value of name of episodes retrieved by the api.
img2: I want to print those values in episodelist.astro page
Output: image3
So I want episodelist.astro to be an index for the episode, how can i print the values
make a new post, this is an entirely different question. And please, whenever possible, include your actual code and not just screenshots @joy2op
my bad G, sure
done