# Base Projects

## Create a project

<mark style="color:green;">`POST`</mark> `https://api-v2.acrcloud.com/api/base-projects`

Create a recognition project

#### Headers

| Name          | Type   | Description  |
| ------------- | ------ | ------------ |
| Authorization | string | Bearer token |

#### Request Body

| Name          | Type   | Description                                                                                                                                                                                                 |
| ------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| name          | string | The project name                                                                                                                                                                                            |
| region        | string | eu-west-1,us-west-2,ap-southeast-1                                                                                                                                                                          |
| type          | string | <p>There are three types. AVR,LCD,HR.<br>AVR is detecting music or custom content<br>LCD is detecting live channels and time-shifting channels<br>HR is detecting both live channel and custom contents</p> |
| buckets       | array  | The project detects content from the buckets. The format is bucket id array.                                                                                                                                |
| audio\_type   | string | <p>linein or recorded. Default is linein<br>recorded: Audio captured via microphone or noisy audio files<br>linein: Audio of original file or stream without noise</p>                                      |
| external\_ids | string | spotify,deezer,isrc,upc,musicbrainz                                                                                                                                                                         |

{% tabs %}
{% tab title="200 The project successfully created." %}

```
{
    "data": {
        "uid": 1,
        "access_key": "e7a84ca942a13773f6d22e9fd6808fce",
        "access_secret": "9zlEAx57jaCgeLpDKKQmorv0brrhAYqj076n6FyP",
        "service_type": "AVR",
        "state": 1,
        "name": "test",
        "region": "eu-west-1",
        "day_limit": 0,
        "total_limit": 0,
        "audio_type": "linein",
        "version": 1,
        "external_id": "",
        "updated_at": "2020-12-25T09:47:25.000000Z",
        "created_at": "2020-12-25T09:47:25.000000Z",
        "id": 15,
        "buckets": [
            {
                "id": 8881,
                "name": "bucket-music",
                "type": "File",
                "metadata_template": null
            },
            {
                "id": 8883,
                "name": "api-test",
                "type": "File",
                "metadata_template": null
            }
        ],
        "status_check": 2,
        "external_ids": ["spotify", "isrc", "deezer"]
    }
}
```

{% endtab %}
{% endtabs %}

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

```bash
curl --location --request POST 'https://api-v2.acrcloud.com/api/base-projects' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer token' \
--header 'Content-Type: application/json' \
--data-raw '{"name":"test", "region":"eu-west-1", "buckets":[8881,8883],"type":"AVR", "audio_type":"linein", "external_ids":["spotify", "isrc", "deezer"]}'
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api-v2.acrcloud.com/api/base-projects"

payload={
  "name":"test", 
  "region":"eu-west-1", 
  "buckets":[8881,8883],
  "type":"AVR", 
  "audio_type":"linein", 
  "external_ids":["spotify", "isr\", "deezer"]
}
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer token',
  'Content-Type': 'application/json'
}

response = requests.post(url, headers=headers, json=payload)

print(response.text)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api-v2.acrcloud.com/api/base-projects',
  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 =>'{"name":"test", "region":"eu-west-1", "buckets":[8881,8883],"type":"AVR", "audio_type":"linein", "external_ids":["spotify", "isrc", "deezer"]}',
  CURLOPT_HTTPHEADER => array(
    'Accept: application/json',
    'Authorization: Bearer token',
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
```

{% endtab %}

{% tab title="Nodejs" %}

```javascript
var axios = require('axios');
var data = JSON.stringify({"name":"test","region":"eu-west-1","buckets":[8881,8883],"type":"AVR","audio_type":"linein","external_ids":["spotify","isrc","deezer"]});

var config = {
  method: 'post',
  url: 'https://api-v2.acrcloud.com/api/base-projects',
  headers: { 
    'Accept': 'application/json', 
    'Authorization': 'Bearer token', 
    'Content-Type': 'application/json'
  },
  data : data
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});

```

{% endtab %}
{% endtabs %}

## List projects

<mark style="color:blue;">`GET`</mark> `https://api-v2.acrcloud.com/api/base-projects`

#### Query Parameters

| Name      | Type   | Description                        |
| --------- | ------ | ---------------------------------- |
| region    | string | eu-west-1,us-west-2,ap-southeast-1 |
| type      | string | AVR,LCD,HR                         |
| page      | string | Page number                        |
| per\_page | string | The results number per page        |

#### Headers

| Name          | Type   | Description  |
| ------------- | ------ | ------------ |
| Authorization | string | Bearer token |

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

```
{
    "data": [
        {
            "id": 15,
            "uid": 1,
            "access_key": "e7a84ca942a13773f6d22e9fd6808fce",
            "access_secret": "9zlEAx57jaCgeLpDKKQmorv0brrhAYqj076n6FyP",
            "name": "test",
            "service_type": "AVR",
            "state": 1,
            "region": "eu-west-1",
            "day_limit": 0,
            "qps_limit": 0,
            "audio_type": "linein",
            "version": 1,
            "external_id": "",
            "created_at": "2020-12-25T09:47:25.000000Z",
            "updated_at": "2020-12-25T09:47:25.000000Z",
            "buckets": [
                {
                    "id": 8881,
                    "name": "bucket-music",
                    "type": "File",
                    "metadata_template": null
                },
                {
                    "id": 8883,
                    "name": "api-test",
                    "type": "File",
                    "metadata_template": null
                }
            ],
            "status_check": 2,
            "external_ids": []
        },
        {
            "id": 14,
            "uid": 1,
            "access_key": "9246b72f271403f4abefd723b10d2810",
            "access_secret": "TZZbedkkArX2cLDdz6PBc1rkBkUrq3izQccmjDGc",
            "name": "vue-project-2",
            "service_type": "AVR",
            "state": 1,
            "region": "ap-southeast-1",
            "day_limit": 0,
            "qps_limit": 0,
            "audio_type": "recorded",
            "version": 1,
            "created_at": "2020-08-07T19:21:48.000000Z",
            "updated_at": "2020-08-07T19:22:01.000000Z",
            "buckets": [
                {
                    "id": 8880,
                    "name": "ACRCloud Music",
                    "type": "ACRCloudFile",
                    "metadata_template": null
                },
                {
                    "id": 8881,
                    "name": "bucket-music",
                    "type": "File",
                    "metadata_template": null
                },
                {
                    "id": 8883,
                    "name": "api-test",
                    "type": "File",
                    "metadata_template": null
                }
            ],
            "status_check": 2,
            "external_ids": [
                "Youtube",
                "Deezer"
            ]
        },
        {
            "id": 13,
            "uid": 1,
            "access_key": "a13717e4bef752c067d0cee5dfc13dfb",
            "access_secret": "W0IhtWoQjLceyRNufQUhQabudUu0009APOaciRAy",
            "name": "vue-project",
            "service_type": "AVR",
            "state": 1,
            "region": "ap-southeast-1",
            "day_limit": 0,
            "qps_limit": 0,
            "audio_type": "recorded",
            "version": 1,
            "created_at": "2020-08-07T19:21:48.000000Z",
            "updated_at": "2020-08-07T19:22:01.000000Z",
            "buckets": [
                {
                    "id": 8881,
                    "name": "bucket-music",
                    "type": "File",
                    "metadata_template": null
                }
            ],
            "status_check": 2,
            "external_ids": [
                "Deezer",
                "Spotify"
            ]
        },
        {
            "id": 5,
            "uid": 1,
            "access_key": "965eb1aded32934b78a599fffb9befdd",
            "access_secret": "BqSmWxTV5dwJgxGVG0Pfxq1wUXHlAXBm4Poy8jpf",
            "name": "param_test",
            "service_type": "AVR",
            "state": 1,
            "region": "ap-southeast-1",
            "day_limit": 0,
            "qps_limit": 0,
            "audio_type": "recorded",
            "version": 1,
            "created_at": "2020-08-07T19:21:48.000000Z",
            "updated_at": "2020-08-07T19:22:01.000000Z",
            "buckets": [
                {
                    "id": 8880,
                    "name": "ACRCloud Music",
                    "type": "ACRCloudFile",
                    "metadata_template": null
                },
                {
                    "id": 8881,
                    "name": "bucket-music",
                    "type": "File",
                    "metadata_template": null
                }
            ],
            "status_check": 2,
            "external_ids": [
                "deezer",
                "itunes",
                "spotify",
                "youtube",
                "isrc",
                "upc",
                "musicstory",
                "lyricfind"
            ]
        },
        {
            "id": 3,
            "uid": 1,
            "access_key": "01d97da894699fb8e0ea9832e679fdc8",
            "access_secret": "0t7zQ23F2yhaXEBqUMZ6qvRzhiGt8BKMvk6FPkfG",
            "name": "hr",
            "service_type": "HR",
            "state": 1,
            "region": "ap-southeast-1",
            "day_limit": 0,
            "qps_limit": 0,
            "audio_type": "recorded",
            "version": 1,
            "external_id": "",
            "created_at": "2020-08-07T19:21:48.000000Z",
            "updated_at": "2020-08-07T19:22:01.000000Z",
            "buckets": [
                {
                    "id": 8881,
                    "name": "bucket-music",
                    "type": "File",
                    "metadata_template": null
                },
                {
                    "id": 8882,
                    "name": "tv",
                    "type": "Live",
                    "metadata_template": null
                }
            ],
            "status_check": 2,
            "external_ids": []
        },
        {
            "id": 2,
            "uid": 1,
            "access_key": "896cf772dc1b5f2e9287f524fcc78971",
            "access_secret": "5TETNWSHDnGbXv6OhVrgkbbVzQtuhMuFSDpXu4TW",
            "name": "tv_project",
            "service_type": "LCD",
            "state": 1,
            "region": "ap-southeast-1",
            "day_limit": 0,
            "qps_limit": 0,
            "audio_type": "recorded",
            "version": 1,
            "external_id": "",
            "created_at": "2020-08-07T19:21:48.000000Z",
            "updated_at": "2020-08-07T19:22:01.000000Z",
            "buckets": [
                {
                    "id": 8882,
                    "name": "tv",
                    "type": "Live",
                    "metadata_template": null
                }
            ],
            "status_check": 2,
            "external_ids": []
        }
    ],
    "links": {
        "first": "https://api-v2.acrcloud.com/api/base-projects?page=1",
        "last": "https://api-v2.acrcloud.com/api/base-projects?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "path": "https://api-v2.acrcloud.com/api/base-projects",
        "per_page": "20",
        "to": 6,
        "total": 6
    }
}
```

{% endtab %}
{% endtabs %}

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

```bash
curl --location --request GET 'https://api-v2.acrcloud.com/api/base-projects?type=AVR' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer token'
```

{% endtab %}
{% endtabs %}

## Get a project

<mark style="color:blue;">`GET`</mark> `https://api-v2.acrcloud.com/api/base-projects/:id`

Get the details of a project

#### Path Parameters

| Name | Type   | Description    |
| ---- | ------ | -------------- |
| id   | number | The project id |

#### Headers

| Name          | Type   | Description  |
| ------------- | ------ | ------------ |
| Authorization | string | Bearer token |

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

```
{
    "data": {
        "uid": 1,
        "access_key": "e7a84ca942a13773f6d22e9fd6808fce",
        "access_secret": "9zlEAx57jaCgeLpDKKQmorv0brrhAYqj076n6FyP",
        "service_type": "AVR",
        "state": 1,
        "name": "test",
        "region": "eu-west-1",
        "day_limit": 0,
        "total_limit": 0,
        "audio_type": "linein",
        "version": 1,
        "external_id": "",
        "updated_at": "2020-12-25T09:47:25.000000Z",
        "created_at": "2020-12-25T09:47:25.000000Z",
        "id": 15,
        "buckets": [
            {
                "id": 8881,
                "name": "bucket-music",
                "type": "File",
                "metadata_template": null
            },
            {
                "id": 8883,
                "name": "api-test",
                "type": "File",
                "metadata_template": null
            }
        ],
        "status_check": 2,
        "external_ids": ["spotify", "isrc", "deezer"]
    }
}
```

{% endtab %}
{% endtabs %}

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

```bash
curl --location --request GET 'http://127.0.0.1:8080/api/base-projects/15' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer token'
```

{% endtab %}
{% endtabs %}

## Update a project

<mark style="color:orange;">`PUT`</mark> `https://api-v2.acrcloud.com/api/base-projects/:id`

#### Path Parameters

| Name | Type   | Description    |
| ---- | ------ | -------------- |
| id   | number | The project id |

#### Headers

| Name          | Type   | Description  |
| ------------- | ------ | ------------ |
| Authorization | string | Bearer token |

#### Request Body

| Name          | Type   | Description                                                              |
| ------------- | ------ | ------------------------------------------------------------------------ |
| name          | string | Project name                                                             |
| buckets       | array  | The project detects content from buckets. The format is bucket id array. |
| audio\_type   | string | linein or recorded                                                       |
| external\_ids | string | spotify,deezer,youtube,isrc,upc,musicbrainz                              |

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

```
{
    "data": {
        "uid": 1,
        "access_key": "e7a84ca942a13773f6d22e9fd6808fce",
        "access_secret": "9zlEAx57jaCgeLpDKKQmorv0brrhAYqj076n6FyP",
        "service_type": "AVR",
        "state": 1,
        "name": "test",
        "region": "eu-west-1",
        "day_limit": 0,
        "total_limit": 0,
        "audio_type": "linein",
        "version": 1,
        "external_id": "",
        "updated_at": "2020-12-25T09:47:25.000000Z",
        "created_at": "2020-12-25T09:47:25.000000Z",
        "id": 15,
        "buckets": [
            {
                "id": 8881,
                "name": "bucket-music",
                "type": "File",
                "metadata_template": null
            },
            {
                "id": 8883,
                "name": "api-test",
                "type": "File",
                "metadata_template": null
            }
        ],
        "status_check": 2,
        "external_ids": ["spotify", "isrc", "deezer"]
    }
}
```

{% endtab %}
{% endtabs %}

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

```bash
curl --location --request PUT 'http://127.0.0.1:8080/api/base-projects/15' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer token' \
--header 'Content-Type: application/json' \
--data-raw '{"name":"test", "region":"eu-west-1", "buckets":[8881,8883],"type":"AVR", "audio_type":"linein", "external_ids":["spotify", "isrc", "deezer"]}'
```

{% endtab %}
{% endtabs %}

## Delete a project

<mark style="color:red;">`DELETE`</mark> `https://api-v2.acrcloud.com/api/base-projects/:id`

#### Path Parameters

| Name | Type   | Description    |
| ---- | ------ | -------------- |
| id   | number | The project id |

#### Headers

| Name          | Type   | Description  |
| ------------- | ------ | ------------ |
| Authorization | string | Bearer token |

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

```
```

{% endtab %}
{% endtabs %}

## Get the status of the project's buckets

<mark style="color:blue;">`GET`</mark> `https://us-api-v2.acrcloud.com/api/base-projects/:id/buckets-status`

#### Path Parameters

| Name | Type   | Description    |
| ---- | ------ | -------------- |
| id   | string | The project id |

#### Headers

| Name          | Type   | Description  |
| ------------- | ------ | ------------ |
| Authorization | string | Bearer token |

Response

| Nmae    | Type   | Description                         |
| ------- | ------ | ----------------------------------- |
| buckets | string | The buckets your porject are using. |
| nodes   | string | The server nodes for the buckets    |
| status  | string | <p>1: healthy<br>0: unhealthy</p>   |

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

````
```json
{
    "ACRCloudFile": [
        {
            "buckets": [
                {
                    "name": "ACRCloud Music",
                    "id": 23
                }
            ],
            "nodes": {
                "node": "46671216359c47fc0c1b236194f7cca0",
                "status": 1
            }
        }
    ]
}
```
````

{% endtab %}
{% endtabs %}

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

```
curl --location --request GET 'https://us-api-v2.acrcloud.com/api/base-projects/:your_project_id/buckets-status' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer your_token'
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://us-api-v2.acrcloud.com/api/base-projects/:project_id/buckets-status"

payload={}
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer your_token'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)
```

{% endtab %}
{% endtabs %}

## Get the statistics of the project

<mark style="color:blue;">`GET`</mark> `https://api-v2.acrcloud.com/api/base-projects/:id/day-stat`

#### Path Parameters

| Name | Type   | Description    |
| ---- | ------ | -------------- |
| id   | number | The project id |

#### Query Parameters

| Name  | Type   | Description               |
| ----- | ------ | ------------------------- |
| start | string | The start date YYYY-MM-DD |
| end   | string | The end date              |

#### Headers

| Name          | Type   | Description  |
| ------------- | ------ | ------------ |
| Authorization | string | Bearer token |

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

```
```

{% endtab %}
{% endtabs %}

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

```
curl --request GET 'https://api-v2.acrcloud.com/api/base-projects/:id/day-stat?start=2021-04-09&end=2021-04-23'
--header 'Accept: application/json' \
--header 'Authorization: Bearer your_token'
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.acrcloud.com/reference/console-api/base-projects.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
