> For the complete documentation index, see [llms.txt](https://docs.acrcloud.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.acrcloud.com/reference/console-api/bm-projects/broadcast-database-projects/channels-results.md).

# Channels Results

## Get non-real-time results of channel monitoring

<mark style="color:blue;">`GET`</mark> `https://api-v2.acrcloud.com/api/bm-bd-projects/:pid/channels/:channel_id/results`

#### Path Parameters

| Name        | Type   | Description    |
| ----------- | ------ | -------------- |
| pid         | number | The project id |
| channel\_id | number | The channel id |

#### Query Parameters

| Name                  | Type   | Description                                                                                                           |
| --------------------- | ------ | --------------------------------------------------------------------------------------------------------------------- |
| type                  | string | <p>last: get the last result<br>day: get the day result<br>Default is day.</p>                                        |
| 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 | <p>0: does not return results marked as false positive. (Default)</p><p>1: returns results marked false positive.</p> |

#### Headers

| Name          | Type   | Description      |
| ------------- | ------ | ---------------- |
| Authorization | string | Bearer token     |
| Accept        | string | application/json |

{% tabs %}
{% tab title="200 Cake successfully retrieved." %}

```
{
    "data": [
        {
            "status": {
                "msg": "Success",
                "code": 0,
                "version": "1.0"
            },
            "result_type": 0,
            "metadata": {
                "type": "delay",
                "timestamp_utc": "2021-01-07 10:20:25",
                "played_duration": 117,
                "music": [
                    {
                        "album": {
                            "name": "Shoot For The Stars Aim For The Moon"
                        },
                        "play_offset_ms": 30520,
                        "sample_begin_time_offset_ms": 2420,
                        "title": "What You Know Bout Love",
                        "result_from": 3,
                        "release_date": "2020-07-03",
                        "sample_end_time_offset_ms": 8460,
                        "genres": [
                            {
                                "name": "Hip Hop"
                            }
                        ],
                        "label": "Victor Victor Worldwide",
                        "db_end_time_offset_ms": 29240,
                        "score": 100,
                        "db_begin_time_offset_ms": 23200,
                        "artists": [
                            {
                                "name": "Pop Smoke"
                            }
                        ],
                        "duration_ms": 160000,
                        "external_ids": {
                            "isrc": [
                                "USUM72013339",
                                "USUM72013343",
                                "QZNMT2001964"
                            ],
                            "upc": [
                                "00602507456573",
                                "00602507456672",
                                "00602507456566"
                            ]
                        },
                        "acrid": "dda6ca5475ba126aa02b88ebe9b9b4cd",
                        "external_metadata": {
                            "spotify": [
                                {
                                    "album": {
                                        "name": "Shoot For The Stars Aim For The Moon",
                                        "id": "7e7t0MCrNDcJZsPwUKjmOc"
                                    },
                                    "track": {
                                        "name": "What You Know Bout Love",
                                        "id": "1tkg4EHVoqnhR6iFEXb60y"
                                    },
                                    "artists": [
                                        {
                                            "name": "Pop Smoke",
                                            "id": "0eDvMgVFoNV3TpwtrVCoTj"
                                        }
                                    ]
                                },
                                {
                                    "album": {
                                        "name": "Shoot For The Stars Aim For The Moon",
                                        "id": "3BjyBrktXCnnJ0gHifkyAk"
                                    },
                                    "track": {
                                        "name": "What You Know Bout Love",
                                        "id": "4g7ErSF4oImNnITtyiFowz"
                                    },
                                    "artists": [
                                        {
                                            "name": "Pop Smoke",
                                            "id": "0eDvMgVFoNV3TpwtrVCoTj"
                                        }
                                    ]
                                },
                                {
                                    "album": {
                                        "name": "Shoot For The Stars Aim For The Moon (Deluxe)",
                                        "id": "45HGJedVnKuOXNFW8fVuDz"
                                    },
                                    "track": {
                                        "name": "What You Know Bout Love",
                                        "id": "3jia9xE2RlTZKSy78z1mIz"
                                    },
                                    "artists": [
                                        {
                                            "name": "Pop Smoke",
                                            "id": "0eDvMgVFoNV3TpwtrVCoTj"
                                        }
                                    ]
                                }
                            ],
                            "deezer": [
                                {
                                    "album": {
                                        "name": ""
                                    },
                                    "track": {
                                        "name": "What You Know Bout Love",
                                        "id": "1081877402"
                                    },
                                    "artists": [
                                        {
                                            "name": "Pop Smoke"
                                        }
                                    ]
                                }
                            ]
                        }
                    }
                ],
                "record_timestamp": "20210107102025"
            }
        }
    ]
}
```

{% endtab %}

{% tab title="404 Could not find a cake matching this query." %}

```
{    "message": "Ain't no cake like that."}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Curl #day" %}

```bash
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'
```

{% endtab %}

{% tab title="Curl #last" %}

```bash
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}'
```

{% endtab %}
{% endtabs %}

## Get real-time results of channel monitoring

<mark style="color:blue;">`GET`</mark> `https://api-v2.acrcloud.com/api/bm-bd-projects/:pid/channels/:channel_id/realtime_results`

#### Path Parameters

| Name        | Type   | Description    |
| ----------- | ------ | -------------- |
| pid         | number | The project id |
| channel\_id | number | The channel id |

#### Headers

| Name          | Type   | Description      |
| ------------- | ------ | ---------------- |
| Authorization | string | Bearer token     |
| Accept        | string | application/json |

{% tabs %}
{% tab title="200 " %}

```
{
  "data": {
    "status": {
      "msg": "Success",
      "code": 0,
      "version": "1.0"
    },
    "result_type": 0,
    "metadata": {
      "timestamp_utc": "2021-02-24 08:29:44",
      "music": [
        {
          "album": {
            "name": "Coco"
          },
          "play_offset_ms": 13240,
          "sample_begin_time_offset_ms": 0,
          "contributors": {
            "composers": [
              "Golden Landis Von Jones",
              "Omer Fedi",
              "Jace Logan Jennings",
              "Jonathan Kirk"
            ],
            "lyricists": [
              "Golden Landis Von Jones",
              "Omer Fedi",
              "Jace Logan Jennings",
              "Jonathan Kirk"
            ]
          },
          "title": "Coco",
          "result_from": 3,
          "release_date": "2020-12-04",
          "sample_end_time_offset_ms": 9080,
          "genres": [
            {
              "name": "Rap"
            }
          ],
          "label": "SME - Records/Columbia",
          "duration_ms": 142000,
          "score": 100,
          "db_begin_time_offset_ms": 3520,
          "artists": [
            {
              "name": "24kGoldn"
            },
            {
              "name": "DaBaby"
            }
          ],
          "db_end_time_offset_ms": 12600,
          "external_ids": {
            "isrc": [
              "USQX92004163",
              "USANG2128624",
              "USQX92005136"
            ],
            "upc": [
              "886448929031",
              "024543215974",
              "886448929048"
            ]
          },
          "acrid": "052b6bc22d274731acf51d51449a3a5f",
          "external_metadata": {
            "spotify": [
              {
                "album": {
                  "name": "Coco (feat. DaBaby)"
                },
                "track": {
                  "name": "Coco (feat. DaBaby)",
                  "id": "2V6pjeOCuPBVlatcWTXUtP"
                },
                "artists": [
                  {
                    "name": "24kGoldn"
                  },
                  {
                    "name": "DaBaby"
                  }
                ]
              }
            ],
            "deezer": [
              {
                "album": {
                  "name": ""
                },
                "track": {
                  "name": "Coco (feat. DaBaby)",
                  "id": "1160241372"
                },
                "artists": [
                  {
                    "name": "24kgoldn"
                  },
                  {
                    "name": "DaBaby"
                  }
                ]
              }
            ]
          }
        }
      ]
    }
  }
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Curl" %}

```bash
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}'
```

{% endtab %}
{% endtabs %}

#### 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));
?>
```

## Getting results not recognized but detected as music. (Note: This API is only available for channels with music detection enabled)

<mark style="color:blue;">`GET`</mark> `https://api-v2.acrcloud.com/api/bm-bd-projects/:pid/channels/:channel_id/unknown_results`

#### Path Parameters

| Name                                          | Type   | Description    |
| --------------------------------------------- | ------ | -------------- |
| pid<mark style="color:red;">\*</mark>         | Number | The project id |
| channel\_id<mark style="color:red;">\*</mark> | Number | channel\_id    |

#### Query Parameters

| Name                                   | Type   | Description                                                                                             |
| -------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------- |
| date<mark style="color:red;">\*</mark> | 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) |

#### Headers

| Name                                            | Type   | Description      |
| ----------------------------------------------- | ------ | ---------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer token     |
| Accept<mark style="color:red;">\*</mark>        | String | application/json |

{% tabs %}
{% tab title="200: OK " %}

````json
```json
{
    "data": [
        {
            "start_timestamp_utc": "2023-11-01 00:00:00",
            "end_timestamp_utc": "2023-11-01 00:00:12",
            "played_duration": 12,
            "name": "Foreground music"
        },
        {
            "start_timestamp_utc": "2023-11-01 00:00:26",
            "end_timestamp_utc": "2023-11-01 00:00:29",
            "played_duration": 3,
            "name": "Foreground music"
        },
        {
            "start_timestamp_utc": "2023-11-01 00:00:29",
            "end_timestamp_utc": "2023-11-01 00:00:39",
            "played_duration": 10,
            "name": "Background music"
        },
        {
            "start_timestamp_utc": "2023-11-01 00:01:39",
            "end_timestamp_utc": "2023-11-01 00:01:56",
            "played_duration": 17,
            "name": "Background music"
        },
        {
            "start_timestamp_utc": "2023-11-01 00:02:52",
            "end_timestamp_utc": "2023-11-01 00:03:16",
            "played_duration": 24,
            "name": "Background music"
        },
        ...
    ]
}
```
````

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="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'
```

{% endtab %}
{% endtabs %}
