Code Examples
Safe, approved integration examples for common use cases
Search Tracks by Genre
Find tracks in the catalog using genre filters
curl "https://api.cambrianmusic.com/api/v1/tracks?genre=Electronic&limit=10" \
-H "X-API-Key: cbr_your_key_here"Get Track Details
Retrieve full metadata and pricing for a specific track
curl "https://api.cambrianmusic.com/api/v1/tracks/trk_abc123" \
-H "X-API-Key: cbr_your_key_here"Verify a License
Confirm a license is valid after purchase (no API key required)
curl "https://api.cambrianmusic.com/api/v1/licenses/lic_xyz789/verify"Error Handling Best Practices
- •Always check response status: 2xx = success, 4xx = client error, 5xx = server error
- •Handle rate limits: Check
X-RateLimit-Remainingheader - •Never expose API keys: Keep keys in environment variables, never in client-side code
- •Implement retries: Retry on 429 (rate limit) and 5xx errors with exponential backoff
Need help or have questions about these examples?
Contact our developer support →