const images = await listAssets({ contentType: 'image/png' });// Or filter for any image type in your applicationconst allImages = (await listAssets()).assets.filter( asset => asset.content_type.startsWith('image/'));
Get all videos
Copy
videos = list_assets(content_type='video/mp4')# Or filter for any video typeall_assets = list_assets()all_videos = [ asset for asset in all_assets['assets'] if asset['content_type'].startswith('video/')]
from datetime import datetime, timedeltaassets = list_assets(limit=100)one_hour_ago = datetime.now() - timedelta(hours=1)recent = [ asset for asset in assets['assets'] if datetime.fromisoformat(asset['created_at'].replace('Z', '+00:00')) > one_hour_ago]print(f'Found {len(recent)} assets uploaded in the last hour')