POST /download-track
API Reference
POST /download-track
Download full tracks or smart-trimmed clips with automatic hit point alignment
POST
POST /download-track
Download a licensed track as an MP3 file. Optionally request a smart-trimmed clip with automatic segment selection and hit point alignment.
Cost: 1 credit per request
License: Perpetual sync license included automatically. No additional step required.
What happens: The music’s biggest drop/hit/crescendo lands at exactly 12 seconds, perfect for syncing to a product reveal or logo drop.
See How Trackyard Works for full licensing details.
See Error Codes for full reference.
Authentication
All requests require a valid API key in theAuthorization header:
Request Body
The track ID from search results.Example:
"trk_abc123"Clip length in seconds. Omit this field to download the full track.When specified, Trackyard analyzes the waveform and selects the best-sounding segment automatically.Range: 10-300 seconds
Recommended minimum: 10 seconds (shorter clips may lack musical coherence)
Offset (in seconds) where the musical peak should land. Requires
duration_seconds.The algorithm finds the dominant energy peak in the track and aligns it to this offset.Use case: Sync the music’s climax to a specific moment in your video (product reveal, logo drop, title card).Range: Must be less than duration_seconds
Precision: ±1 secondExample Requests
Download Full Track
Download 30-Second Clip (Best Segment Auto-Selected)
Download 22-Second Clip with Hit Point at 12 Seconds
Response
Content-Type:audio/mpeg
Content-Disposition: attachment; filename="track-title.mp3"
The response body is the raw MP3 audio file. No JSON wrapper.
Response Headers
How Smart Trimming Works
When you specifyduration_seconds, Trackyard:
Analyzes the waveform
Scans the entire track for musical phrases, energy peaks, beat alignment, and tonal consistency.
Scores possible segments
Every potential clip is scored based on musical coherence, energy distribution, and start/end quality.
When to Use Smart Trimming
- Perfect For
- Skip It
✅ Short-form content — Instagram Reels, TikToks, YouTube Shorts✅ Ads — Social media ads, pre-roll, mid-roll✅ Product demos — SaaS walkthroughs, unboxing videos✅ Trailers — App, game, or film trailers✅ Batch processing — Auto-scoring 100+ videos at scale
Hit Point Alignment
Thehit_point_seconds parameter choreographs the music’s peak to a specific moment in your video.
Use Cases
Product Reveal
Product Reveal
Scenario: 15-second Instagram Reel, product appears at 8 secondsRequest:Result: Music peaks right when the product enters the frame.
Logo Drop
Logo Drop
Scenario: 30-second YouTube ad, logo reveals at 22 secondsRequest:Result: Musical peak aligns with the logo for maximum impact.
Title Card
Title Card
Scenario: 45-second app trailer, title card at 35 secondsRequest:Result: Music builds throughout, peaks at the title card.
What’s Included in the License
Every download includes a perpetual sync license automatically:Perpetual License Rights
- ✅ No expiration — Use the track forever
- ✅ No renewals — One-time payment, no recurring fees
- ✅ Multi-platform — Social media, YouTube, podcasts, websites
- ✅ Worldwide — No geographic restrictions
- ✅ Unlimited views — No caps on impressions or plays
- ❌ Broadcast (TV/film) — requires upgraded license tier
- ❌ Audio resale — can’t redistribute as standalone audio
- ❌ Sync to offensive/illegal content
Error Responses
401 Unauthorized
Missing or invalid API key.
402 Payment Required
Out of credits.
404 Not Found
Track ID doesn’t exist.
400 Bad Request
Invalid parameters (e.g.,
hit_point_seconds without duration_seconds).Tips for Best Results
Next Steps
Smart Clip Trimming
Learn how automatic segment selection works
Search API
Find tracks to download
Use Cases
See hit point alignment in action
Code Examples
Python and JavaScript examples