# How to Integrate Retool with SoundCloud

- Tool: Retool
- Difficulty: Intermediate
- Time required: 20 minutes
- Last updated: April 2026

## TL;DR

Connect Retool to SoundCloud using a REST API Resource with OAuth 2.0 client credentials. Configure the SoundCloud API base URL and client_id authentication, then build queries to fetch tracks, follower data, and play statistics. The setup takes about 20 minutes and enables an independent artist analytics dashboard in Retool.

## Why Connect Retool to SoundCloud?

SoundCloud's native analytics dashboard provides basic play counts and follower data, but it lacks the cross-track comparison, trend analysis, and custom filtering that music labels, artist managers, and digital marketing teams need. Connecting Retool to the SoundCloud API lets you build internal dashboards that aggregate track performance across an entire catalog, compare engagement metrics between releases, and spot growth trends over time — all in a flexible table-and-chart interface that SoundCloud's own UI doesn't offer.

The SoundCloud API exposes user profiles, tracks, playlists, comments, and follower data through REST endpoints. For public data, requests can be made with just a client_id parameter. For private user data and analytics, OAuth 2.0 tokens are required. In Retool, both patterns are handled within the REST API Resource configuration — you set up authentication once and all queries reuse those credentials automatically through the server-side proxy.

Independent artist management studios, music distribution companies, and podcast networks are the primary teams that benefit from this integration. Retool apps can replace manual spreadsheet tracking by automatically pulling the latest SoundCloud metrics on a schedule, enabling near-real-time dashboards that show an artist's play count trajectory, audience geography (where available), and catalog depth.

## Before you start

- A SoundCloud account with artist content or access to the account you want to analyze
- A SoundCloud API application registered at soundcloud.com/you/apps to obtain client_id and client_secret
- A Retool account (Cloud or self-hosted) with permission to add Resources
- Basic familiarity with OAuth 2.0 client credentials flow and REST API concepts

## Step-by-step guide

### 1. Register a SoundCloud app and obtain API credentials

To access SoundCloud's API, you must register an application through SoundCloud's developer portal. Open a browser and navigate to soundcloud.com/you/apps (you must be logged in to your SoundCloud account). Click the Register a New Application button. Fill in the required fields: Application Name (e.g., 'Retool Analytics Dashboard'), Website URL (your company website or Retool instance URL), and a short description of how you will use the API.

After submitting the registration form, SoundCloud creates your application and displays your credentials: a Client ID and a Client Secret. Copy both values immediately and store them securely. The Client ID is used for public API calls as a query parameter. The Client Secret, combined with the Client ID, is used for OAuth 2.0 to obtain access tokens for private user data.

Note that SoundCloud's API access is subject to review for certain types of applications, particularly those accessing private user data or performing write operations. For read-only analytics dashboards accessing public track data, the client_id parameter alone is often sufficient. Once you have your credentials, navigate to Retool's Settings → Configuration Variables, add SOUNDCLOUD_CLIENT_ID and SOUNDCLOUD_CLIENT_SECRET as Secret variables, and save them for use in the next step.

**Expected result:** A SoundCloud app is registered with a client_id and client_secret. Both values are stored as Secret Configuration Variables in Retool settings.

### 2. Create a SoundCloud REST API Resource in Retool

Navigate to the Retool home page and click Resources in the top navigation or left sidebar. Click the Add Resource button in the top right corner. Search for or scroll to 'REST API' in the resource type list and click it.

In the Name field, enter 'SoundCloud API'. In the Base URL field, enter https://api.soundcloud.com — this is the root endpoint for all SoundCloud API v1 calls. Note that SoundCloud also uses api-v2.soundcloud.com for some endpoints; you may need a second resource for those or override the URL per-query.

For authentication, SoundCloud's public endpoints accept a client_id as a URL parameter. For simplicity, add it as a default URL parameter in the resource: scroll to the URL Parameters section, click Add parameter, set Key to client_id, and set Value to {{ retoolContext.configVars.SOUNDCLOUD_CLIENT_ID }}. This automatically appends the client_id to every request made through this resource.

For authenticated endpoints requiring an access token, the Authorization header will need to be set dynamically per query using the token obtained from the OAuth flow. Add a default header: Key = Accept, Value = application/json; charset=utf-8. Click Save Changes. The SoundCloud API resource is now available in the query editor.

**Expected result:** A 'SoundCloud API' REST API Resource appears in the Retool Resources list with the base URL and client_id parameter configured. It is ready to use in the query editor.

### 3. Build queries to fetch user and track data

Open or create a new Retool app. In the Code panel at the bottom, click + New to create your first query. Name it getSoundCloudUser. Select your SoundCloud API resource. Set method to GET and path to /users/{{ userIdInput.value }} — where userIdInput is a Text Input component you will add to the canvas. Alternatively, hard-code a specific SoundCloud user ID (the numeric ID, not the username slug) for a fixed dashboard. Set Trigger to run automatically on page load or on input change.

Create a second query named getUserTracks. Resource = SoundCloud API, method = GET, path = /users/{{ userIdInput.value }}/tracks. Add URL parameters: limit = 200 (maximum per request) and linked_partitioning = true (enables pagination cursor). Set Trigger to run automatically when userIdInput changes.

Create a third query named getUserFollowers. Resource = SoundCloud API, method = GET, path = /users/{{ userIdInput.value }}/followers. Add parameter limit = 50. This retrieves follower profile objects.

Create a fourth query named getUserPlaylists. Resource = SoundCloud API, method = GET, path = /users/{{ userIdInput.value }}/playlists. These four queries form the foundation of your analytics dashboard and cover the core data points: profile, tracks, followers, and playlists.

```
// JavaScript transformer to calculate track engagement metrics
// Attach to getUserTracks query (Advanced → Transform data)
const tracks = data;
if (!tracks || !Array.isArray(tracks)) return [];

return tracks
  .sort((a, b) => (b.playback_count || 0) - (a.playback_count || 0))
  .map((track, index) => ({
    rank: index + 1,
    title: track.title || 'Untitled',
    plays: track.playback_count || 0,
    likes: track.likes_count || track.favoritings_count || 0,
    comments: track.comment_count || 0,
    reposts: track.reposts_count || 0,
    duration: track.duration
      ? Math.floor(track.duration / 60000) + ':' + String(Math.floor((track.duration % 60000) / 1000)).padStart(2, '0')
      : 'N/A',
    uploadedAt: track.created_at
      ? new Date(track.created_at).toLocaleDateString()
      : 'N/A',
    permalink: track.permalink_url || ''
  }));
```

**Expected result:** Four queries are running and returning SoundCloud data: getSoundCloudUser returns the user profile, getUserTracks returns the track catalog, getUserFollowers returns follower profiles, and getUserPlaylists returns playlist data.

### 4. Build the artist analytics dashboard interface

With data queries in place, assemble the analytics dashboard UI. Start by adding a Text Input component at the top of the canvas labeled 'SoundCloud User ID'. This drives all four queries. Next to it, add a Button labeled 'Load' that triggers all four queries on click (add four event handlers, each triggering one query).

Below the input row, drag four Stat components across the top of the canvas. Configure them to display key metrics from getSoundCloudUser: Total Followers ({{ getSoundCloudUser.data.followers_count }}), Total Tracks ({{ getSoundCloudUser.data.track_count }}), Total Plays (a sum calculated by a transformer over getUserTracks.data), and Total Likes.

Drag a Table component onto the main canvas area. Set Data source to {{ getUserTracks.data }} (with the formatTracks transformer applied). Show columns: rank, title, plays, likes, comments, reposts, duration, uploadedAt. Enable column sorting. Add a Link column using the permalink field so clicking a track title opens it in SoundCloud.

Drag a Chart component alongside the Table. Set Chart type to Bar. Data source should reference a transformer that returns the top 15 tracks with their play counts. Set X-axis to title and Y-axis to plays. For complex artist management setups spanning multiple accounts and advanced reporting, RapidDev's team can help architect multi-user analytics solutions in Retool.

```
// Standalone transformer for Chart data (top 15 tracks by plays)
// Reference as {{ trackChartData }} in the Chart component Data source
const tracks = getUserTracks.data;
if (!tracks || !Array.isArray(tracks)) return [];

return tracks
  .filter(t => t.playback_count > 0)
  .sort((a, b) => b.playback_count - a.playback_count)
  .slice(0, 15)
  .map(t => ({
    title: t.title && t.title.length > 20 ? t.title.substring(0, 20) + '...' : t.title,
    plays: t.playback_count || 0
  }));
```

**Expected result:** The dashboard displays an artist's key stats in Stat components, a sortable Table of all tracks with engagement metrics, and a Bar chart showing the top tracks by play count.

### 5. Set up OAuth 2.0 token acquisition for authenticated endpoints

Public track and user profile data is accessible with just the client_id parameter. However, accessing private data, performing write operations (adding to playlists, following users), or making requests on behalf of a specific authenticated user requires a full OAuth 2.0 access token. This step covers obtaining that token within Retool.

Create a new query named getAccessToken. Instead of using the SoundCloud API resource, create a separate REST API Resource pointed at https://api.soundcloud.com specifically for token acquisition, or use a JavaScript query to make the fetch call. The token endpoint is POST https://api.soundcloud.com/oauth2/token. The body must be form-urlencoded with the following fields: client_id = {{ retoolContext.configVars.SOUNDCLOUD_CLIENT_ID }}, client_secret = {{ retoolContext.configVars.SOUNDCLOUD_CLIENT_SECRET }}, grant_type = client_credentials.

For the SoundCloud client credentials grant, the response returns an access_token valid for a limited time. Reference this token in subsequent authenticated queries by adding an Authorization header: Bearer {{ getAccessToken.data.access_token }}. Set the getAccessToken query to run on page load with a cache duration of 3500 seconds to avoid redundant token requests.

For queries that need authenticated access, override the Authorization header in the individual query's Headers section, dynamically injecting the cached token. This pattern works for any SoundCloud endpoint that requires user authentication beyond public data access.

```
{
  "method": "POST",
  "url": "https://api.soundcloud.com/oauth2/token",
  "headers": {
    "Content-Type": "application/x-www-form-urlencoded",
    "Accept": "application/json; charset=utf-8"
  },
  "body": "client_id={{ retoolContext.configVars.SOUNDCLOUD_CLIENT_ID }}&client_secret={{ retoolContext.configVars.SOUNDCLOUD_CLIENT_SECRET }}&grant_type=client_credentials"
}
```

**Expected result:** The getAccessToken query returns an access_token value. Authenticated API queries using this token in the Authorization header successfully access private SoundCloud data.

## Best practices

- Store SoundCloud client_id and client_secret in Retool Configuration Variables marked as Secret — never hard-code them in query fields or URL parameters that could appear in browser DevTools.
- Cache OAuth access tokens for 3500 seconds to minimize token requests while staying safely within the token lifetime.
- Use the /resolve endpoint to convert SoundCloud profile URLs or slugs to numeric user IDs, which are more stable than usernames that artists may change.
- For dashboards tracking multiple artists, use a Select component populated from a list of artist user IDs stored in your database, rather than requiring manual ID entry.
- Build read-only views before adding write operations — validate that the data display is accurate before enabling post creation, playlist modification, or follow actions.
- Use JavaScript transformers to calculate derived metrics (engagement rate = (likes + comments + reposts) / plays) rather than querying the API for computed values.
- Schedule data snapshots via Retool Workflows to capture historical play count data — the SoundCloud API only returns current values, not historical trends.

## Use cases

### Build an artist catalog performance tracker

Create a Retool dashboard that queries all tracks for a specific SoundCloud user, displays them in a Table ordered by play count, and shows a Bar chart comparing total plays across the top 20 tracks. Add a date range filter to narrow the view and a Search input to find specific tracks by title.

Prompt example:

```
Build an artist analytics panel that lists all SoundCloud tracks for a given user ID sorted by playback count, with columns for title, play count, like count, comment count, and upload date. Include a bar chart showing the top 10 tracks by plays.
```

### Monitor follower growth and audience engagement over time

Build a Retool dashboard that fetches user follower count and recent track stats on a schedule, stores snapshots in a Retool Database or PostgreSQL table, and displays a Line chart showing follower growth and play count trends week over week. Use a Retool Workflow to automatically capture these snapshots daily.

Prompt example:

```
Build a growth tracking panel that shows a line chart of weekly follower count and total plays for a SoundCloud artist, pulling data from a snapshot table. Add a stat card showing total followers today and the week-over-week change.
```

### Build a playlist and track management panel

Create a Retool admin panel for a music label that lists all playlists for a managed artist account, shows track counts and total duration per playlist, and allows viewing the tracks within any selected playlist. Include a form to add a track to a playlist or reorder tracks via SoundCloud API write endpoints.

Prompt example:

```
Build a playlist manager that lists all playlists for a SoundCloud account in a table with track count and total duration, allows clicking a playlist to expand its track list in a second table, and includes a button to remove a track from the selected playlist.
```

## Troubleshooting

### API queries return 401 Unauthorized even though client_id is set correctly

Cause: The client_id Configuration Variable is not being referenced correctly in the resource's URL parameters, or the SoundCloud app registration is pending review or has been suspended.

Solution: Open the SoundCloud API resource configuration (Resources tab → SoundCloud API → Edit). Verify the URL parameter value is {{ retoolContext.configVars.SOUNDCLOUD_CLIENT_ID }} — not a hard-coded value or incorrect variable reference. Log in to soundcloud.com/you/apps to check that your app registration is in an active state and not pending review. If the app was recently registered, it may take a few hours to become active.

### getUserTracks query returns only 50 tracks even though the artist has hundreds

Cause: SoundCloud's API paginates results with a default limit and uses cursor-based pagination that requires following the next_href link to retrieve additional pages.

Solution: Add limit=200 as a URL parameter (the maximum per request). For artists with more than 200 tracks, you need to implement pagination by checking the next_href field in the response. Create a JavaScript query that loops through pages using async/await, following next_href URLs until the field is null. Use Promise.all or sequential awaits to collect all pages, then concatenate the results before binding to the Table.

```
// Paginated track fetch in a JavaScript query
const results = [];
let url = `https://api.soundcloud.com/users/${userIdInput.value}/tracks?client_id=${retoolContext.configVars.SOUNDCLOUD_CLIENT_ID}&limit=200&linked_partitioning=true`;

while (url) {
  const response = await fetch(url);
  const data = await response.json();
  results.push(...(data.collection || []));
  url = data.next_href || null;
}

return results;
```

### Track play counts returned by the API seem lower than what SoundCloud shows in the native interface

Cause: SoundCloud's API and its native interface may use different counting methodologies, or there is a delay between plays being recorded and the API reflecting the updated count.

Solution: This is a known discrepancy in SoundCloud's platform — API play counts may lag behind the native dashboard by several hours. There is no workaround for the delay. If accuracy is critical, note the timestamp of each API call and treat the data as a point-in-time snapshot rather than a real-time figure. For trend analysis, the relative differences between tracks remain accurate even if absolute counts are slightly delayed.

## Frequently asked questions

### Does the SoundCloud API require approval before I can use it?

SoundCloud requires you to register an application at soundcloud.com/you/apps to obtain a client_id. Basic read access to public tracks and user profiles is generally available immediately after registration. However, SoundCloud has restricted API access for some use cases and may require review for commercial applications or those accessing private user data. Check SoundCloud's current developer terms when registering your app.

### Can Retool access private SoundCloud tracks, not just public ones?

Yes, but it requires a full OAuth 2.0 authorization flow where the track owner authenticates and grants your app permission. This involves a three-legged OAuth redirect, which is more complex to implement in Retool than the client credentials flow. For internal dashboards tracking your own artist account's private content, you can use the authorization code flow to obtain a user-specific access token, then store that token as a Configuration Variable for use in Retool queries.

### Does SoundCloud's API provide geographic data about who listens to tracks?

SoundCloud's public API has limited geographic analytics compared to platforms like Spotify for Artists or YouTube Analytics. Basic location data may be available through some endpoints on the API v2 (api-v2.soundcloud.com), but SoundCloud's analytics features are primarily accessible through the native SoundCloud interface for Pro and Pro Unlimited accounts. For detailed geographic insights, you may need to combine SoundCloud data with your own tracking infrastructure.

### How frequently should I poll the SoundCloud API for updated stats?

SoundCloud's API rate limits vary by endpoint and may not be publicly documented. For analytics dashboards, polling every 15-60 minutes is typically sufficient since play count data is not real-time even in SoundCloud's native interface. Avoid aggressive polling with intervals under 1 minute, as this risks hitting rate limits and having your client_id temporarily blocked. Use Retool Workflow schedules for periodic data capture rather than frequent on-demand queries.

---

Source: https://www.rapidevelopers.com/retool-integrations/soundcloud-api
© RapidDev — https://www.rapidevelopers.com/retool-integrations/soundcloud-api
