AcoustID web service POST request

acoustid
Tags: #<Tag:0x00007f2a03d74888>

#1

Hello,

Long time user of various Brainz services, first time poster, please accept my apologies if I am posting in the wrong place, etc.

What I’m trying to do; get a fingerprint with chromaprint, forward this to the AcoustID web service to identify the track and then do other stuff I haven’t quite figured out yet.

I’m struggling with the POST method, If I construct the request so it reads:

http://api.acoustid.org/v2/lookup?client=my_api_key&duration=358&fingerprint=helloiamafingerprint

It works and all is well with the world. Ideally I would like to supply the fingerprint and duration via a JSON file, so I open the developer tools on Firefox and and it looks like:

And I’m getting the error:

“missing required parameter “fingerprint””

Can anyone shed any light as to how I can get the track metadata sent via this method or isn’t it doable (or more likely, I’m missing something totally obvious).

Thanks in advance

Ian


#2

Run fpcalc over the song to generate a fingerprint (a long string of ascii characters)
This is then posted to the web service in parameters to the url.
you then get a response back in json where you can find the id’s.

you don’t put the fingerprint in the payload, it goes in as a parameter ie part of the url.


#3

Hi, many thanks for the reply.

Run fpcalc over the song to generate a fingerprint (a long string of ascii characters)
This is then posted to the web service in parameters to the url.
you then get a response back in json where you can find the id’s.

Done all this, sorry, I should have made that clearer.

According to the docs found here, it says:

Compression

Even though compressing HTTP requests is not a common practice, 
our web server supports GZip-compressed bodies for HTTP POST requests. 
If you compress the body using GZip and set the "Content-Encoding" HTTP 
header to "gzip", we will decode it before parsing the parameters.

Because there is mention of compressing the request due to the size of the fingerprint, I thought this would have been the preferred method. Again, apologies if I have misunderstood.

Cheers


#4

Probably the best place to ask is there message boards.
https://groups.google.com/forum/?fromgroups=#!forum/acoustid
you seem to have covered the examples:
https://acoustid.org/webservice

Interesting though I didn’t know that the api had a duration field. Picard doesn’t seem to use this looking at the packets. Maybe it is somehow included in the fingerprint (but not sure of teh explicit duration parameter in that case) or maybe it is an oversight.