# Get Data from AcoustID

This function is used to extract data from AcoustID.org based on a previously calculated fingerprint. A file will be skipped if:

- it does not have a UDTI named Acoustid Fingerprint.
- if a non empty UDTI named Acoustid Data already exists.
- if the Preferences - AcoustID - Retain status when getting AcoustID data option is set, and there is a UDTI named Acoustid Status which has a value of 1.

Note that this statement sets the Network Response property. If the returned data did not contain any results, it is not retained. The values returned in the Network Response property are as follows:

> 1
>   Data was downloaded but it did not contain any potential results.
> 2
>   No network access occurred because the fingerprint data did not exist.
> 3
>   No network access occurred because the AcoustID data was available in the track.
> 200
>   Successfully downloaded and imported the Acoustid Data.
> other
>   Data was not downloaded. The value is an HTTP status code.

When the Preferences - AcoustID - Retain status when getting AcoustID data option is set, Acoustid Status will be set based on the Network Response. Note that a Network Response of 3 will not modify an Acoustid Status of 200.

You can choose to suppress the display of errors in the UI by selecting the Ignore errors option. Note that when running in the Batch Processor, Ignore errors is assumed.

## Advanced Topic

If you have accumulated fingerprints in a database and you wish to lookup the AcoustID data associated with a fingerprint, you will more than likely be using a dummy file for the lookup. This function, by default, extracts a file's audio duration as part of the process. The duration is sent off to the AcoustID servers along with the fingerprint. If you wish to override the duration, you must set the AcoustID Duration Override named variable to the desired duration in ms. This will only work if this function is called on a single file. ie. you are executing grouped or only a single file is effectively selected. Note also, that the AcoustID Duration Override named variable is cleared after each call to this function. Sample usage:

- Set User Defined Text Item 'Acoustid Fingerprint' to ".... fingerprint data ...."
- Set named variable 'AcoustID Duration Override' to ".... desired duration ...."
- Get Data from AcoustID
- Get Property Network Response -> Variable 1
- Test if the numeric value of the Variable 1 field == "200" (Set result)
- if true
- - AcoustID Metadata List, save to Variable 0
  - Set named variable 'Extracted AcoustID information' to "\v0"
- else
- - ' ***** Something went wrong
- endif
- ' Restore the file to its initial state
- Revert