Endpoint
POST https://api.ugc.inc/media
Overview
Retrieve all media for your organization, including both user-uploaded files and social audio. Supports filtering by specific IDs or tags.Request Body
Filter to specific media IDs. Returns only media matching these IDs.
Filter media by tag
Response
Array of media objects (both UserMedia and SocialAudio)
Show UserMedia properties
Show UserMedia properties
Show SocialAudio properties
Show SocialAudio properties
Unique audio identifier
Organization ID
Audio/song title
Custom tag for categorization
Link to a TikTok post using this audio
Direct link to the TikTok audio/music page
Source platform
URL to cover image
URL to audio file
ISO timestamp of creation
Discriminator field
curl -X POST https://api.ugc.inc/media \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"tag": "products"
}'
import requests
response = requests.post(
'https://api.ugc.inc/media',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
json={
'tag': 'products'
}
)
data = response.json()
if data['ok']:
for media in data['data']:
if media['media_type'] == 'user_media':
print(f"File: {media['name']} - {media['url']}")
else:
print(f"Audio: {media['name']} - {media['audio_url']}")
const response = await fetch('https://api.ugc.inc/media', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
tag: 'products'
})
});
const data = await response.json();
if (data.ok) {
data.data.forEach(media => {
if (media.media_type === 'user_media') {
console.log(`File: ${media.name} - ${media.url}`);
} else {
console.log(`Audio: ${media.name} - ${media.audio_url}`);
}
});
}
import { UGCClient } from 'ugcinc';
const client = new UGCClient({
apiKey: 'YOUR_API_KEY'
});
// Get all media
const response = await client.media.getMedia();
// Get media by specific IDs
const byIds = await client.media.getMedia({
ids: ['media_abc123', 'audio_def456']
});
// Get media by tag
const byTag = await client.media.getMedia({
tag: 'products'
});
if (response.ok) {
response.data.forEach(media => {
console.log(`${media.name} (${media.media_type})`);
});
}
{
"ok": true,
"code": 200,
"data": [
{
"id": "media_abc123",
"org_id": "org_xyz789",
"name": "product-video.mp4",
"tag": "products",
"type": "video",
"url": "https://api.ugc.inc/media/file/media_abc123",
"created_at": "2024-01-15T10:30:00.000Z",
"media_type": "user_media"
},
{
"id": "audio_def456",
"org_id": "org_xyz789",
"name": "Trending Sound",
"tag": "products",
"social_post_link": "https://www.tiktok.com/@user/video/123",
"social_audio_link": "https://www.tiktok.com/music/Trending-Sound-123",
"platform_type": "tiktok",
"preview_url": "https://api.ugc.inc/media/file/audio_def456/preview",
"audio_url": "https://api.ugc.inc/media/file/audio_def456/audio",
"created_at": "2024-01-14T09:00:00.000Z",
"media_type": "social_audio",
"type": "social_audio"
}
]
}
