无需SoundCloud API及认证应用,如何检测用户关注账号状态?
Great question—let’s walk through what’s possible here, given SoundCloud’s current API restrictions.
First, the hard truth: without an approved SoundCloud API app/keys, automatic, reliable detection of a user’s follow status is not feasible—here’s why, plus the workarounds you can use:
为什么自动检测行不通?
SoundCloud’s core API endpoints (like checking a user’s follow relationships) require OAuth authentication, which mandates having an approved app ID/secret. Since they’ve paused new app applications, you can’t get access to these authenticated endpoints.
On top of that, browser security rules (same-origin policy) block your site from accessing data or cookies from the SoundCloud pop-up window. Even if you tried to scrape the public SoundCloud profile page, you’d run into two critical issues:
- You can’t confirm the logged-in user in the pop-up matches the user on your site (no shared authentication state).
- SoundCloud’s public pages don’t expose follow status for unauthenticated requests—you’d only see the "Follow" button state if you’re logged in as the user, which your site can’t access cross-domain.
可行的替代方案
The only practical workaround here is to rely on user confirmation after they close the pop-up:
- When the SoundCloud pop-up closes, trigger a modal or prompt on your site asking: "Did you successfully follow this user?"
- Let the user select "Yes" or "No", then update your system’s follow status based on their input.
This isn’t automatic, but it’s the only way to work within the constraints of no API access and browser security rules.
Some other ideas you might consider (but they’re likely to fail):
- Embedding SoundCloud profiles in an iframe: SoundCloud uses
X-Frame-Optionsheaders to block embedding, so this won’t work. - Trying to track pop-up interactions: Browsers don’t let you monitor clicks or DOM changes in cross-origin windows, so you can’t detect when the user clicks the "Follow" button.
总结
If you can’t get an approved SoundCloud app, automatic follow detection is off the table. User confirmation is the most reliable (and only viable) way to sync the follow status in your system.
内容的提问来源于stack exchange,提问作者HTML

