A command-line interface for managing ACRCloud resources via the Console API.
- Bucket Management: Create, list, update, and delete buckets
- File Operations: Upload, download, update, and delete audio files and fingerprints
- Channel Management: Manage live streaming channels
- Project Management: Create and manage recognition projects
- File Scanning: Scan audio files for music, cover songs, speech recognition
- BM Projects: Broadcast Monitoring custom streams projects and streams
- Flexible Output: JSON or table output formats
- Configuration Management: Store settings in config files
git clone https://github.com/acrcloud/acrcloud-cli.git
cd acrcloud-cli
pip install -e .pip install acrcloud-cli- Log in to ACRCloud Console
- Go to Account → Developer Settings
- Create a new access token
# Set your access token
acrcloud config set access_token YOUR_ACCESS_TOKEN
# Verify configuration
acrcloud config listOr use environment variable:
export ACRCLOUD_ACCESS_TOKEN=YOUR_ACCESS_TOKEN# List all buckets
acrcloud buckets list
# Create a new bucket
acrcloud buckets create --name my-bucket --type File --region eu-west-1
# Upload an audio file
acrcloud buckets files upload --bucket-id 12345 --file audio.mp3
# List projects
acrcloud projects list# Set a configuration value
acrcloud config set access_token YOUR_TOKEN
acrcloud config set base_url https://api-v2.acrcloud.com/api
# Get a configuration value
acrcloud config get access_token
# List all configurations
acrcloud config list
# Delete a configuration
acrcloud config delete access_token# List buckets
acrcloud buckets list
acrcloud buckets list --region eu-west-1 --type File
# Get bucket details
acrcloud buckets get 12345
# Create a bucket
acrcloud buckets create --name my-bucket --type File --region eu-west-1
acrcloud buckets create -n music -t File -r ap-southeast-1 -l "Music,Audio"
# Update a bucket
acrcloud buckets update 12345 --name new-name
acrcloud buckets update 12345 -l "Music,Pop,Rock"
# Delete a bucket
acrcloud buckets delete 12345
acrcloud buckets delete 12345 --yesBucket Types:
File: For audio file recognitionLive: For live stream monitoringLiveRec: For live stream recordingLiveTimeshift: For timeshift stream monitoring
Regions:
eu-west-1: Europe (Ireland)us-west-2: US West (Oregon)ap-southeast-1: Asia Pacific (Singapore)
# List files in a bucket
acrcloud buckets files list --bucket-id 12345
acrcloud buckets files list -b 12345 --keyword "song"
# Get file details
acrcloud buckets files get 67890 --bucket-id 12345
# Upload audio file
acrcloud buckets files upload --bucket-id 12345 --file audio.mp3
acrcloud buckets files upload -b 12345 -f audio.mp3 --title "My Song"
# Upload fingerprint
acrcloud buckets files upload -b 12345 -f fingerprint.fp -t fingerprint
# Upload via URL
acrcloud buckets files upload -b 12345 -u https://example.com/audio.mp3 -t audio_url
# Upload by ACRID
acrcloud buckets files upload -b 12345 -a "ACRID123" -t acrid
# Update file
acrcloud buckets files update 67890 --bucket-id 12345 --title "New Title"
# Delete file
acrcloud buckets files delete 67890 --bucket-id 12345
# Delete multiple files
acrcloud buckets files delete-batch --bucket-id 12345 --file-ids "1,2,3"
# Move files to another bucket
acrcloud buckets files move --bucket-id 12345 --target-bucket-id 67890 --file-ids "1,2,3"
# Dump all files (once per day)
acrcloud buckets files dump --bucket-id 12345# List channels
acrcloud buckets channels list --bucket-id 12345
# Get channel details
acrcloud buckets channels get 67890 --bucket-id 12345
# Create channel
acrcloud buckets channels create --bucket-id 12345 --name "Radio One" --url "http://stream.example.com/radio"
acrcloud buckets channels create -b 12345 -n "TV Channel" -u "http://tv.example.com/stream" -r 24 -t 72
# Update channel
acrcloud buckets channels update 67890 --bucket-id 12345 --name "New Name"
# Delete channel
acrcloud buckets channels delete 67890 --bucket-id 12345# List projects
acrcloud projects list
# Get project details
acrcloud projects get 12345
# Create project
acrcloud projects create --name my-project --type AVR --region eu-west-1 --buckets "1,2,3"
acrcloud projects create -n music-detection -t AVR -r ap-southeast-1 -b "12345"
# Update project
acrcloud projects update 12345 --name new-name
acrcloud projects update 12345 -b "1,2,3,4"
# Delete project
acrcloud projects delete 12345
# Get bucket status
acrcloud projects bucket-status 12345
# Get statistics
acrcloud projects statistics 12345
acrcloud projects statistics 12345 --start-date 2024-01-01 --end-date 2024-12-31Project Types:
AVR: Audio/Video Recognition - for detecting music or custom contentLCD: Live Channel Detection - for detecting live channels and time-shifting channelsHR: Hybrid Recognition - for detecting both live channels and custom content
# List file scanning containers
acrcloud filescan list-containers
acrcloud filescan list-containers --region eu-west-1
# Get container details
acrcloud filescan get-container 12345
# Create a container
acrcloud filescan create-container --name my-container --region eu-west-1 \\
--buckets "[12345,67890]" --engine 1 --policy-type traverse
# Update a container
acrcloud filescan update-container 12345 --name new-name
# Delete a container
acrcloud filescan delete-container 12345
# List files in a container
acrcloud filescan list-files --container-id 12345 --region eu-west-1
# Upload a file for scanning
acrcloud filescan upload --container-id 12345 --region eu-west-1 --file audio.mp3
acrcloud filescan upload -c 12345 -r eu-west-1 -u https://example.com/audio.mp3 -t audio_url
# Get file results
acrcloud filescan get-file FILE_ID --container-id 12345 --region eu-west-1
# Delete files
acrcloud filescan delete-files --container-id 12345 --region eu-west-1 --file-ids "id1,id2"
# Rescan files
acrcloud filescan rescan --container-id 12345 --region eu-west-1 --file-ids "id1,id2"Engines:
1: Audio Fingerprinting2: Cover Songs3: Audio Fingerprinting & Cover songs4: Speech to Text
# List BM custom streams projects
acrcloud bm-cs-projects list
acrcloud bm-cs-projects list --region eu-west-1
# Get project details
acrcloud bm-cs-projects get 12345
# Create a BM project
acrcloud bm-cs-projects create --name my-bm-project --region eu-west-1 --buckets "12345,67890"
# Update a BM project
acrcloud bm-cs-projects update 12345 --name new-name
# Delete a BM project
acrcloud bm-cs-projects delete 12345
# Set result callback URL
acrcloud bm-cs-projects set-callback 12345 --url https://callback.example.com/results
# List streams in a project
acrcloud bm-cs-projects list-streams 12345
acrcloud bm-cs-projects list-streams 12345 --state Running
# Add a stream
acrcloud bm-cs-projects add-stream 12345 --name "Radio One" \\
--url "http://stream.example.com" --config-id 1
# Update a stream
acrcloud bm-cs-projects update-stream 12345 s-ABC123 --name "New Name"
# Delete streams
acrcloud bm-cs-projects delete-streams 12345 --stream-ids "s-ABC123,s-DEF456"
# Pause streams
acrcloud bm-cs-projects pause-streams 12345 --stream-ids "s-ABC123,s-DEF456"
# Restart streams
acrcloud bm-cs-projects restart-streams 12345 --stream-ids "s-ABC123,s-DEF456"
# Stream state
acrcloud bm-cs-projects stream-state 12345 s-ABC123
# Stream results
acrcloud bm-cs-projects stream-results 12345 s-ABC123 --date 20210201
# Analytics
acrcloud bm-cs-projects analytics 12345 --stats-type date --result-type music
# Stream recording
acrcloud bm-cs-projects stream-recording 12345 s-ABC123 -t 20210607000210 -d 30Project Types:
BM-ACRC: Server-side audio ingestionBM-LOCAL: Local monitoring tool audio ingestion
Manage Broadcast Monitoring Database projects, channels, results, user reports, and analytics.
# List BM database projects
acrcloud bm-db-projects list
acrcloud bm-db-projects list -r eu-west-1
# Create a project
acrcloud bm-db-projects create --name my-db-project --region eu-west-1 --buckets "14661"
# Add channels
acrcloud bm-db-projects add-channels 12345 --channels "238766"
# List channels
acrcloud bm-db-projects list-channels 12345
# Channel results
acrcloud bm-db-projects channel-results 12345 238766 -d 20210201
# Real-time results
acrcloud bm-db-projects realtime-results 12345 238766Manage User Custom Content (UCF) projects, importing BM streams, and querying results.
# List UCF projects
acrcloud ucf-projects list
# Create a project
acrcloud ucf-projects create --name my-ucf-project --region eu-west-1 --type BM
# Import BM streams
acrcloud ucf-projects import-streams 12345 --bm-stream-ids "191149,198144" --origin-from BM-DATABASE --bm-project-id 871
# List streams
acrcloud ucf-projects list-streams 12345
# List results
acrcloud ucf-projects list-results 12345
# Get UCF record URL
acrcloud ucf-projects record-url 12345 340335# Use custom config file
acrcloud --config /path/to/config.json buckets list
# Specify access token directly
acrcloud --access-token YOUR_TOKEN buckets list
# Enable verbose output
acrcloud -v buckets list
# Show version
acrcloud --version
# Show help
acrcloud --help
acrcloud buckets --help
acrcloud buckets list --help# Table format (default)
acrcloud buckets list
# JSON format
acrcloud buckets list --output json
acrcloud buckets get 12345 -o json| Variable | Description |
|---|---|
ACRCLOUD_ACCESS_TOKEN |
Your ACRCloud access token |
Default location: ~/.acrcloud/config.json
Example:
{
"access_token": "your_access_token_here",
"base_url": "https://api-v2.acrcloud.com/api"
}For more details about the API, visit:
MIT License
Contributions are welcome! Please feel free to submit a Pull Request.
For support, please contact:
- Email: support@acrcloud.com
- Website: https://www.acrcloud.com