Spotify API Deployment vs localhost
Unanswered
humaneach1 posted this in #help-forum
Hi, I was wondering if I can set the location which my vercel deployment comes from. This is because when I am using the spotify api, when running on localhost (in the United States) and fetching for the top 50 songs, it gives a different list than compared to my vercel deployment.
I've noticed that the timezone isn't the US since I used toLocaleString and it was in GMT so I am guessing that the location of the deployment is not in the US either.
Is this normal behavior for anyone who has done used the Spotify API in this way because I would want it so that the api fetches the same data if possible
Thanks!
I've noticed that the timezone isn't the US since I used toLocaleString and it was in GMT so I am guessing that the location of the deployment is not in the US either.
Is this normal behavior for anyone who has done used the Spotify API in this way because I would want it so that the api fetches the same data if possible
Thanks!
9 Replies
You can check where vercel deploys functions in the settings of the project
I believe all builds happen in the us east 1 region
Whatever Washington DC is I think
Also you can prefix the build and start commands in package json
With a timezone variable
To change your timezone globally
Google that for the exact syntax
@linesofcode Also you can prefix the build and start commands in package json
ohhh interesting i didnt know that
so like spotify refreshes the top songs that someone has every like 12 hours or something and when I fetch using localhost it gets the current list that I see when I open spotify like the screenshot but my deployment gives me the list of songs that was the previous list and I think its cause the deployment fetches it from a geographical location where the spotify api might be behind maybe? so idk if this is fixable cause other websites seem to have the list updated to my Spotify and localhost one but my deployment has the previous list