1

I'm trying to make a search request with NetEase Cloud Music's API. I have found the URL used for sending a search request over POST which is: http://music.163.com/api/search/get/web with x-www-form-urlencoded data: hlpretag=%3Cspan+class%3D%22s-fc56%22%3E&hlposttag=%3C%2Fspan%3E&s=ruslana&type=1&offset=0&total=false&limit=10.

Sending this request over produces a result like so:

{"result":"35b1748964afb6f6ab00803a07621642b1748964af8a7c1d883e3a6f3c773b3d42235da0ba9784a095beda502ab3e8b43fa71f6d6351854d2abf366ed520854009da31982d912f2f7dd26d69e2de683db1f5a185c8d2e83989d1c4b2c230a8669602ea79ebf70989a5b17264db4dabc8072d65deb133001e1236fd8bb37f850490980a4ed65fb639d5629556eff966c2b187d161ba859c63af417aaa447121564e8a4221525d5f0ac885a70ead44a613a07451cddfed5557af6572390e346375e6a91379f94b8530d942573735179b7bdadd3738e4e298e853ded86951b36d7e68ae593ebc6cad73d4e694d2c8debe3e162f84051dda75f10ff58521eb5d5bbf788a1603da61ded1d0b319e80d4bc73218e93665dd8559e420cdd7a0e74d443cd53b8dc20af99a89b3c14e64d9f9aadfc9cbb0b09db8c150e3ea793a1705fb710806ec39f24283c08489169c97527bafb59baed5215f769c55968829b222b3d320b11aab298da17104ddde48d9a77937a6ff100d5e12928d8917810338a51ebf2ef18c879c10a5b2d9c8f29d7524e70265d96ec9016be793f2bbbe55ec7994bb156a6baeda5c4884e6931731d8e6c0124ab298b518977c54c77cbb0eb601db25807ed2ac0d2eff3852427acd83ba0b38dda735b221467975b957074766912e6ea2b2791020bc4305489df1bb9880b47396d1716d01cff904ce4de0d20a4924e6ff220412dbe8305056463c35f7d22dafa3badffded51ee81b6045f5179f59166ec7f4115ecb5f9bb95e92c870a7f7045f1e7765bed3dbf62a09e963279a8ecb2316e39e2540bbe640b20a29a3098f5918aec7572f49ebcca1a3ae96b31927c2274d39ce6b26dd50d0431666a48649c37764010dc48156980022668fd2cec7b855e3a570464a077ffd1005553fd213111a98c2cb20ce50c59c350695b6c93519fd58ee0464e3ae5744873f1de490b0d6f308d6b05cbe59501028a8c8bd6f9a72d1ea6eae2b3ff4a451dc8413d25d611620f3a40b51019a36c2d2674a610bb2cfd2097c1ff3a91ee3b0b6262102dafc72dfd48ab398dea09e3a5d98c952c6674df981017954d222df1cf422403f032cd441f690be826593a50dbac35cb10b555f440e244b1e84e312f9fc0a4b8f5817a916fa4cb65487a12a4558d1adfa01017c6af5f16e2f9eded9c6bab1f62627fa3b3a313a89eeda80f7f4c408542d14ab3d333c0f915d552aedef29595e692dde790dd3b59de48434ff0d86ea13704fbc6f1c8720e82ee2a319d3b779989337239a8","code":200,"abroad":true}

I have cut off most of result due to it being colossal. What is the data in result and how is it encoded? Looking through other peoples efforts turns up nothing to contribute either. On this Github project I've found there's a function for searches, it doesn't seem to do anything significant to the returned data:

 def search(self, s, stype=1, offset=0, total='true', limit=60):
        action = 'http://music.163.com/api/search/get/web' 
        print self.cookies
        data = {
            's': s,
            'type': stype,
            'offset': offset,
            'total': total,
            'limit': 60,
            '__csrf': self.cookies['__csrf'],
        }
        return self.httpRequest('POST', action, data)

And when you look on the NetEase website itself and look at the API calls after a search, theres nothing, so its not like theres an extra API call involved in getting all the search data either.

Any input on this would be greatly appreciated.

2
  • Have you tried reverse engineering the client to determine how it decodes result? May 31, 2015 at 13:51
  • Decompiled the Android app and it doesnt return any significant findings. I have also been looking at other peoples projects that use the search API call and it too doesnt look like any thing significant goes on...Weird. May 31, 2015 at 15:21

1 Answer 1

2

The answer is embarrassingly simple. Simply remove the /web part of the URL so you end up with something like this: http://music.163.com/api/search/get/ and you're good to go.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.