I’ve been working with music track searches and noticed something interesting. When I search directly in the Spotify mobile app, it seems to have built-in spell correction features. For instance, if I type ‘seaman rammstein’ in the app, it finds the track ‘Seemann’ by Rammstein perfectly.
However, when I use the same search query through the Spotify Web API search endpoint, I get zero results. The API doesn’t seem to handle typos or spelling mistakes the way the native app does.
Has anyone figured out how to make API searches work more like the in-app search? Are there specific parameters or different endpoints that enable spell checking? I’m curious about what makes the app search so much more forgiving with user input errors.
yeah, i feel ya! i had this issue too. fuzzy matching is a lifesaver here. n try throwin in more keywords - might not be spot on but it does make things easier!
The mobile app’s search is much more advanced compared to the Web API’s approach. From my experience in developing music applications, the API tends to be quite literal, lacking the fuzzy matching capabilities of the app. A useful strategy is to introduce a preprocessing step before you make API calls. Consider correcting common misspellings and varying spelling formats, or implement algorithms like Levenshtein distance to create alternative query variations. Additionally, you might want to separate your searches by artist and track, then merge the results. The API does allow for wildcards with asterisks, but their functionality is somewhat limited. Unfortunately, there isn’t a specific parameter for spell correction, so that must be managed on your end.