curl -X POST https://api.infinipost.co/v1/media/sounds \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"soundUrl": "https://www.tiktok.com/@username/video/7123456789012345678",
"name": "Viral Beat 2024"
}'
const response = await fetch('https://api.infinipost.co/v1/media/sounds', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
soundUrl: 'https://www.tiktok.com/@username/video/7123456789012345678',
name: 'Viral Beat 2024'
})
});
const data = await response.json();
import requests
response = requests.post(
'https://api.infinipost.co/v1/media/sounds',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
json={
'soundUrl': 'https://www.tiktok.com/@username/video/7123456789012345678',
'name': 'Viral Beat 2024'
}
)
print(response.json())
{
"soundId": "sound_abc123",
"name": "Viral Beat 2024",
"url": "https://storage.googleapis.com/.../audio.mp3",
"duration": 45.2,
"createdAt": "2024-04-21T20:30:00Z"
}
Media
Upload Sound
Upload an audio file to use in posts
POST
/
v1
/
media
/
sounds
curl -X POST https://api.infinipost.co/v1/media/sounds \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"soundUrl": "https://www.tiktok.com/@username/video/7123456789012345678",
"name": "Viral Beat 2024"
}'
const response = await fetch('https://api.infinipost.co/v1/media/sounds', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
soundUrl: 'https://www.tiktok.com/@username/video/7123456789012345678',
name: 'Viral Beat 2024'
})
});
const data = await response.json();
import requests
response = requests.post(
'https://api.infinipost.co/v1/media/sounds',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
json={
'soundUrl': 'https://www.tiktok.com/@username/video/7123456789012345678',
'name': 'Viral Beat 2024'
}
)
print(response.json())
{
"soundId": "sound_abc123",
"name": "Viral Beat 2024",
"url": "https://storage.googleapis.com/.../audio.mp3",
"duration": 45.2,
"createdAt": "2024-04-21T20:30:00Z"
}
Request Body
string
required
TikTok video URL containing the sound you want to extract.How to get the URL:
- Open TikTok on your computer at https://www.tiktok.com/
- Find the video whose music you want to use
- Right-click and select “Copy link”
- Paste the entire URL below
string
Custom name for the sound (optional). If not provided, the sound name from TikTok will be used.
Response
string
Unique identifier for the uploaded sound.
string
Name of the sound.
string
Storage URL of the uploaded sound file.
number
Duration of the audio in seconds.
string
ISO 8601 timestamp of when the sound was uploaded.
curl -X POST https://api.infinipost.co/v1/media/sounds \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"soundUrl": "https://www.tiktok.com/@username/video/7123456789012345678",
"name": "Viral Beat 2024"
}'
const response = await fetch('https://api.infinipost.co/v1/media/sounds', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
soundUrl: 'https://www.tiktok.com/@username/video/7123456789012345678',
name: 'Viral Beat 2024'
})
});
const data = await response.json();
import requests
response = requests.post(
'https://api.infinipost.co/v1/media/sounds',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
json={
'soundUrl': 'https://www.tiktok.com/@username/video/7123456789012345678',
'name': 'Viral Beat 2024'
}
)
print(response.json())
{
"soundId": "sound_abc123",
"name": "Viral Beat 2024",
"url": "https://storage.googleapis.com/.../audio.mp3",
"duration": 45.2,
"createdAt": "2024-04-21T20:30:00Z"
}
Using Sounds in PostsAfter uploading, use the returned
soundId in the soundUrl field when creating video or slideshow posts. The sound will be automatically applied to your TikTok posts.Error Responses
Invalid TikTok URL
{
"error": {
"code": "invalid_url",
"message": "Invalid TikTok video URL. Please provide a valid TikTok video URL."
}
}
Sound Extraction Failed
{
"error": {
"code": "extraction_failed",
"message": "Unable to extract sound from the TikTok video. The video may be unavailable or restricted."
}
}