POST /download-track
curl --request POST \
--url https://api.trackyard.com/api/external/v1/download-trackimport requests
url = "https://api.trackyard.com/api/external/v1/download-track"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.trackyard.com/api/external/v1/download-track', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.trackyard.com/api/external/v1/download-track",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.trackyard.com/api/external/v1/download-track"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.trackyard.com/api/external/v1/download-track")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trackyard.com/api/external/v1/download-track")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyAPI Reference
POST /download-track
Download full tracks or smart-trimmed clips with automatic hit point alignment
POST
/
api
/
external
/
v1
/
download-track
POST /download-track
curl --request POST \
--url https://api.trackyard.com/api/external/v1/download-trackimport requests
url = "https://api.trackyard.com/api/external/v1/download-track"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.trackyard.com/api/external/v1/download-track', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.trackyard.com/api/external/v1/download-track",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.trackyard.com/api/external/v1/download-track"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.trackyard.com/api/external/v1/download-track")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trackyard.com/api/external/v1/download-track")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyDownload 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:
Authorization: Bearer your_api_key_here
Request Body
string
required
The track ID from search results.Example:
"trk_abc123"number
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)
number
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
curl -X POST https://api.trackyard.com/api/external/v1/download-track \
-H "Authorization: Bearer $TRACKYARD_API_KEY" \
-H "Content-Type: application/json" \
-d '{"track_id": "trk_abc123"}' \
--output track.mp3
Download 30-Second Clip (Best Segment Auto-Selected)
curl -X POST https://api.trackyard.com/api/external/v1/download-track \
-H "Authorization: Bearer $TRACKYARD_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"track_id": "trk_abc123",
"duration_seconds": 30
}' \
--output clip-30s.mp3
Download 22-Second Clip with Hit Point at 12 Seconds
curl -X POST https://api.trackyard.com/api/external/v1/download-track \
-H "Authorization: Bearer $TRACKYARD_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"track_id": "trk_abc123",
"duration_seconds": 22,
"hit_point_seconds": 12
}' \
--output clip-with-hit.mp3
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
Content-Type: audio/mpeg
Content-Disposition: attachment; filename="Digital_Sunrise.mp3"
Content-Length: 3428760
X-Track-Id: trk_abc123
X-Track-Duration: 142
X-Credits-Remaining: 486
X-RateLimit-Remaining: 7
How Smart Trimming Works
When you specifyduration_seconds, Trackyard:
1
Analyzes the waveform
Scans the entire track for musical phrases, energy peaks, beat alignment, and tonal consistency.
2
Scores possible segments
Every potential clip is scored based on musical coherence, energy distribution, and start/end quality.
3
Selects the best segment
Returns the highest-scoring segment as a clean MP3 with no fade-outs or awkward cuts.
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
❌ Long-form content — Podcasts, full episodes, feature films❌ Custom edits — When you need frame-perfect control❌ Looping backgrounds — Use full track for seamless loops
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.
{
"track_id": "trk_xyz789",
"duration_seconds": 15,
"hit_point_seconds": 8
}
Logo Drop
Logo Drop
Scenario: 30-second YouTube ad, logo reveals at 22 secondsRequest:Result: Musical peak aligns with the logo for maximum impact.
{
"track_id": "trk_def456",
"duration_seconds": 30,
"hit_point_seconds": 22
}
Title Card
Title Card
Scenario: 45-second app trailer, title card at 35 secondsRequest:Result: Music builds throughout, peaks at the title card.
{
"track_id": "trk_ghi123",
"duration_seconds": 45,
"hit_point_seconds": 35
}
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
Missing or invalid API key.
{
"error": "Unauthorized",
"message": "Invalid API key"
}
Out of credits.
{
"error": "Out of credits",
"message": "Please top up or upgrade your plan"
}
Track ID doesn’t exist.
{
"error": "Not Found",
"message": "Track not found"
}
Invalid parameters (e.g.,
hit_point_seconds without duration_seconds).{
"error": "Bad Request",
"message": "hit_point_seconds requires duration_seconds",
"code": "invalid_parameters"
}
Tips for Best Results
Preview first: Use the
preview_url from search results to audition tracks before downloadingChoose tracks with clear peaks: Electronic drops, orchestral crescendos, and hip hop hits work best for hit point alignment
Test different durations: If a 30-second clip doesn’t sound right, try 28 or 32 seconds for better segment selection
Align hit points to visual moments: Product reveals, logo drops, title cards, scene transitions
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