文档中心 > API类目 > 曲库开放平台歌曲API

xiami.content.songs.info.query (搜索歌曲列表)

多维度查询歌曲列表

公共参数

请求参数

名称 类型 是否必须 示例值 更多限制 描述
search_terms SearchTermsDto [] 可选
  • 最大列表长度:999
  • 搜索条件 key支持songName/singerName/copyrightStatus/publishStatus/keyword
    • └ value
    • String
    • 可选
    • 小幸运
    • 搜索的value。songName:歌曲名称;singerName:演唱者名称;lyric:歌词文本(只匹配前50字符); copyrightStatus:版权状态 0下架/1上架;publishStatus:发布状态 0未发布/1发布; keyword:关键字搜索(与songName/singerName互斥); lyric:歌词搜索,限制字符数50
    • └ key
    • String
    • 可选
    • songName
    • 搜索key:songName/singerName/lyric/copyrightStatus/publishStatus/keyword/lyric
    tag_optional SongCatsSearchDto 可选 tag搜索条件,tag尽量不要超过50个
    • └ relation
    • Number
    • 可选
    • 1
    • 标签类目间的关系查询 1 and 2:or
    • cat_tag_codes
    • SongCatTagDto []
    • 可选
    • 标签组列表
    • └ relation
    • Number
    • 可选
    • 1
    • tag间的关系查询 1 and 2:or
    • └ tag_codes
    • String []
    • 可选
    • tagCodes
    • tag code列表
    order_by Number 可选 1 排序,默认按照最新排序 1最新 2本周最热 3本月最热
    page PagingVo 必须 分页信息
    • └ page_size
    • Number
    • 必须
    • 20
    • 每页展示数
    • └ page
    • Number
    • 必须
    • 1
    • 页码

    响应参数

    名称 类型 示例值 描述
    songs Page songs 返回的歌曲信息
    • song_list
    • SongInfoDto []
    • data
    • 歌曲列表
    • singers
    • ArtistDto []
    • singers
    • 演唱者列表
    • └ area
    • String
    • China 中国大陆
    • 地域
    • └ gender
    • String
    • M
    • 性别
    • └ alias
    • String
    • 左小祖咒
    • 艺人别名
    • └ artist_name
    • String
    • 左小祖咒
    • 艺人名
    • └ artist_logo
    • String
    • http://pic.xiami.net/images/artistlogo/67/15483850525367.jpg
    • 艺人头像
    • └ artist_id
    • Number
    • 1290
    • 艺人id
    • └ song_name
    • String
    • 叔叔喜欢下象棋
    • 歌曲名
    • composers
    • ArtistDto []
    • composers
    • 作曲人列表
    • └ area
    • String
    • China 中国大陆
    • 地域
    • └ gender
    • String
    • M
    • 性别
    • └ alias
    • String
    • 左小祖咒
    • 艺人别名
    • └ artist_name
    • String
    • 左小祖咒
    • 艺人名
    • └ artist_logo
    • String
    • http://pic.xiami.net/images/artistlogo/67/15483850525367.jpg
    • 艺人头像
    • └ artist_id
    • Number
    • 1290
    • 艺人id
    • artists
    • ArtistDto []
    • artist
    • 专辑艺人
    • └ area
    • String
    • China 中国大陆
    • 地域
    • └ gender
    • String
    • M
    • 性别
    • └ alias
    • String
    • 左小祖咒
    • 艺人别名
    • └ artist_name
    • String
    • 左小祖咒
    • 艺人名
    • └ artist_logo
    • String
    • http://pic.xiami.net/images/artistlogo/67/15483850525367.jpg
    • 艺人头像
    • └ artist_id
    • Number
    • 1290
    • 艺人id
    • album
    • AlbumDto
    • album
    • 专辑
    • └ album_logo
    • String
    • http://pic.xiami.net/images/album/img90/1290/7769913111376991311.jpg
    • 专辑封面
    • └ album_name
    • String
    • 一座城池 电影原声带
    • 专辑名称
    • └ sub_name
    • String
    • 一座城池
    • 专辑副标题
    • └ album_status
    • Number
    • 1
    • 专辑状态 1-已发布 0-未发布
    • └ gmt_publish
    • String
    • 1376582400000
    • 专辑发行时间
    • └ album_id
    • Number
    • 776991311
    • 专辑id
    • └ language
    • String
    • 纯音乐
    • 专辑语种
    • songwriters
    • ArtistDto []
    • songwriters
    • 作词人列表
    • └ area
    • String
    • China 中国大陆
    • 地域
    • └ gender
    • String
    • M
    • 性别
    • └ alias
    • String
    • 左小祖咒
    • 艺人别名
    • └ artist_name
    • String
    • 左小祖咒
    • 艺人名
    • └ artist_logo
    • String
    • http://pic.xiami.net/images/artistlogo/67/15483850525367.jpg
    • 艺人头像
    • └ artist_id
    • Number
    • 1290
    • 艺人id
    • producers
    • ArtistDto []
    • producers
    • 制作人列表
    • └ area
    • String
    • China 中国大陆
    • 地域
    • └ gender
    • String
    • M
    • 性别
    • └ alias
    • String
    • 左小祖咒
    • 艺人别名
    • └ artist_name
    • String
    • 左小祖咒
    • 艺人名
    • └ artist_logo
    • String
    • http://pic.xiami.net/images/artistlogo/67/15483850525367.jpg
    • 艺人头像
    • └ artist_id
    • Number
    • 1290
    • 艺人id
    • tags
    • TagLink []
    • tags
    • 标签列表
    • parent
    • TagCatLink
    • parent
    • tag直属类目
    • parent
    • TagCatLink
    • parent
    • tag根类目
    • └ code
    • String
    • cat_2_563_4_163873331
    • 根类目code
    • └ name_cn
    • String
    • 流派
    • 根类目中文名
    • └ description
    • String
    • 描述
    • 根类目描述
    • └ pid
    • Number
    • 0
    • 父类目 根类目没有父类目,该字段为0
    • └ id
    • Number
    • 1
    • 根类目id
    • └ name_en
    • String
    • style
    • 根类目英文名
    • └ code
    • String
    • cat_2_563_4_163873331
    • 直属类目code
    • └ name_cn
    • String
    • 流行
    • 直属类目中文名
    • └ description
    • String
    • 描述
    • 直属类目描述
    • └ pid
    • Number
    • 1232
    • 直属类目根类目,如果为0则该类目为根类目
    • └ id
    • Number
    • 1
    • 直属类目id
    • └ name_en
    • String
    • popular
    • 直属类目英文名
    • └ code
    • String
    • cat_2_563_4_163873331
    • tag code(唯一标识一个tag)
    • └ name_cn
    • String
    • 电子流行
    • tag名称
    • └ description
    • String
    • 描述
    • tag描述
    • └ pid
    • Number
    • 1232
    • 父类目id
    • └ id
    • Number
    • 1
    • tag id(唯一标识一个tag)
    • └ name_en
    • String
    • electropop
    • tag英文名
    • └ copyright_status
    • Number
    • 0
    • 1-版权上架, 0-版权下架
    • arrangements
    • ArtistDto []
    • arrangements
    • 编曲人列表
    • └ area
    • String
    • China 中国大陆
    • 地域
    • └ gender
    • String
    • M
    • 性别
    • └ alias
    • String
    • 左小祖咒
    • 艺人别名
    • └ artist_name
    • String
    • 左小祖咒
    • 艺人名
    • └ artist_logo
    • String
    • http://pic.xiami.net/images/artistlogo/67/15483850525367.jpg
    • 艺人头像
    • └ artist_id
    • Number
    • 1290
    • 艺人id
    • lyrics
    • LyricDto []
    • lyrics
    • 歌词列表
    • └ lyric_type
    • Number
    • LRC
    • 歌词类型 TXT LRC TRC TLRC TTRC
    • └ lyric_id
    • Number
    • 251062117
    • 歌词id
    • └ lyric_url
    • String
    • http://img.xiami.net/lyric/36/2103473336_1595920458404_5723.LRC
    • 歌词地址
    • └ song_sub_name
    • String
    • 歌曲副标题
    • 歌曲副标题
    • └ song_id
    • Number
    • 1772118366
    • 歌曲id
    • └ publish_status
    • Number
    • 1
    • 歌曲发布状态, 1-已发布, 0-未发布
    • └ duration
    • Number
    • 120000
    • 歌曲时长(单位毫秒),没有对应的音频文件时为0
    • └ waveform_url
    • String
    • http://img.xiami.net//wave/2104408824_1615443436340.txt
    • 波形图文件地址
    • paging
    • PagingVo
    • paging
    • 分页信息
    • └ pages
    • Number
    • 1
    • 数据总页数
    • └ count
    • Number
    • 2
    • 数据总数
    • └ page_size
    • Number
    • 10
    • 每页展示数
    • └ page
    • Number
    • 1
    • 页码
    result_code ResultCode ResultCode 系统自动生成
    • └ msg
    • String
    • success
    • result message
    • └ code
    • Number
    • 0
    • result code

    请求示例

    • JAVA
    • .NET
    • PHP
    • CURL
    • Python
    • C/C++
    • NodeJS
    TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
    XiamiContentSongsInfoQueryRequest req = new XiamiContentSongsInfoQueryRequest();
    List<XiamiContentSongsInfoQueryRequest.SearchTermsDto> list2 = new ArrayList<XiamiContentSongsInfoQueryRequest.SearchTermsDto>();
    XiamiContentSongsInfoQueryRequest.SearchTermsDto obj3 = new XiamiContentSongsInfoQueryRequest.SearchTermsDto();
    list2.add(obj3);
    obj3.setValue("小幸运");
    obj3.setKey("songName");
    req.setSearchTerms(list2);
    XiamiContentSongsInfoQueryRequest.SongCatsSearchDto obj4 = new XiamiContentSongsInfoQueryRequest.SongCatsSearchDto();
    obj4.setRelation(1L);
    List<XiamiContentSongsInfoQueryRequest.SongCatTagDto> list6 = new ArrayList<XiamiContentSongsInfoQueryRequest.SongCatTagDto>();
    XiamiContentSongsInfoQueryRequest.SongCatTagDto obj7 = new XiamiContentSongsInfoQueryRequest.SongCatTagDto();
    list6.add(obj7);
    obj7.setRelation(1L);
    obj7.setTagCodes("tagCodes");
    obj4.setCatTagCodes(list6);
    req.setTagOptional(obj4);
    req.setOrderBy(1L);
    XiamiContentSongsInfoQueryRequest.PagingVo obj8 = new XiamiContentSongsInfoQueryRequest.PagingVo();
    obj8.setPageSize(20L);
    obj8.setPage(1L);
    req.setPage(obj8);
    XiamiContentSongsInfoQueryResponse rsp = client.execute(req, sessionKey);
    System.out.println(rsp.getBody());

    响应示例

    • XML示例
    • JSON示例
    <xiami_content_songs_info_query_response>
        <songs>
            <song_list>
                <song_info_dto>
                    <singers>
                        <artist_dto>
                            <area>China 中国大陆</area>
                            <gender>M</gender>
                            <alias>左小祖咒</alias>
                            <artist_name>左小祖咒</artist_name>
                            <artist_logo>http://pic.xiami.net/images/artistlogo/67/15483850525367.jpg</artist_logo>
                            <artist_id>1290</artist_id>
                        </artist_dto>
                    </singers>
                    <song_name>叔叔喜欢下象棋</song_name>
                    <composers>
                        <artist_dto>
                            <area>China 中国大陆</area>
                            <gender>M</gender>
                            <alias>左小祖咒</alias>
                            <artist_name>左小祖咒</artist_name>
                            <artist_logo>http://pic.xiami.net/images/artistlogo/67/15483850525367.jpg</artist_logo>
                            <artist_id>1290</artist_id>
                        </artist_dto>
                    </composers>
                    <artists>
                        <artist_dto>
                            <area>China 中国大陆</area>
                            <gender>M</gender>
                            <alias>左小祖咒</alias>
                            <artist_name>左小祖咒</artist_name>
                            <artist_logo>http://pic.xiami.net/images/artistlogo/67/15483850525367.jpg</artist_logo>
                            <artist_id>1290</artist_id>
                        </artist_dto>
                    </artists>
                    <album>
                        <album_logo>http://pic.xiami.net/images/album/img90/1290/7769913111376991311.jpg</album_logo>
                        <album_name>一座城池 电影原声带</album_name>
                        <sub_name>一座城池</sub_name>
                        <album_status>1</album_status>
                        <gmt_publish>1376582400000</gmt_publish>
                        <album_id>776991311</album_id>
                        <language>纯音乐</language>
                    </album>
                    <songwriters>
                        <artist_dto>
                            <area>China 中国大陆</area>
                            <gender>M</gender>
                            <alias>左小祖咒</alias>
                            <artist_name>左小祖咒</artist_name>
                            <artist_logo>http://pic.xiami.net/images/artistlogo/67/15483850525367.jpg</artist_logo>
                            <artist_id>1290</artist_id>
                        </artist_dto>
                    </songwriters>
                    <producers>
                        <artist_dto>
                            <area>China 中国大陆</area>
                            <gender>M</gender>
                            <alias>左小祖咒</alias>
                            <artist_name>左小祖咒</artist_name>
                            <artist_logo>http://pic.xiami.net/images/artistlogo/67/15483850525367.jpg</artist_logo>
                            <artist_id>1290</artist_id>
                        </artist_dto>
                    </producers>
                    <tags>
                        <tag_link>
                            <parent>
                                <parent>
                                    <code>cat_2_563_4_163873331</code>
                                    <name_cn>流派</name_cn>
                                    <description>描述</description>
                                    <pid>0</pid>
                                    <id>1</id>
                                    <name_en>style</name_en>
                                </parent>
                                <code>cat_2_563_4_163873331</code>
                                <name_cn>流行</name_cn>
                                <description>描述</description>
                                <pid>1232</pid>
                                <id>1</id>
                                <name_en>popular</name_en>
                            </parent>
                            <code>cat_2_563_4_163873331</code>
                            <name_cn>电子流行</name_cn>
                            <description>描述</description>
                            <pid>1232</pid>
                            <id>1</id>
                            <name_en>electropop</name_en>
                        </tag_link>
                    </tags>
                    <copyright_status>0</copyright_status>
                    <arrangements>
                        <artist_dto>
                            <area>China 中国大陆</area>
                            <gender>M</gender>
                            <alias>左小祖咒</alias>
                            <artist_name>左小祖咒</artist_name>
                            <artist_logo>http://pic.xiami.net/images/artistlogo/67/15483850525367.jpg</artist_logo>
                            <artist_id>1290</artist_id>
                        </artist_dto>
                    </arrangements>
                    <lyrics>
                        <lyric_dto>
                            <lyric_type>LRC</lyric_type>
                            <lyric_id>251062117</lyric_id>
                            <lyric_url>http://img.xiami.net/lyric/36/2103473336_1595920458404_5723.LRC</lyric_url>
                        </lyric_dto>
                    </lyrics>
                    <song_sub_name>歌曲副标题</song_sub_name>
                    <song_id>1772118366</song_id>
                    <publish_status>1</publish_status>
                    <duration>120000</duration>
                    <waveform_url>http://img.xiami.net//wave/2104408824_1615443436340.txt</waveform_url>
                </song_info_dto>
            </song_list>
            <paging>
                <pages>1</pages>
                <count>2</count>
                <page_size>10</page_size>
                <page>1</page>
            </paging>
        </songs>
        <result_code>
            <msg>success</msg>
            <code>0</code>
        </result_code>
    </xiami_content_songs_info_query_response>

    异常示例

    • XML示例
    • JSON示例
    <error_response>
        <code>50</code>
        <msg>Remote service error</msg>
        <sub_code>isv.invalid-parameter</sub_code>
        <sub_msg>非法参数</sub_msg>
    </error_response>

    错误码解释

    错误码 错误描述 解决方案

    API工具

    如何获得此API

    FAQ

    返回
    顶部