Protocol 2

To request this API you should use “application/x-www-form-urlencode” Content-Type. You should encode the data of the fingerprint or audio using base64 and urlencode. You can use this api to identify all of the audio formats or fingerprints extacted with our SDK. We suggest you use data type “fingerprint”, which will reduce the internet bandwidth and accelerate recognition speeds. Also we suggest you do not use large file to request this API, this can cause severe delays, its advised to reduce the file size before upload, files that are less than 15 seconds are generally better.

POST

Examples

View examples with the following languages: PHP, Python, Java, C# on Github.

Fields

NameTypeDescription
access_keyStringThe project access key
data_typeStringTwo data type: fingerprint or audio
sample_bytesNumberThe size of the data you want to identify
sampleStringThe binary data of fingerprint or audio, If the sample data is bigger than 1M, error will be returned, so you'd better cut large file to small file, within 15 seconds data size is better.
signature_versionNumberThe Version of generating signature
signatureStringRequests to ACRCloud must be signed—that is, they must include information that ACRCloud can use to authenticate the requestor.
string_to_sign = http_method+"\n"
+http_uri+"\n"
+access_key+"\n"
+data_type+"\n"
+signature_version+"\n"
+str(timestamp)
sign = base64.b64encode(hmac.new(access_secret, string_to_sign, digestmod=hashlib.sha1).digest())
timestampDatethe time since the Epoch (00:00:00 UTC, January 1, 1970), measured in millisecond.
audio_format (Optional)StringThe format of your audio data, like "mp3, wav, ma4, pcm, amr" etc, If your audio file does not have audio header, this parameter should be included
sample_rate (Optional)NumberIf your audio file does not have audio header, this parameter should be included
audio_channels (Optional)NumberIf your audio file does not have audio header, this parameter should be included

Allowed values: 1, 2

Metadata

Please find the result fields and descriptions on the Metadata page.

Error Result (Example)

Error Message

CodeDescription
1001No Result
3001Missing/Invalid Access Key
3002Invalid ContentType. valid Content-Type is multipart/form-data
3003Limit exceeded
3006Invalid parameters
3011metadata error
3014InvalidSignature
3015Could not generate fingerprint
3016The file you uploaded was too large, we sugguest you cut large file to smaller file, 10-20 seconds audio file is enough to identify