### Example GET Request with `ask` Parameter Source: https://docs.acrcloud.com/reference/console-api/ucf-projects/ucf-results Use this GET request format to query the documentation. Replace `` with your specific question in natural language. ```http GET https://docs.acrcloud.com/reference/console-api/ucf-projects/ucf-results.md?ask= ``` -------------------------------- ### Query Documentation API Example Source: https://docs.acrcloud.com/reference/console-api/file-scanning/metadata/cover-songs Demonstrates how to dynamically query the documentation by performing an HTTP GET request with an 'ask' query parameter. ```bash GET https://docs.acrcloud.com/reference/console-api/file-scanning/metadata/cover-songs.md?ask= ``` -------------------------------- ### Get Go SDK Source: https://docs.acrcloud.com/sdk-reference/backend-sdk/go Installs the ACRCloud Go SDK using the 'go get' command. This command fetches and installs the SDK package into your Go workspace. ```bash $ go get github.com/acrcloud/acrcloud_sdk_golang/acrcloud ``` -------------------------------- ### Curl Request to Get Project Details Source: https://docs.acrcloud.com/reference/console-api/base-projects Example using curl to fetch project details. Ensure the Authorization header contains a valid Bearer token. ```bash curl --location --request GET 'http://127.0.0.1:8080/api/base-projects/15' \ --header 'Accept: application/json' \ --header 'Authorization: Bearer token' ``` -------------------------------- ### List Channels Request Example Source: https://docs.acrcloud.com/reference/console-api/bm-projects/broadcast-database-projects/channels This snippet demonstrates how to make a GET request to list channels using curl. Ensure you replace `{your token}` with your actual Bearer token. ```bash curl --location --request GET 'https://api-v2.acrcloud.com/api/bm-bd-projects/179/channels' \ --header 'Accept: application/json' \ --header 'Authorization: Bearer {your token}' ``` -------------------------------- ### Curl Request Example Source: https://docs.acrcloud.com/reference/console-api/bm-projects/broadcast-database-projects/channels-results This command demonstrates how to make a GET request to the real-time results API using curl. Ensure you replace placeholders with your actual project ID, channel ID, and bearer token. ```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}' ``` -------------------------------- ### Import BM Streams Request Example Source: https://docs.acrcloud.com/reference/console-api/ucf-projects/bm-streams This example demonstrates how to import BM streams to a project using a POST request. It includes the endpoint, headers, and a sample JSON request body. ```bash curl --location --request POST 'https://api-v2.acrcloud.com/api/ucf-projects/10263/streams' \ --header 'Accept: application/json' \ --header 'Authorization: Bearer token' \ --header 'Content-Type: application/json' \ --data-raw '{"bm_stream_ids":["191149","198144"], "from":"BM-DATABASE", "bm_project_id":871}' ``` -------------------------------- ### Install MySQL-python on Windows Source: https://docs.acrcloud.com/tools/local-monitoring-tool Install the MySQL-python library using pip after downloading the appropriate wheel file for your Python version and system architecture. ```bash python -m pip install MySQL_python‑1.2.5‑cp27‑none‑win32.whl ``` ```bash python -m pip install mysql-python ``` -------------------------------- ### Query Documentation via HTTP GET Source: https://docs.acrcloud.com/reference/console-api/buckets/live-channels Perform an HTTP GET request to a documentation URL with the 'ask' query parameter to ask a question. The response includes a direct answer and relevant excerpts. ```http GET https://docs.acrcloud.com/reference/console-api/buckets/live-channels.md?ask= ``` -------------------------------- ### Query Documentation via HTTP GET Source: https://docs.acrcloud.com/sdk-reference/backend-sdk/php To ask questions about the documentation, perform an HTTP GET request to the page URL with the 'ask' query parameter. The question should be specific and self-contained. ```http GET https://docs.acrcloud.com/sdk-reference/backend-sdk/php.md?ask= ``` -------------------------------- ### Query Documentation Dynamically Source: https://docs.acrcloud.com/reference/console-api/bm-projects/metadata/music-broadcast-monitoring-with-broadcast-database To get more information not explicitly on the page, make an HTTP GET request to the current URL with the 'ask' query parameter. The question should be specific and in natural language. ```HTTP GET https://docs.acrcloud.com/reference/console-api/bm-projects/metadata/music-broadcast-monitoring-with-broadcast-database.md?ask= ``` -------------------------------- ### CURL Request to Get Recording Source: https://docs.acrcloud.com/reference/console-api/bm-projects/broadcast-database-projects/recordings This cURL command demonstrates how to make a GET request to the recordings endpoint. It includes example project ID, channel ID, timestamp, and duration, along with required headers. ```bash curl --location --request GET 'https://api-v2.acrcloud.com/api/bm-bd-projects/100079/channels/100123/recordings?timestamp_utc=20210601121314&played_duration=30' \ --header 'Accept: */*' \ --header 'Authorization: Bearer {your token}' ``` -------------------------------- ### Query Documentation Example Source: https://docs.acrcloud.com/reference/console-api/ucf-projects Demonstrates how to query the documentation dynamically by appending an 'ask' parameter with a natural language question to the documentation URL. ```http GET https://docs.acrcloud.com/reference/console-api/ucf-projects.md?ask= ``` -------------------------------- ### Create Project Response (200 OK) Source: https://docs.acrcloud.com/reference/console-api/base-projects Example of a successful response when creating a new project. It includes project details like UID, access keys, and associated buckets. ```json { "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"] } } ``` -------------------------------- ### Get a Bucket (Node.js) Source: https://docs.acrcloud.com/reference/console-api/buckets This Node.js example uses axios to retrieve bucket details. Ensure your 'Authorization' header contains a valid Bearer token. ```javascript var axios = require('axios'); var config = { method: 'get', url: 'https://api-v2.acrcloud.com/api/buckets/966', headers: { 'Accept': 'application/json', 'Authorization': 'Bearer your_access_token' } }; axios(config) .then(function (response) { console.log(JSON.stringify(response.data)); }) .catch(function (error) { console.log(error); }); ``` -------------------------------- ### Create Project using Curl Source: https://docs.acrcloud.com/reference/console-api/base-projects Example of how to create a new project using a cURL command. Ensure to replace 'token' with your actual Bearer token. ```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"]}' ``` -------------------------------- ### Java Main Method Example for Audio File Recognition Source: https://docs.acrcloud.com/reference/identification-api/identification-api Demonstrates reading an audio file (WAV) into a byte array and initiating an ACRCloud recognition request. Includes file handling and error checking. ```Java public static void main(String[] args) { File file = new File("E://sample.wav"); byte[] buffer = new byte[1024 * 1024]; if (!file.exists()) { return; } FileInputStream fin = null; int bufferLen = 0; try { fin = new FileInputStream(file); bufferLen = fin.read(buffer, 0, buffer.length); } catch (Exception e) { e.printStackTrace(); } finally { try { if (fin != null) { fin.close(); } } catch (IOException e) { e.printStackTrace(); } } System.out.println("bufferLen=" + bufferLen); if (bufferLen <= 0) return; byte[] postDatas = new byte[bufferLen]; System.arraycopy(buffer, 0, postDatas, 0, bufferLen); IdentifyProtocolV1 a = new IdentifyProtocolV1(); // Replace "###...###" below with your project's host, access_key and access_secret. // recognize(String host, String accessKey, String secretKey, byte[] queryData, String queryType, int timeout) } ``` -------------------------------- ### Create Base Project with Node.js Source: https://docs.acrcloud.com/reference/console-api/base-projects This Node.js example uses the axios library to create a new base project. It sends a POST request with project details in JSON format. ```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); }); ``` -------------------------------- ### Curl Request for UCF Results Details Source: https://docs.acrcloud.com/reference/console-api/ucf-projects/ucf-results Example of how to make a GET request to the UCF results details endpoint using curl. Includes setting the Authorization header and specifying pagination parameters. ```bash curl --location --request GET 'http://127.0.0.1:8080/api/ucf-projects/10263/results/340335/details?page=1&per_page=10' \ --header 'Accept: application/json' \ --header 'Authorization: Bearer token' ``` -------------------------------- ### Navigate to the Tool Directory Source: https://docs.acrcloud.com/tools/live-channel-fingerprinting-tool Enter the specific directory for your operating system (e.g., Linux x86-64). ```bash cd Linux/x86-64 ``` -------------------------------- ### Get File Scanning Results (JSON Example) Source: https://docs.acrcloud.com/reference/console-api/file-scanning/file-scanning This JSON structure represents the successful response when retrieving results for scanned files. It includes details about the file, its analysis, and potential music recognition data. ```json { "data": [ { "id": "e1cc5a16-e7b2-4261-9ab8-c20e1db70ac0", "uid": 1, "cid": 11655, "name": "/vod/video-3/01G6D3Z2SSDEDEGHP9ZSX8KC20/audio.mp4", "duration": 7, "uri": "audio_url:/01G6D3Z2SSDEDEGHP9ZSX8KC20/audio.mp4", "url": "https://test.com/01G6D3Z2SSDEDEGHP9ZSX8KC20/audio.mp4", "data_type": "audio_url", "engine": 1, "count": 1, "state": 1, "subscribed": 0, "detail": "", "created_at": "2022-07-06T03:50:33.000000Z", "updated_at": "2022-07-06T03:50:33.000000Z", "total": 1, "results": { "ai_detection": [ { "start": 0, "end": 249.74, "prediction": "human", "likely_source": "Human", "ai_probability": 26.97, "duration": 249.74, "source_probabilities": [ { "source": "suno", "probability": 8.3 }, { "source": "udio", "probability": 9 }, { "source": "sonauto", "probability": 5 }, { "source": "mureka", "probability": 5.3 }, { "source": "riffusion", "probability": 5.3 } ] } ], "music": [ { "played_duration": 7, "offset": 0, "type": "traverse", "result": { "album": { "id": "3RQQmkQEvNCY4prGKE6oc5", "name": "Un Verano Sin Ti" }, ``` -------------------------------- ### Create Bucket using Node.js Source: https://docs.acrcloud.com/reference/console-api/buckets This Node.js example uses the axios library to create a bucket. It demonstrates how to configure the request with URL, headers, and JSON data. ```javascript var axios = require('axios'); var data = JSON.stringify({"name":"avbucket","type":"File","labels":["Music","Video"],"net_type":1,"region":"ap-southeast-1"}); var config = { method: 'post', url: 'https://api-v2.acrcloud.com/api/buckets', 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); }); ``` -------------------------------- ### Stream Status Response Example Source: https://docs.acrcloud.com/reference/console-api/bm-projects/custom-streams-projects/streams-status This JSON object represents a successful response detailing the state of a stream over a period. It includes total and valid time, time offset, and a list of state changes with their start and end times and durations. ```json { "data": { "total_time": 318895, "valid_time": 312323, "timeoffset": -480, "state_list": [ { "code": 0, "start": "2021-03-26 00:00:00", "end": "2021-03-26 00:06:38", "duration": 398 }, { "code": 12, "start": "2021-03-26 00:06:38", "end": "2021-03-26 00:10:58", "duration": 260 }, { "code": 0, "start": "2021-03-26 00:10:58", "end": "2021-03-26 00:19:40", "duration": 522 }, { "code": 12, "start": "2021-03-26 00:19:40", "end": "2021-03-26 00:21:10", "duration": 90 }, { "code": 0, "start": "2021-03-26 00:21:10", "end": "2021-03-26 00:45:19", "duration": 1449 }, { "code": 12, "start": "2021-03-26 00:45:19", "end": "2021-03-26 01:10:54", "duration": 1535 }, { "code": 0, "start": "2021-03-26 01:10:54", "end": "2021-03-26 01:15:55", "duration": 301 }, { "code": 12, "start": "2021-03-26 01:15:55", "end": "2021-03-26 02:31:12", "duration": 4517 }, { "code": 0, "start": "2021-03-26 02:31:12", "end": "2021-03-26 02:56:40", "duration": 1528 }, { "code": 12, "start": "2021-03-26 02:56:40", "end": "2021-03-26 02:56:50", "duration": 10 }, { "code": 0, "start": "2021-03-26 02:56:50", "end": "2021-03-26 03:30:52", "duration": 2042 }, { "code": 12, "start": "2021-03-26 03:30:52", "end": "2021-03-26 03:31:01", "duration": 9 }, { "code": 0, "start": "2021-03-26 03:31:01", "end": "2021-03-26 04:11:00", "duration": 2399 }, { "code": 12, "start": "2021-03-26 04:11:00", "end": "2021-03-26 04:11:09", "duration": 9 }, { "code": 0, "start": "2021-03-26 04:11:09", "end": "2021-03-26 05:58:13", "duration": 6424 }, { "code": 0, "start": "2021-03-26 05:58:13", "end": "2021-03-26 08:00:00", "duration": 7307 }, { "code": 0, "start": "2021-03-26 08:00:00", "end": "2021-03-27 08:00:00", "duration": 86400 }, { "code": 0, "start": "2021-03-27 08:00:00", "end": "2021-03-27 22:01:26", "duration": 50486 }, { "code": 1, "start": "2021-03-27 22:01:26", "end": "2021-03-27 22:02:26", "duration": 60 }, { "code": 0, "start": "2021-03-27 22:02:26", "end": "2021-03-27 22:02:47", "duration": 21 }, { "code": 1, "start": "2021-03-27 22:02:47", "end": "2021-03-27 22:03:00", "duration": 13 }, { "code": 0, "start": "2021-03-27 22:03:00", "end": "2021-03-28 08:00:00", "duration": 35820 }, { "code": 0, "start": "2021-03-28 08:00:00", "end": "2021-03-29 05:46:49", "duration": 78409 }, { "code": 1, "start": "2021-03-29 05:46:49", "end": "2021-03-29 05:47:57", "duration": 68 }, { "code": 0, "start": "2021-03-29 05:47:57", "end": "2021-03-29 08:00:00", "duration": 7923 }, { "code": 0, "start": "2021-03-29 08:00:00", "end": "2021-03-29 16:34:54", "duration": 30894 } ] } } ``` -------------------------------- ### Java SDK Example Source: https://docs.acrcloud.com/reference/identification-api/identification-api This Java code demonstrates how to use the ACRCloud SDK to identify audio files. It includes methods for setting up credentials, constructing the request, and handling the response. ```APIDOC ## Java SDK for Identification ### Description This Java code demonstrates how to use the ACRCloud SDK to identify audio files. It includes methods for setting up credentials, constructing the request, and handling the response. ### Class: Recognizer #### Constructor - `Recognizer()`: Initializes the recognizer with default host, protocol, endpoint, and timeout settings. Access key and secret need to be set manually or via configuration. #### Methods - `recognizeByFile(String filePath, String dataType)`: - **Description**: Identifies content from a given file path. - **Parameters**: - `filePath` (String) - Required - The path to the audio or video file to identify. - `dataType` (String) - Required - The type of data to identify (e.g., "audio", "video"). - **Returns**: A String containing the identification result or an error message. - `main(String[] args)`: - **Description**: A sample main method to demonstrate the usage of the `recognizeByFile` method. - **Example Usage**: ```java Recognizer rec = new Recognizer(); String result = rec.recognizeByFile("x.mp3", "audio"); System.out.println(result); ``` ### Authentication Authentication is handled via `accessKey` and `accessSecret`, which are used to generate a signature for each request. The `encryptByHMACSHA1` method is used for this purpose. ### Request Details - **Method**: POST - **Endpoint**: `/v1/identify` - **Parameters**: The request is sent as a multipart form data, including: - `access_key` (String) - `sample_bytes` (String) - The size of the sample file in bytes. - `timestamp` (String) - The current Unix timestamp. - `signature` (String) - The generated HMAC-SHA1 signature. - `data_type` (String) - The type of data being sent (e.g., "audio"). - `signature_version` (String) - The signature version (currently "1"). - `sample` (File) - The actual audio or video file content. ### Response - **Success Response**: A JSON string containing identification results. - **Error Handling**: Exceptions during file processing or network requests are caught and printed to the console. The method returns an empty string or partial result in case of errors. ``` -------------------------------- ### Get Streams Results Source: https://docs.acrcloud.com/reference/console-api/bm-projects/custom-streams-projects/streams-results This API retrieves the results of custom streams for a specified project and stream, with options to filter by date and duration. It returns a list of music segments played, including their start and end times, played duration, and name. ```APIDOC ## GET /api/bm-cs-projects/{project_id}/streams/{stream_id}/unknown_results ### Description Retrieves the results of custom streams for a given project and stream, with optional filtering by date and duration. ### Method GET ### Endpoint `/api/bm-cs-projects/{project_id}/streams/{stream_id}/unknown_results` ### Parameters #### Query Parameters - **date** (string) - Required - The date for which to retrieve results (format: YYYYMMDD). - **min_duration** (integer) - Optional - The minimum duration in seconds for music segments to be included. - **max_duration** (integer) - Optional - The maximum duration in seconds for music segments to be included. #### Headers - **Accept**: `application/json` - **Authorization**: `Bearer ` - Required - Authentication token. ### Response #### Success Response (200) - **headers** (object) - Contains metadata about the results. - **start_timestamp_utc** (string) - The start timestamp of the music segment. - **end_timestamp_utc** (string) - The end timestamp of the music segment. - **played_duration** (integer) - The duration the music was played in seconds. - **name** (string) - The name of the music segment. ### Request Example ```json { "example": "curl --location 'https://api-v2.acrcloud.com/api/bm-cs-projects/1234/streams/s-xxxxx/unknown_results?date=20231018&min_duration=60&max_duration=80' \ --header 'Accept: application/json' \ --header 'Authorization: Bearer token'" } ``` ### Response Example ```json { "example": "{\"headers\": {\"start_timestamp_utc\": \"2023-10-18 08:18:52\", \"end_timestamp_utc\": \"2023-10-18 08:20:08\", \"played_duration\": 76, \"name\": \"Background music\"}}" } ``` ``` -------------------------------- ### Query Documentation Dynamically Source: https://docs.acrcloud.com/get-started/tutorials/recognize-music Use this HTTP GET request to ask questions about the documentation. The response includes a direct answer and relevant excerpts. ```http GET https://docs.acrcloud.com/get-started/tutorials/recognize-music.md?ask= ``` -------------------------------- ### AI Music Detection Output Example (Original Stem) Source: https://docs.acrcloud.com/reference/console-api/file-scanning/metadata/ai-music-detection This JSON output represents the detection of AI-generated music in the original audio stem. It includes start and end times, prediction, likely source, AI probability, duration, and detailed source probabilities. ```json { "ai_detection": [ { "start": 0, "end": 168.68, "prediction": "ai_generated", //ai_generated,human,no_vocals "likely_source": "Suno", //Suno,Udio,Sonauto,Mureka,Riffusion,Human,no_vocals "ai_probability": 97.61, "duration": 168.68, "stem": "original", //original, vocals, accompaniment "source_probabilities": [ { "source": "Suno", "probability": 96 }, { "source": "Udio", "probability": 0.6 }, { "source": "Sonauto", "probability": 0.2 }, { "source": "Mureka", "probability": 0.8 }, { "source": "Riffusion", "probability": 0.2 }, { "source": "Seedmusic", "probability": 0.7 }, { "source": "Minimax", "probability": 0.2 }, { "source": "Elevenlabs", "probability": 0.1 } ], "segments": [ { "start": 0, "end": 168.68, "prediction": "ai_generated", "likely_source": "Suno", "ai_probability": 98.64 } ], "model_id": "lv1axtcv" // model version } ``` -------------------------------- ### Query Documentation Dynamically Source: https://docs.acrcloud.com/reference/console-api/file-scanning Perform an HTTP GET request to query the documentation. Include your question as a URL-encoded string in the `ask` query parameter. The response will contain a direct answer and relevant excerpts. ```http GET https://docs.acrcloud.com/reference/console-api/file-scanning.md?ask= ``` -------------------------------- ### Example JSON Response for Unknown Music Results Source: https://docs.acrcloud.com/reference/console-api/bm-projects/broadcast-database-projects/channels-results This JSON structure represents the successful response from the API, detailing detected music segments that were not specifically recognized. It includes start and end times, played duration, and the classification (e.g., 'Foreground music', 'Background music'). ```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" }, ... ] } ``` -------------------------------- ### Add Stream Request Example Source: https://docs.acrcloud.com/reference/console-api/bm-projects/custom-streams-projects/streams This example demonstrates how to add a new stream to a custom project using a POST request. It includes the endpoint, required headers, and a sample JSON request body with stream URLs, name, config ID, and user-defined metadata. ```bash curl --location --request POST 'https://api-v2.acrcloud.com/api/bm-cs-projects/{your_project_id}/streams' \ --header 'Accept: application/json' \ --header 'Authorization: Bearer {your token}' \ --header 'Content-Type: application/json' \ --data-raw '{"stream_urls":["https://streamurl.com/1234"],"name":"test","config_id":3, "user_defined":{"country":"France"}}' ``` -------------------------------- ### Curl Request for Channel Results Source: https://docs.acrcloud.com/reference/console-api/bm-projects/historical-results-projects/channels-results This example demonstrates how to make a GET request to the ACRCloud API to retrieve historical channel results for a specific project and channel on a given date. Ensure you replace placeholders with your actual token, project ID, channel ID, and date. ```bash curl --location --request GET 'https://api-v2.acrcloud.com/api/bm-hist-projects/1/channels/243253/results?date=20250221' \ --header 'Accept: application/json' \ --header 'Authorization: Bearer {your token}' ``` -------------------------------- ### Create a project Source: https://docs.acrcloud.com/reference/console-api/base-projects Creates a new recognition project with specified configurations. This includes setting the project name, region, type, and content detection buckets. ```APIDOC ## POST /api/base-projects ### Description Creates a recognition project. ### Method POST ### Endpoint https://api-v2.acrcloud.com/api/base-projects ### Headers - **Authorization** (string) - Required - Bearer token ### Parameters #### Request Body - **name** (string) - Required - The project name - **region** (string) - Required - eu-west-1,us-west-2,ap-southeast-1 - **type** (string) - Required - AVR, LCD, HR. AVR is for music/custom content, LCD for live/time-shifting channels, HR for both. - **buckets** (array) - Required - The project detects content from the buckets. The format is bucket id array. - **audio_type** (string) - Optional - linein or recorded. Default is linein. recorded: Audio captured via microphone or noisy audio files. linein: Audio of original file or stream without noise. - **external_ids** (string) - Optional - spotify,deezer,isrc,upc,musicbrainz ### Response #### Success Response (200) - **data** (object) - Contains the details of the created project, including uid, access_key, access_secret, service_type, state, name, region, limits, audio_type, version, external_id, timestamps, id, buckets, status_check, and external_ids. ### Request Example ```json { "name": "test", "region": "eu-west-1", "buckets": [8881, 8883], "type": "AVR", "audio_type": "linein", "external_ids": ["spotify", "isrc", "deezer"] } ``` ### Response Example ```json { "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"] } } ``` ``` -------------------------------- ### Java Identification API Setup Source: https://docs.acrcloud.com/reference/identification-api/identification-api This Java code snippet provides utility methods for encoding data using Base64 and encrypting it with HMAC-SHA1, which are essential for generating the API signature. It also includes a method to get the current UTC time in seconds. You will need the 'commons-codec' library. ```java import java.io.BufferedOutputStream; import java.io.BufferedReader; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStreamReader; import java.net.HttpURLConnection; import java.net.URL; import java.util.Calendar; import java.util.HashMap; import java.util.Map; import javax.crypto.Mac; import javax.crypto.spec.SecretKeySpec; // import commons-codec-.jar, download from http://commons.apache.org/proper/commons-codec/download_codec.cgi import org.apache.commons.codec.binary.Base64; public class IdentifyProtocolV1 { private String encodeBase64(byte[] bstr) { Base64 base64 = new Base64(); return new String(base64.encode(bstr)); } private String encryptByHMACSHA1(byte[] data, byte[] key) { try { SecretKeySpec signingKey = new SecretKeySpec(key, "HmacSHA1"); Mac mac = Mac.getInstance("HmacSHA1"); mac.init(signingKey); byte[] rawHmac = mac.doFinal(data); return encodeBase64(rawHmac); } catch (Exception e) { e.printStackTrace(); } return ""; } private String getUTCTimeSeconds() { Calendar cal = Calendar.getInstance(); int zoneOffset = cal.get(Calendar.ZONE_OFFSET); int dstOffset = cal.get(Calendar.DST_OFFSET); ``` -------------------------------- ### Query Documentation API Source: https://docs.acrcloud.com/reference/console-api/bm-projects/metadata/custom-files Demonstrates how to query the documentation dynamically using an HTTP GET request with the 'ask' query parameter. This is useful for retrieving specific information or clarifications not explicitly present on the page. ```bash GET https://docs.acrcloud.com/reference/console-api/bm-projects/metadata/custom-files.md?ask= ``` -------------------------------- ### Query Documentation via HTTP GET Source: https://docs.acrcloud.com/reference/console-api/buckets/dedup-files Perform an HTTP GET request on the current page URL with the 'ask' query parameter to get dynamic information. The question should be specific and in natural language. ```http GET https://docs.acrcloud.com/reference/console-api/buckets/dedup-files.md?ask= ``` -------------------------------- ### Get a Bucket (PHP) Source: https://docs.acrcloud.com/reference/console-api/buckets This PHP snippet uses cURL to get bucket details. Replace 'your_access_token' with your actual Bearer token. ```php $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => 'https://api-v2.acrcloud.com/api/buckets/966', CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'GET', CURLOPT_HTTPHEADER => array( 'Accept: application/json', 'Authorization: Bearer your_access_token' ), )); $response = curl_exec($curl); curl_close($curl); echo $response; ``` -------------------------------- ### Querying Documentation via HTTP GET Source: https://docs.acrcloud.com/reference/console-api/file-scanning/metadata/custom-files Demonstrates how to query the documentation dynamically by appending an 'ask' parameter to the page URL. This is useful for obtaining specific information or clarifications not explicitly present on the page. ```http GET https://docs.acrcloud.com/reference/console-api/file-scanning/metadata/custom-files.md?ask= ``` -------------------------------- ### List Broadcast Database Projects Source: https://docs.acrcloud.com/reference/console-api/bm-projects/broadcast-database-projects This example shows how to list all Broadcast Database projects using cURL. You can filter by region and specify pagination parameters. Replace `{your token}` with your actual authorization token. ```bash curl --location --request GET 'https://api-v2.acrcloud.com/api/bm-bd-projects?region=eu-west-1&page=1&per_page=20' \ --header 'Accept: application/json' \ --header 'Authorization: Bearer {your token}' \ ``` -------------------------------- ### Query Documentation Source: https://docs.acrcloud.com/sdk-reference/mobile-sdk/android Use this GET request to query the documentation dynamically. Replace '' with your specific query. ```http GET https://docs.acrcloud.com/sdk-reference/mobile-sdk/android.md?ask= ```