ACRCloud
Ask or search…
K
Links

Channels Results

get
https://api-v2.acrcloud.com
/api/bm-bd-projects/:pid/channels/:channel_id/results
Get non-real-time results of channel monitoring
Parameters
Path
pid
number
The project id
channel_id
number
The channel id
Query
type
string
last: get the last result day: get the day result Default is day.
date
string
get the results for a certain day you specified. The format is YYYYmmdd (E.g. 20210201)
min_duration
number
Only return the results of played_duration greater than or equal to min_duration seconds (default: 0)
max_duration
number
Only return the results of played_duration less than or equal to max_duration seconds (default: 3600)
isrc_country
string
Only return results that match the isrc country code (E.g. DE, FR, IT, US)
with_false_positive
number
0: does not return results marked as false positive. (Default)
1: returns results marked false positive.
Header
Authorization
string
Bearer token
Accept
string
application/json
Responses
200
Cake successfully retrieved.
404
Could not find a cake matching this query.
Curl #day
Curl #last
curl --location --request GET 'https://api-v2.acrcloud.com/api/bm-bd-projects/179/channels/100251/results?type=day&date=20210201' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer token'
curl --location --request GET 'https://api-v2.acrcloud.com/api/bm-bd-projects/179/channels/100251/results?type=last' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {your token}'
get
https://api-v2.acrcloud.com
/api/bm-bd-projects/:pid/channels/:channel_id/realtime_results
Get real-time results of channel monitoring
Parameters
Path
pid
number
The project id
channel_id
number
The channel id
Header
Authorization
string
Bearer token
Accept
string
application/json
Responses
200
Curl
curl --location --request GET 'https://api-v2.acrcloud.com/api/bm-bd-projects/179/channels/100251/realtime-results' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {your token}'

The following is a sample script that displays the results in real-time

<?php
$project_id = "{project_id}";
$channel_id = "{channel_id}";
$token = "{bearer token}"; // https://docs.acrcloud.com/reference/console-api/accesstoken
$opts = [
"http" => [
"method" => "GET",
"header" => "Accept: application/json\r\n" .
"Authorization: Bearer " . $token . "\r\n"
]
];
$context = stream_context_create($opts);
$data = file_get_contents("https://api-v2.acrcloud.com/api/bm-bd-projects/" . $project_id . "/channels/" . $channel_id . "/realtime_results", false, $context);
$obj = json_decode($data, true);
# var_dump($obj);
$title = "";
$artists = "";
$metadata = $obj['data']['metadata'];
if (array_key_exists('music', $metadata)) {
$music = $metadata['music'][0];
$title = $music['title'];
$arlist = [];
if (array_key_exists('artists', $music)) {
foreach($music['artists'] as $ar) {
$arlist[] = $ar['name'];
}
}
if (count($arlist) > 0) {
$artists = implode(', ', $arlist);
}
}
$ret = ['title'=>$title, 'artists'=>$artists, 'result'=>$obj];
print_r(json_encode($ret));
?>
get
https://api-v2.acrcloud.com
/api/bm-bd-projects/:pid/channels/:channel_id/unknown_results
Getting results not recognized but detected as music. (Note: This API is only available for channels with music detection enabled)
Parameters
Path
pid*
Number
The project id
channel_id*
Number
channel_id
Query
date*
String
Get all the results on this date. The format is YYYYmmdd (E.g. 20210201)
min_duration
Number
Only return the results of played_duration greater than or equal to min_duration seconds (default: 0)
max_duration
Number
Only return the results of played_duration less than or equal to max_duration seconds (default: 3600)
Header
Authorization*
String
Bearer token
Accept*
String
application/json
Responses
200: OK
Curl
curl --location 'https://api-v2.acrcloud.com/api/bm-bd-projects/1234/channels/200232/unknown_results?date=20231101' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer token'
Last modified 2mo ago