Skip to content

Beatport: switch search to v4 catalog API (credit: @Simon-Zwa, upstream PR #523)#1

Merged
TX-RX merged 2 commits into
mainfrom
pr-523-beatport-v4-search
Jul 8, 2026
Merged

Beatport: switch search to v4 catalog API (credit: @Simon-Zwa, upstream PR #523)#1
TX-RX merged 2 commits into
mainfrom
pr-523-beatport-v4-search

Conversation

@TX-RX

@TX-RX TX-RX commented Jul 8, 2026

Copy link
Copy Markdown
Owner

Pulls in @Simon-Zwa's upstream PR Marekkon5#523 unchanged so the original commits (and attribution) are preserved.

Why

Beatport removed the + 'NEXT_DATA' + hydration script from + 'beatport.com/search/tracks' + , which is what OneTagger scrapes for search results. Every search errors out with cryptic JSON parse failures, and even when it does return HTML, Cloudflare is now aggressively challenging concurrent requests.

What this branch does

Replaces the HTML-scraping search implementation with a direct call to + 'api.beatport.com/v4/catalog/search/' + :

  • Uses the same embed OAuth flow the existing + 'track()' + / + 'release()' + functions already use.
  • Response is native JSON; + 'BeatportTrackResults.data' + is aliased via serde to the API's + 'tracks' + array.
  • Drops the + 'scraper' + dependency and the + 'get_next_data()' + / + 'NEXT_DATA' + parsing plumbing entirely.
  • Removes the now-unused + 'BeatportTrackResult' + / + 'BeatportTrackResultRelease' + / + 'BeatportArtist' + partial types — search results are now full + 'BeatportTrack' + objects (so we no longer have to call + 'track(id)' + in + 'extend_track' + to fill in the gaps).

Independent verification

Before pulling this in I hit + 'api.beatport.com/v4/catalog/search/?q=...&type=tracks' + directly against the embed-OAuth token and confirmed it returns full + 'BeatportTrack' + -shaped JSON with all fields the tagger consumes (BPM, key, catalog number, ISRC, release image URI, etc.). + 'api.beatport.com' + is not behind the Cloudflare challenge that + 'www.beatport.com' + is.

Notes

Simon-Zwa added 2 commits July 8, 2026 12:48
Beatport no longer exposes __NEXT_DATA__ on search pages, causing search failures.

Updated Beatport search to use the v4 catalog API endpoint instead of scraping the website.

Adjusted deserialization to support the new API response format (tracks array).
Added a note about a temporary Beatport fix for May 2026.
@TX-RX
TX-RX force-pushed the pr-523-beatport-v4-search branch from 63dfdfb to f96455c Compare July 8, 2026 17:49
@TX-RX
TX-RX merged commit 275cf16 into main Jul 8, 2026
7 of 8 checks passed
@TX-RX
TX-RX deleted the pr-523-beatport-v4-search branch July 8, 2026 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants