Skip to main content

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

ids
string[]
Filter to specific media IDs. Returns only media matching these IDs.
tag
string
Filter media by tag

Response

data
Media[]
Array of media objects (both UserMedia and SocialAudio)
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"
    }
  ]
}