Links

File Scanning

get
https://api-v2.acrcloud.com
/api/fs-containers/:container_id/files
List the files and results
Curl
Python
curl --location --request GET 'https://api-v2.acrcloud.com/api/fs-containers/:your_container_id/files?page=1&per_page=20' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer YourAccessToken'
import requests
url = "https://api-v2.acrcloud.com/api/fs-containers/:your_container_id/files?page=1&per_page=20"
payload={}
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer token'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
post
https://api-v2.acrcloud.com
/api/fs-containers/:container_id/files
Upload a file or platforms web url
Curl (audio)
Curl (platforms)
Python
Python(platforms)
PHP
curl --location --request POST 'https://api-v2.acrcloud.com/api/fs-containers/10005/files' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer token' \
--form 'file=@"/Users/olym/Downloads/886443683402_US4D80623007.mp3"' \
--form 'data_type="audio"'
curl --location --request POST 'https://api-v2.acrcloud.com/api/fs-containers/10005/files' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer token' \
--header 'Content-Type: application/json' \
--data-raw '{"data_type":"platforms", "url":"https://twitter.com/i/status/1439937773885079552"}'
1
import requests
2
3
url = "https://api-v2.acrcloud.com/api/fs-containers/10005/files"
4
5
payload={'data_type': 'audio'}
6
files=[
7
('file',('886443683402_US4D80623007.mp3',open('886443683402_US4D80623007.mp3','rb'),'application/octet-stream'))
8
]
9
headers = {
10
'Accept': 'application/json',
11
'Authorization': 'Bearer token'
12
}
13
14
response = requests.request("POST", url, headers=headers, data=payload, files=files)
import requests
url = "https://api-v2.acrcloud.com/api/fs-containers/10005/files"
payload={
'data_type': 'platforms',
'url':'https://www.youtube.com/watch?v=d_xYl5hpiRs'
}
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer token',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, json=payload)
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api-v2.acrcloud.com/api/fs-containers/10005/files',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => array('file'=> new CURLFILE('886443683402_US4D80623007.lo'),'data_type' => 'fingerprint'),
CURLOPT_HTTPHEADER => array(
'Accept: application/json',
'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiI2IiwianRpIjoiZGMzNjIyOThhMDAyN2NmZDMzZGU3MjBhYThhY2I0MTgyMzJhN2I5ZTA4MzdjNTI0M2UxODIxYzcwMTA5NDIwZTg0ZGJhY2Q4YTRhZWM0YzAiLCJpYXQiOjE2MTg4MjA1NTAuMDA2OTYzLCJuYmYiOjE2MTg4MjA1NTAuMDA2OTY3LCJleHAiOjE2NTAzNTY1NDkuOTkwNTQxLCJzdWIiOiIxOSIsInNjb3BlcyI6WyIqIl19.G7L5T2fQljhK2D1za669Q3cIIbyBT0oE8Z_IWQyL0sofZvIOYymVqW55w6b_nX6emkJj7JfylAI7q7-CVxXUN4tRcJCv9-AxFprhQubKvy59_6B5jd38jsOGHdlmMN5x7Mt3xl9WUPd1ODFg6Vqp3tR3nQ9J9eqUjrZgu54Yyx-1_gekBx87GCvcJxfmiDTBmr8J4Ze5099W_Bsj5UHGUb1X-GhNxVzfTFranTsvSEFDEA5jrBvNGIRkvqMUCx4jK7sJstlnlvTUmJ6WK0owl946ULiJhPe5jlM2_CKDckw81Ri6ecV1zAOWncTWi1Oa5qUkpEVf6pBtzk4_OLLjWUZ3MRz7xO2BiFYTuWxaQKNL9W4RhWbsf'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
get
https://api-v2.acrcloud.com
/api/fs-containers/:container_id/files/:file_id
Show the one file or more files's results
Curl
Python
curl --location --request GET 'https://api-v2.acrcloud.com/api/fs-containers/:your_container_id/files/f60c40d8-f35e-488e-bca4-105d85b080dc' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer YourAccessToken'
import requests
url = "https://api-v2.acrcloud.com/api/fs-containers/:your_container_id/files/f60c40d8-f35e-488e-bca4-105d85b080dc"
payload={}
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer token'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
delete
https://api-v2.acrcloud.com
/api/fs-containers/:container_id/files/:ids
Delete the files
put
https://api-v2.acrcloud.com
/api/fs-containers/:container_id/files/:file_id/rescan
Rescan the files
Curl
Python
1
curl --location --request PUT 'https://api-v2.acrcloud.com/api/fs-containers/10005/files/fd0cbc13-bb69-41ed-abbb-1ed6f25c3b02/rescan' \
2
--header 'Accept: application/json' \
3
--header 'Authorization: Bearer token'
1
import requests
2
3
url = "https://api-v2.acrcloud.com/api/fs-containers/10005/files/fd0cbc13-bb69-41ed-abbb-1ed6f25c3b02/rescan"
4
5
headers = {
6
'Accept': 'application/json',
7
'Authorization': 'Bearer token'
8
}
9
10
response = requests.request("PUT", url, headers=headers)
post
https://callback-url.com
/path
Post result and state with json format to callback url
import requests
post_data = {
'file_id':"c7331194-ccbe-4c3f-8e82-40d7b8358993",
'state':1,
'cid':1000,
'results': {
"music":[
{
"played_duration":164,
"type":"traverse",
"result":{
"album":{
"name":"Indie Brit Romance"
},
"play_offset_ms":10000,
"sample_begin_time_offset_ms":0,
"title":"Broken Skies 3",
"result_from":1,
"release_date":"2016-06-28",
"sample_end_time_offset_ms":9280,
"genres":[
{
"name":"Indie"
},
{
"name":"Singer"
},
{
"name":"Songwriter"
}
],
"label":"Audio Network",
"duration_ms":167000,
"score":100,
"db_begin_time_offset_ms":0,
"artists":[
{
"name":"Bob Bradley"
},
{
"name":"Matt Parker"
}
],
"db_end_time_offset_ms":9280,
"external_ids":{
"isrc":"GBFFM1621637"
},
"acrid":"e8b02eab3fd1d2745f460fb608b7b5c1",
"external_metadata":[
]
},
"offset":0
}]
}
r = requests.post(callback_url, json=post_data, timeout=3)
post
https://api-v2.acrcloud.com
/api/fs-containers
Create a FS container
Python
import requests
url = "https://api-v2.acrcloud.com/api/fs-containers"
payload={
"name":"test",
"region":"eu-west-1",
"buckets":[8881,8882,"ACRCloud Music"],
"audio_type":"linein",
"engine":1,
"policy":{"type":"traverse", "interval":0, "rec_length":10}
}
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer token',
'Content-Type': 'application/json'
}
response = requests.post(url, headers=headers, json=payload)
print(response.text)
get
https://api-v2.acrcloud.com
/api/fs-containers
Get all the containers
get
https://api-v2.acrcloud.com
/api/fs-containers/:container_id
Show one container