美文网首页
QQ空间音乐免费API接口说明

QQ空间音乐免费API接口说明

作者: 西草锅锅 | 来源:发表于2017-10-30 09:07 被阅读0次

    这个接口是以JSON和XML做返回值处理的,默认为返回JSON。


    API接口返回值为JSON:

    返回为 JSON 请求地址是:

         http://www.sojson.com/api/qqmusic/8446666
    

    REST 风格 API ,后面的数字是QQ号,默认返回 JSON ,也可以这样:

    http://www.sojson.com/api/qqmusic/8446666/json
    

    请求 JSON 的返回值如下,带一个状态status,如果错误会返回500,成功返回200:

    {
        "status": 200,
        "data": {
            "curtime": "1469025820",
            "issmarter": "0",
            "xmusicnum": "3",
            "picurl": [],
            "playlist": [
                {
                    "xqusic_mid": "000aB5HG4dioBi ",
                    "xqusic_id": "4831024",
                    "xctype": "3",
                    "xexpire_time": "0",
                    "xdesc": " ",
                    "xsong_name": "海誓山盟亦会分开 ",
                    "xsinger_name": "本兮 ",
                    "xsong_url": "http://stream6.qqmusic.qq.com/16831024.wma ",
                    "xsong_size": "2496570",
                    "xsong_playtime": "289",
                    "xsong_diskname": "无底线 ",
                    "xsong_dissmid": [
                        "004LrhoF44bRf2 ",
                        "004LrhoF44bRf2 "
                    ],
                    "xsong_dissid": "193826",
                    "xis_word": "0",
                    "xcopy_right": "0",
                    "xsinger_id": "4545",
                    "xsinger_mid": "003LaMHm42u7qS "
                },
                {
                    "xqusic_mid": "0019kz9c1QBWNA ",
                    "xqusic_id": "2633764432",
                    "xctype": "1",
                    "xexpire_time": "0",
                    "xdesc": " ",
                    "xsinger_name": "文艺范电台 ",
                    "xsong_name": "文艺范电台 ",
                    "xsong_url": "http://img.wenyifan.net/20131221/5/1387627094890.mp3 ",
                    "xsong_size": "0",
                    "xsong_playtime": "0",
                    "xsong_diskname": "0",
                    "xsong_dissmid": "0047airw212ppN ",
                    "xsong_dissid": "0",
                    "xis_word": "-999",
                    "xcopy_right": "-999",
                    "xsinger_id": "-999"
                },
                {
                    "xqusic_mid": "001rVHgt15aRmM ",
                    "xqusic_id": "699379606",
                    "xctype": "5",
                    "xexpire_time": "0",
                    "xdesc": " ",
                    "xsinger_name": "soso ",
                    "xsong_name": "8446666.mp3 ",
                    "xsong_url": "http://streamrdt.music.qq.com/8138.83a798500d5cb2b63f442ec3ee215a8d/1081067841469025820/8138.83a798500d.html ",
                    "xsong_size": "0",
                    "xsong_playtime": "0",
                    "xsong_diskname": "0",
                    "xsong_dissmid": "0047airw212ppN ",
                    "xsong_dissid": "0",
                    "xis_word": "-999",
                    "xcopy_right": "-999",
                    "xsinger_id": "-999"
                }
            ],
            "systemtime": "1469025820"
        },
        "type": "json"
    }
    

    API接口返回值为XML:

    如果需要返回 XML

         http://www.sojson.com/api/qqmusic/8446666/xml
    

    请求 XML 的返回值如下,带一个状态status,如果错误会返回500,成功返回200:

    {
        "status": 200,
        "data": "<?xml version=\"1.0\" encoding=\"gb2312\"?>\n<qqmusic>\n<curtime>1469025922</curtime>\n<issmarter>0</issmarter>\n<xmusicnum>3</xmusicnum><picurl></picurl><playlist><song><xqusic_mid><![CDATA[000aB5HG4dioBi ]]></xqusic_mid>\n<xqusic_id>4831024</xqusic_id>\n<xctype>3</xctype>\n<xexpire_time>0</xexpire_time>\n<xdesc><![CDATA[ ]]></xdesc>\n<xsong_name><![CDATA[海誓山盟亦会分开 ]]></xsong_name>\n<xsinger_name><![CDATA[本兮 ]]></xsinger_name>\n<xsong_url><![CDATA[http://stream6.qqmusic.qq.com/16831024.wma ]]></xsong_url>\n<xsong_size>2496570</xsong_size>\n<xsong_playtime>289</xsong_playtime>\n<xsong_diskname><![CDATA[无底线 ]]></xsong_diskname>\n<xsong_dissmid><![CDATA[004LrhoF44bRf2 ]]></xsong_dissmid>\n<xsong_dissid>193826</xsong_dissid>\n<xis_word>0</xis_word>\n<xcopy_right>0</xcopy_right>\n<xsinger_id>4545</xsinger_id>\n<xsinger_mid><![CDATA[003LaMHm42u7qS ]]></xsinger_mid>\n<xsong_dissmid><![CDATA[004LrhoF44bRf2 ]]></xsong_dissmid>\n</song><song><xqusic_mid><![CDATA[0019kz9c1QBWNA ]]></xqusic_mid>\n<xqusic_id>2633764432</xqusic_id>\n<xctype>1</xctype>\n<xexpire_time>0</xexpire_time>\n<xdesc><![CDATA[ ]]></xdesc>\n<xsinger_name><![CDATA[文艺范电台 ]]></xsinger_name>\n<xsong_name><![CDATA[文艺范电台 ]]></xsong_name>\n<xsong_url><![CDATA[http://img.wenyifan.net/20131221/5/1387627094890.mp3 ]]></xsong_url>\n<xsong_size>0</xsong_size>\n<xsong_playtime>0</xsong_playtime>\n<xsong_diskname>0</xsong_diskname>\n<xsong_dissmid><![CDATA[0047airw212ppN ]]></xsong_dissmid>\n<xsong_dissid>0</xsong_dissid>\n<xis_word>-999</xis_word><xcopy_right>-999</xcopy_right><xsinger_id>-999</xsinger_id></song><song><xqusic_mid><![CDATA[001rVHgt15aRmM ]]></xqusic_mid>\n<xqusic_id>699379606</xqusic_id>\n<xctype>5</xctype>\n<xexpire_time>0</xexpire_time>\n<xdesc><![CDATA[ ]]></xdesc>\n<xsinger_name><![CDATA[soso ]]></xsinger_name>\n<xsong_name><![CDATA[8446666.mp3 ]]></xsong_name>\n<xsong_url><![CDATA[http://streamrdt.music.qq.com/8138.83a798500d5cb2b63f442ec3ee215a8d/1081067841469025922/8138.83a798500d.html ]]></xsong_url>\n<xsong_size>0</xsong_size>\n<xsong_playtime>0</xsong_playtime>\n<xsong_diskname>0</xsong_diskname>\n<xsong_dissmid><![CDATA[0047airw212ppN ]]></xsong_dissmid>\n<xsong_dissid>0</xsong_dissid>\n<xis_word>-999</xis_word><xcopy_right>-999</xcopy_right><xsinger_id>-999</xsinger_id></song></playlist><systemtime>1469025922</systemtime>\n</qqmusic>\n",
        "type": "xml"
    }
    

    返回也是 JSON 的,只不过 XML 在 data 里。

    恩,虽然没啥用,但是可以看看你的女/男神最近在听什么歌。。。。。聊胜于无。。。。

    注:点我查看原网页

    相关文章

      网友评论

          本文标题:QQ空间音乐免费API接口说明

          本文链接:https://www.haomeiwen.com/subject/ssxppxtx.html