Obtain a valid access token using the Client Credentials flow (suitable for server-side, non-user-specific searches) by POSTing to the token endpoint with your client credentials.
Send a GET request to the search endpoint with q (your search query), type=track, and optional parameters such as market, limit, and offset.
Include the access token in the Authorization header as a Bearer token.
Parse the tracks.items array in the response; each item contains the track name, artists array, album, and id.
Use the href or next fields in the response to paginate through additional results if needed.
Known gotchas
Client Credentials tokens do not grant access to user-specific data; use the Authorization Code flow if you need user library or playback information.
The market parameter filters results by country availability; omitting it may return tracks not available in your target region.
Access tokens expire; implement token refresh logic rather than re-authenticating from scratch on every request.
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp