A simple Python library to parse the most recent tracks of any SoundCloud user.
While there are many SoundCloud API wrappers for Python, most of them struggle to fetch "Recent Tracks". This is because SoundCloud has implemented strict bot detection on that specific API section.
sctracks bypasses this by utilizing the mobile version of the site and mimicking natural user behavior (Search > Profile > Tracks) using Selenium and undetected-chromedriver.
- Download: Place
sctracks.pyin your project folder. - Dependencies: Install the required libraries:
pip install selenium undetected-chromedriver
The undetected_chromedriver library usually handles the driver version automatically.
However, if you encounter the SessionNotCreatedException, please specify your Chrome version in the line 44 of the sctracks.py source manually:
driver = uc.Chrome(options=options, version_main=143) # Replace 143 with your Chrome major versionSimply import the library and provide the username (found in the SoundCloud profile URL)
import sctracks
# Example: https://soundcloud.com/user-470248955
tracks = sctracks.launch("user-470248955")
print(tracks)The library returns a list of dictionaries:
[
{
'title': 'and i love her',
'url': 'https://soundcloud.com/user-470248955/and-i-love-her',
'cover': 'https://i1.sndcdn.com/artworks-Tz8ERTJ1qGi3c251-VxeAIw-t240x240.jpg',
'plays': '70.2K',
'duration': '0:52',
'uploaded': '2y'
},
...
]The launch function supports two debug levels to help you monitor the scraping process:
None|| Silent mode (default). No console output."TEXT"|| Prints console logs only to track progress."FULL"|| Enables logs + automatic screenshots for deep debugging.
Example:
sctracks.launch("user-470248955", debug="FULL")Please be aware that parsing a large number of profiles in a short period may cause the anti-bot system to flag your IP address. Use responsibly and consider adding delays between requests if scraping multiple users.