Hub
Pricing About
WorkflowWorkflow

Get Spotify Data Using OAuth2 Nodes

SpotifyAPIOAuth2Release 5.1
knime profile image
Versionv1.0Latest, created on 
Oct 20, 2023 2:07 PM
Drag & drop
Like
Download workflow
Workflow preview
You can easily download and run the workflow directly in your KNIME installation. We recommend that you use the latest version of the KNIME Analytics Platform for optimal performance. It can also be deployed as a Data App in KNIME Business Hub. As you may notice, the workflow nodes are currently not executed (indicated by the red light) because first, you must create a Spotify App within your account. This process is straightforward. Follow the step-by-step guide in the External resources section titled "How to create a Spotify App - Docs." The next step is to retrieve your Client ID and Client Secret from your recently created Spotify App. To do this, click on your app name and then "Settings". Copy and paste the values into the "String Configuration" nodes to complete the process. First, let's take a look at the steps for configuring the "OAuth2 Authenticator (Client Credentials)" node: 1. As "Token endpoint URL": https://accounts.spotify.com/api/token 2. To pass the credentials (Client ID and Secret) into the node, select "credentials." 3. We must input a random scope from the list of scopes in the External Resources section. 4. Click "Show advanced settings," then input gran_type=client-credentials in "Additional request fields" for node authorization flow. Regarding the Client Credentials authorization flow is essential to notice that "Clients use the Client Credentials grant type to obtain an access token outside of the context of a user. Clients typically use this to access resources about themselves rather than a user's resources." So with this kind of authorization flow, we cannot access users' private resources. See the "Spotify API Authorization types - Docs" link in the External Resources section. After connecting our OAuth2 node to the "GET Request" nodes via the blue port, opening the configuration of the GET nodes will reveal that the "Credential (input port)" is automatically selected in the "Authentication" tab. Therefore, the Get Request uses the authorization from the OAuth 2 node to make calls. Here's how the workflow operates: 1. We enter the artist's name to generate the initial URL: https://api.spotify.com/v1/search?q=&type=artist. 2. Then we select an artist from the query list and generate the URL for the second call: https://api.spotify.com/v1/artists//top-tracks?market=ES 3. A table view is created showcasing the top ten tracks of the chosen artist. It's possible to manually change the hardcoded market by accessing the "Query result" component and String manipulation node.

External resources

  • Spotify Client Credentials Flow - Docs
  • How to create a Spotify App - Docs
  • Spotify Dashboard
  • Spotify Web API endpoints - Docs
  • Spotify List of scopes - Docs
  • Spotify API Authorization types - Docs
Loading deploymentsLoading ad hoc jobs

Used extensions & nodes

Created with KNIME Analytics Platform version 5.1.0 Note: Not all extensions may be displayed.
  • Go to item
    KNIME Base nodesTrusted extension

    KNIME AG, Zurich, Switzerland

    Version 5.1.0

    knime profile image
    knime
  • Go to item
    KNIME Basic Authentication nodesTrusted extension

    KNIME AG, Zurich, Switzerland

    Version 5.1.0

    knime profile image
    knime
  • Go to item
    KNIME ExpressionsTrusted extension

    KNIME AG, Zurich, Switzerland

    Version 5.1.0

    knime profile image
    knime
  • Go to item
    KNIME JavaScript ViewsTrusted extension

    KNIME AG, Zurich, Switzerland

    Version 5.1.0

    knime profile image
    knime
  • Go to item
    KNIME JavasnippetTrusted extension

    KNIME AG, Zurich, Switzerland

    Version 5.1.0

    knime profile image
    knime
  • Go to item
    KNIME JSON-ProcessingTrusted extension

    KNIME AG, Zurich, Switzerland

    Version 5.1.0

    knime profile image
    knime
  • Go to item
    KNIME Quick FormsTrusted extension

    KNIME AG, Zurich, Switzerland

    Version 5.1.0

    knime profile image
    knime
  • Go to item
    KNIME REST Client ExtensionTrusted extension

    KNIME AG, Zurich, Switzerland

    Version 5.1.0

    knime profile image
    knime
  • Go to item
    KNIME ViewsTrusted extension

    KNIME AG, Zurich, Switzerland

    Version 5.1.0

    knime profile image
    knime

Legal

By using or downloading the workflow, you agree to our terms and conditions.

KNIME
Open for Innovation

KNIME AG
Talacker 50
8001 Zurich, Switzerland
  • Software
  • Getting started
  • Documentation
  • Courses + Certification
  • Solutions
  • KNIME Hub
  • KNIME Forum
  • Blog
  • Events
  • Partner
  • Developers
  • KNIME Home
  • Careers
  • Contact us
Download KNIME Analytics Platform Read more about KNIME Business Hub
© 2025 KNIME AG. All rights reserved.
  • Trademarks
  • Imprint
  • Privacy
  • Terms & Conditions
  • Data Processing Agreement
  • Credits