cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

spotify API get token - raw_input was called, but this frontend does not support input requests.

AlexSantiago
New Contributor II

hello everyone, I'm trying use spotify's api to analyse my music data, but i'm receiving a error during authentication, specifically when I try get the token, above my code.

Is it a databricks bug?

pip install spotipy

from spotipy.oauth2 import SpotifyOAuth

from spotipy.oauth2 import SpotifyClientCredentials

import spotipy

import spotipy.util as util

sp = spotipy.oauth2.SpotifyOAuth(client_id='client_id

                ,client_secret='client_secret

                ,redirect_uri='http://localhost:8080/callback/'

                ,requests_timeout=5, open_browser=False)

sp.get_access_token()

error:

StdinNotImplementedError: raw_input was called, but this frontend does not support input requests.

18 REPLIES 18

jack533
New Contributor III

If you need any further help you can ping me.

jerrygen78
New Contributor III

Hi Alex,

You're definitely not alone — this is a common issue when using the Spotify API in environments like Databricks or Jupyter Notebooks, where user input through the console (like typing in a prompt) isn't supported.

What's happening is that the authentication process is trying to ask you for input, such as pasting in a URL or login info, but Databricks doesn’t allow that kind of interaction. That’s why you’re seeing the StdinNotImplementedError.

Here’s what you can do:

  1. If you're trying to access your personal Spotify data (like playlists, saved tracks, or recently played songs), you’ll need to do the authentication on your local machine where input prompts and browser login work normally. Once you get the access token there, you can copy it and use it in Databricks.

  2. If you only need public data (like artist info, album details, or general song metadata), you can use a simpler method called the Client Credentials Flow. This doesn't require user login and works well in Databricks — but it won’t give you access to your personal listening data.

In short: Databricks can’t handle login prompts, so you either need to do the login part outside of it, or stick to public data.

Let me know what kind of Spotify Premium data you're aiming to analyze, and I can help you choose the best route!

orcaslicer3d
New Contributor II

If you’ve already verified your OAuth process and backend token handling, sometimes building a quick test app to simulate API calls helps pinpoint formatting issues with the raw input. I’ve run into similar troubleshooting scenarios while working on automation for a 3D printing workflow at   the key was isolating the request/response cycle to identify where the formatting broke down.

simulador
New Contributor II

 

If isolating the request/response cycle isn’t revealing the issue, it might be worth running the same token request through a completely different environment (like a lightweight cloud function) to see if the problem persists outside your current setup. I’ve had similar debugging steps save a lot of time when integrating APIs into unrelated automation systems even in areas like retirement planning simulador jubilacion at where precise request formatting is critical for accurate outputs.

 

Join Us as a Local Community Builder!

Passionate about hosting events and connecting people? Help us grow a vibrant local community—sign up today to get started!

Sign Up Now