• v2.0.0 d14095061b

    v2.0.0 Stable

    kerem released this 2026-01-25 21:17:47 +03:00 | 0 commits to main since this release

    📅 Originally published on GitHub: Sun, 25 Jan 2026 18:22:34 GMT
    🏷️ Git tag created: Sun, 25 Jan 2026 18:17:47 GMT

    v2.0.0 - No Authentication Required 🎉

    This is a major release that completely redesigns the package to work without any authentication tokens.

    What's New

    Zero Authentication

    The package now scrapes Spotify's public web pages to extract embedded data. No more dealing with access tokens, client tokens, or OAuth flows!

    // Before (v1.x) - Required tokens
    client := spotify.NewClient(
        spotify.WithAccessToken("..."),
        spotify.WithClientToken("..."),
    )
    
    // Now (v2.0) - Just works!
    client := spotify.NewClient()
    track, _ := client.FetchTrack(ctx, "4cOdK2wGLETKBW3PvgPWqT")
    

    Browser-Like TLS Fingerprinting

    Uses CycleTLS to mimic real browser requests, bypassing Spotify's bot detection.

    💥 Breaking Changes

    Removed Features

    • Search functionality - Search(), SearchWithOptions(), SearchTopResult() removed (not available via HTML scraping)
    • Authentication system - auth/ package removed entirely
    • Token options - WithAccessToken(), WithClientToken(), WithTokenPersistence(), WithAuthManager() removed
    • Auth errors - ErrTokenExpired, ErrTokenNotFound, ErrRequestCanceled, AuthError, IsAuthError() removed

    Go Version Requirement

    • Minimum Go version is now 1.24 (required by CycleTLS dependency)

    Simplified Error Types

    • APIError no longer wraps errors (removed Unwrap() method)
    • WrapAPIError() function removed
    • NewAuthError() function removed

    📦 What's Included

    Feature Status
    Track info (name, duration, album, artists)
    Artist info (name, followers, monthly listeners, bio)
    Album info (name, artists, track list, artwork)
    Cover art URLs
    Play counts ⚠️ Limited (often empty in HTML)
    Search Removed

    🚀 Migration Guide

    1. Update Go version

    # go.mod
    go 1.24
    

    2. Remove authentication code

    // Delete these imports
    // "github.com/FrostBreker/spotify-private-api/auth"
    
    // Delete token-related options
    client := spotify.NewClient(
        // spotify.WithAccessToken("..."),    // Remove
        // spotify.WithClientToken("..."),    // Remove
        // spotify.WithTokenPersistence("..."), // Remove
        spotify.WithDebug(true), // Keep if needed
    )
    

    3. Remove search code

    // These functions no longer exist:
    // client.Search(ctx, "query")
    // client.SearchWithOptions(ctx, "query", opts)
    // client.SearchTopResult(ctx, "query")
    

    4. Update error handling

    // Before
    if errors.IsAuthError(err) { ... }
    if err == errors.ErrTokenExpired { ... }
    
    // After - just remove these checks
    if errors.IsAPIError(err) { ... }
    if errors.IsParseError(err) { ... }
    

    📋 Full Changelog

    Added

    • CycleTLS integration for browser-like TLS fingerprinting
    • HTML scraping to extract embedded initialState data
    • Automatic data extraction without authentication

    Removed

    • search.go, search_test.go - Search functionality
    • models/search.go - Search response types
    • auth/ package - Token management (cache, persistence, manager)
    • cmd/ directory - Debug utilities
    • docs/ directory - Reference documentation
    • Authentication-related client options
    • Authentication-related error types

    Changed

    • Minimum Go version: 1.21 → 1.24
    • HTTP client: standard net/http → CycleTLS BrowserClient
    • Data source: Spotify GraphQL API → HTML page scraping
    • APIError simplified (no longer wraps errors)

    Fixed

    • Bot detection issues (TLS fingerprinting now mimics Chrome)

    📊 Dependencies

    github.com/Danny-Dasilva/CycleTLS/cycletls v1.0.30
    

    🙏 Acknowledgments

    Thanks to CycleTLS for making browser-like requests possible in Go.


    Full Changelog: https://github.com/FrostBreker/spotify-private-api/compare/v1.0.0...v2.0.0

    Full Changelog: https://github.com/FrostBreker/spotify-private-api/compare/v1.0.9...v2.0.0

    Downloads
  • v1.0.9 c627dfa118

    v1.0.9 Stable

    kerem released this 2024-04-08 19:45:16 +03:00 | 2 commits to main since this release

    📅 Originally published on GitHub: Mon, 08 Apr 2024 16:46:26 GMT
    🏷️ Git tag created: Mon, 08 Apr 2024 16:45:16 GMT

    Fix Search function to handle spaces.

    Full Changelog: https://github.com/FrostBreker/spotify-private-api/compare/v1.0.8...v1.0.9

    Downloads
  • v1.0.8 0d98fc2f02

    v1.0.8 Stable

    kerem released this 2023-12-10 21:06:24 +03:00 | 3 commits to main since this release

    📅 Originally published on GitHub: Sun, 10 Dec 2023 18:08:06 GMT
    🏷️ Git tag created: Sun, 10 Dec 2023 18:06:24 GMT

    Spotify Private API

    This package provides a simple way to interact with Spotify's private API. It includes methods to fetch track information and play count.

    Installation

    go get github.com/FrostBreker/spotify-private-api
    

    Usage

    import "github.com/FrostBreker/spotify-private-api"
    
    client := spotifyprivateapi.NewClient(spotifyprivateapi.Client{
    		Debug: true,
    })
    
    // Fetch track information
    track, err := client.FetchTrack("trackId")
    if err != nil {
        log.Fatal(err)
    }
    
    // Fetch track play count
    playCount, err := client.FetchTrackPlayCount("trackId")
    if err != nil {
        log.Fatal(err)
    }
    
    // Fetch artist information
    artist, err := client.FetchArtist("artistId")
    if err != nil {
        log.Fatal(err)
    }
    
    // Fetch album information
    album, err := client.FetchAlbum("albumId")
    if err != nil {
        log.Fatal(err)
    }
    
    // Search in spotify
    searchResults, err := client.Search("query")
    if err != nil {
        log.Fatal(err)
    }
    
    // Search for top results in spotify
    topTracks, err := client.SearchTopResult("query")
    if err != nil {
        log.Fatal(err)
    }
    

    Documentation

    FetchTrack(trackId string) (responseTypes.TrackResponse, error)

    FetchTrack sends a GET request to Spotify's private API to fetch information about a track. The trackId parameter is the Spotify ID of the track. It returns a TrackResponse object and an error.

    FetchTrackPlayCount(trackId string) (responseTypes.TrackPlayCount, error)

    FetchTrackPlayCount first calls FetchTrack to get the track information, then it extracts the play count from the response. The trackId parameter is the Spotify ID of the track. It returns a TrackPlayCount object and an error.

    FetchArtist(artistId string) (responseTypes.Artist, error)

    FetchArtist fetches information about an artist from Spotify's private API. It takes an artistId parameter, which is the Spotify ID of the artist. It returns an Artist object and an error.

    FetchAlbum(albumId string) (responseTypes.Album, error)

    FetchAlbum fetches information about an album from Spotify's private API. It takes an albumId parameter, which is the Spotify ID of the album. It returns an AlbumResponseType object and an error.

    Search(query string) (responseTypes.SearchResponseType, error)

    Search sends a GET request to Spotify's private API to search for tracks, albums, artists and playlists. It takes a query parameter, which is the search query. It returns a SearchResponseType object and an error.

    SearchTopResult(query string) (responseTypes.SearchTopResultResponseType, error)

    SearchTopResult first calls Search to get the search results, then it extracts the top results from the response. It takes a query parameter, which is the search query. It returns a SearchTopResultResponseType object and an error.

    Contributing

    Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

    License

    MIT

    Note: This package uses Spotify's private API and is not officially supported by Spotify. Use at your own risk.

    Full Changelog: https://github.com/FrostBreker/spotify-private-api/compare/v1.0.7...v1.0.8

    Downloads
  • v1.0.7 5901844447

    v1.0.7 Stable

    kerem released this 2023-12-10 00:59:42 +03:00 | 4 commits to main since this release

    📅 Originally published on GitHub: Sat, 09 Dec 2023 22:00:50 GMT
    🏷️ Git tag created: Sat, 09 Dec 2023 21:59:42 GMT

    Fix Debug

    Full Changelog: https://github.com/FrostBreker/spotify-private-api/compare/v1.0.5...v1.0.7

    Downloads
  • v1.0.4 1d6960a9bd

    v1.0.4 Stable

    kerem released this 2023-12-09 20:00:03 +03:00 | 6 commits to main since this release

    📅 Originally published on GitHub: Sat, 09 Dec 2023 17:02:04 GMT
    🏷️ Git tag created: Sat, 09 Dec 2023 17:00:03 GMT

    Update FecthArtist function return type

    Full Changelog: https://github.com/FrostBreker/spotify-private-api/compare/v1.0.3...v1.0.4

    Downloads
  • v1.0.3 3e9922319f

    v1.0.3 Stable

    kerem released this 2023-12-09 19:49:14 +03:00 | 7 commits to main since this release

    📅 Originally published on GitHub: Sat, 09 Dec 2023 16:51:50 GMT
    🏷️ Git tag created: Sat, 09 Dec 2023 16:49:14 GMT

    feat: Add FetchArtist and FetchAlbum functions

    • Added FetchArtist function to fetch information about an artist from Spotify's private API
    • Added FetchAlbum function to fetch information about an album from Spotify's private API
    • Updated documentation in the readme.md file to include the new functions

    Full Changelog: https://github.com/FrostBreker/spotify-private-api/compare/v1.0.2...v1.0.3

    Downloads
  • v1.0.2 f037f19109

    v1.0.2 Stable

    kerem released this 2023-12-03 21:15:40 +03:00 | 12 commits to main since this release

    📅 Originally published on GitHub: Sun, 03 Dec 2023 18:18:41 GMT
    🏷️ Git tag created: Sun, 03 Dec 2023 18:15:40 GMT

    Spotify Private API

    This package provides a simple way to interact with Spotify's private API. It includes methods to fetch track information and play count.

    Installation

    go get github.com/FrostBreker/spotify-private-api@v1.0.2
    

    Usage

    import "github.com/FrostBreker/spotify-private-api"
    
    client := spotifyprivateapi.NewClient(spotifyprivateapi.Client{
    		Debug: true,
    })
    
    // Fetch track information
    track, err := client.FetchTrack("trackId")
    if err != nil {
        log.Fatal(err)
    }
    
    // Fetch track play count
    playCount, err := client.FetchTrackPlayCount("trackId")
    if err != nil {
        log.Fatal(err)
    }
    

    Documentation

    FetchTrack(trackId string) (responseTypes.TrackResponse, error)

    FetchTrack sends a GET request to Spotify's private API to fetch information about a track. The trackId parameter is the Spotify ID of the track. It returns a TrackResponse object and an error.

    FetchTrackPlayCount(trackId string) (responseTypes.TrackPlayCount, error)

    FetchTrackPlayCount first calls FetchTrack to get the track information, then it extracts the play count from the response. The trackId parameter is the Spotify ID of the track. It returns a TrackPlayCount object and an error.

    Contributing

    Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

    License

    MIT

    Note: This package uses Spotify's private API and is not officially supported by Spotify. Use at your own risk.
    Full Changelog: https://github.com/FrostBreker/spotify-private-api/compare/v1.0.1...v1.0.2

    Downloads