The introduction

The project will build a high quality mobile music WebApp based on the React Family Bucket (using the latest 16.8 API and hooks) and mobx data streaming solution.

The main technology stacks involved are:

  • React V16.8 react (React – Router) : MVVM framework for building user interfaces
  • Mobx front-end data flow scheme
  • Immutable: A library that Facebook has been developing for three years for processing persistent data structures
  • Axios: Data used to request the back-end API.

This is the first article, mainly about the implementation of netease Cloud EggJs API. The following data will come from the official data of netease Cloud. Netease Cloud Music EggJs VERSION API, Github address and interface are being updated continuously. Currently, most interfaces of netease Cloud Music are supported, including login and registration.

The working principle of

Cross-site request forgery (CSRF), which forges the request header and calls the official API.

Special statement

This project does not provide online demo, please do not easily trust and use the public services provided by others, in order to avoid security problems and leak your account and password

For example, if the login interface of some interfaces is invoked too frequently, error 503 or IP high-frequency error may be triggered. To invoke these interfaces frequently, you need to prepare an IP proxy pool.

This project is for study only, please respect copyright, do not use this project for commercial activities

EggJS middleware implementation

A brief mention of EggJs’s middleware. Egg is implemented based on Koa, so the middleware form of Egg is the same as the MIDDLEWARE form of Koa, based on the Onion ring model.

Processing cookie middleware

/** * handle cookies */
module.exports = (a)= > {
  return async function (ctx, next) {
    const { response } = ctx;
    await next();
    response.append('Set-Cookie', response.body && response.body.cookie);
  };
};
Copy the code

Error handling middleware

module.exports = (a)= > {
  return async function (ctx, next) {
    try {
      await next();
    } catch(error) { ctx.body = error.body; ctx.status = error.status; }}; };Copy the code

Consists of an interface

In particular, the interface demonstration uses the following format

Method /xxx/:xxxx/xxx

@body:
{
	"* * *": "* * * * * * * * * *"."* *"? :"* * * * * * * * *" / /? On behalf of the optional
}

@param:
{
    "* * *": "* * * * * * * *"
}

@query:
{
    "* * *": "* * * * * * * * * * *"."* * *"? :"* * * * * * * * * *"
}

Copy the code

Parameter description limit: indicates the number of returned pages. The default value is 30. Offset: indicates the number of offset pages, for example, (current page number -1)*30, where 30 is the limit value and the default value is 0

1. Login module

1.1 Login using mobile Phone Number

Mandatory parameters:

Phone: indicates the mobile phone number. Password: indicates the passwordCopy the code

Interface address:

/login/cellphone
Copy the code

Optional parameters:

RememberLogin: 30 days without login, defaultfalse
Copy the code

Call examples:

POST /login/cellphone

@body:
{
	phone: "* * * * * * * * * *".password: "* * * * *", rememberLogin? :true

}
Copy the code

1.2 Mailbox Login

Mandatory parameters:

Email: mobile phone number password: passwordCopy the code

Interface address:

/login/email
Copy the code

Optional parameters:

RememberLogin: 30 days without login, defaultfalse
Copy the code

Call examples:

POST /login/email

@body:
{
	email: "* * * * * * * * * *".password: "* * * * *".rememberLogin: true
}
Copy the code

1.3 Initializing nicknames

Mandatory parameters:

Nickname: nicknameCopy the code

Interface address:

/login/init/profile
Copy the code

Call examples:

POST /login/init/profile

@body
{
	nickname: "* * * * * * * * * *"
}
Copy the code

1.4 Sending the Mobile Phone Verification Code

Mandatory parameters:

There is no cellphone numberCopy the code

Interface address:

/login/sms/captcha/send
Copy the code

Optional parameters:

Ctcode: Indicates the country code. The default value is 86Copy the code

Call examples:

POST /login/sms/captcha/send

// body{ ctcode? :"86".cellphone: "* * * * * * *"
}
Copy the code

1.5 Verifying mobile phone verification codes

Mandatory parameters:

Cellphone number captCHA: Indicates the verification codeCopy the code

Interface address:

/login/sms/captcha/verify
Copy the code

Optional parameters:

Ctcode: Indicates the country code. The default value is 86Copy the code

Call examples:

POST /login/sms/captcha/verify

// body{ ctcode? :"86".cellphone: "* * * * * * *".captcha: "* * * *"
}
Copy the code

1.6 Check whether the mobile phone number is registered

Mandatory parameters:

There is no cellphone numberCopy the code

Interface address:

/login/cellphone/check/exist
Copy the code

Optional parameters:

Countrycode: specifies the countrycode used to log in to a foreign mobile phone number, such as: 1Copy the code

Call examples:

POST /login/cellphone/check/exist

// body{ countrycode? :"86".cellphone: "* * * * * * *"
}
Copy the code

1.7 Refreshing Login

Interface address:

/login/refresh

Call examples:

GET / login / refresh;
Copy the code

1.8 Obtaining the Login Status

Interface address:

/login/status
Copy the code

Call examples:

GET / login / status;
Copy the code

1.9 Logging Out

Interface address:

/logout
Copy the code

Call examples:

GET / logout;
Copy the code

2. User module

2.1 Obtaining User Recordings

After logging in to call this interface, you can obtain the radio created by the user

Mandatory parameters:

There is noCopy the code

Interface address:

/user/audios
Copy the code

Optional parameters:

There is noCopy the code

Call examples:

GET / user / audios;
Copy the code

2.2 Deleting a Song from a User cloud Disk

Note: Call this interface after login, you can delete cloud disk songs

Mandatory parameters:

Ids: Array of song idsCopy the code

Interface address:

/user/cloud/song/del
Copy the code

Optional parameters:

There is noCopy the code

Call examples:

DELETE /user/cloud/song/del

@body
{
    ids: ["* * * *"."* * * *"]}Copy the code

2.3 Obtaining User Cloud Disk Data Details

Note: Call this interface after login, pass in cloud disk song IDS, you can obtain cloud disk data details

Mandatory parameters:

Ids: For multiple song ids","separatedCopy the code

Interface address:

/user/cloud/songs/info
Copy the code

Optional parameters:

There is noCopy the code

Call examples:

GET /user/cloud/songs/info

@query
{
	ids: "* * *, * * *"
}
Copy the code

2.4 Obtaining the Cloud Disk Music List

Note: After login, call this interface to obtain cloud disk data, but the obtained data does not have a corresponding URL. You need to call /song/ URL again to obtain the URL.

Mandatory parameters:

There is noCopy the code

Interface address:

/user/cloud
Copy the code

Optional parameters:

limitThe default value is 30. Offset: number of offsets used for paging, for example, (current page number -1)*30, where 30 islimitThe default value is 0Copy the code

Call examples:

GET /user/cloud

// query{ limit? :100, offset? :1
}
Copy the code

2.5 Obtaining User Information

Note: Call this interface after login, you can obtain user details

Mandatory parameters:

There is noCopy the code

Interface address:

/user/info
Copy the code

Optional parameters:

There is noCopy the code

Call examples:

GET / user / info;
Copy the code

2.6 Obtaining user Radio stations

After logging in to call this interface, you can obtain the user radio

Mandatory parameters:

There is no cellphone numberCopy the code

Interface address:

There is noCopy the code

Optional parameters:

There is noCopy the code

Call examples:

GET / user / djs;
Copy the code

2.7 Obtaining User Dynamics

After logging in to call this interface, you can get the user dynamic

Mandatory parameters:

There is noCopy the code

Interface address:

/user/event
Copy the code

Optional parameters:

limit: Number returned, default is 30 lastTime: return the lasttime of the data, default is -1, pass the lasttime of the last result, will return the data of the next pageCopy the code

Call examples:

GET /user/event @query { limit? :30.lasttime: - 1
}
Copy the code

2.8 Gaining fans

Note: Call this interface after login, you can get the user fan list

Mandatory parameters:

There is noCopy the code

Interface address:

/user/followeds
Copy the code

Optional parameters:

Optional parameters:limit: Number returned, default is 30 lastTime: return the lasttime of the data, default is -1, pass the lasttime of the last result, will return the data of the next pageCopy the code

Call examples:

GET /user/followeds @query { limit? :30.lasttime: - 1
}
Copy the code

2.9 Acquiring user followers

Note: After logging in to call this interface, you can obtain the user concern list

Mandatory parameters:

There is noCopy the code

Interface address:

/user/follows
Copy the code

Optional parameters:

limitThe default value is 30. Offset: number of offsets used for paging, for example, (current page number -1)*30, where 30 islimitThe default value is 0Copy the code

Call examples:

GET /user/follows @query { limit? :30, offset? :1
}
Copy the code

2.10 Obtaining a User Playlist

Note: Call this interface after login, you can obtain the user song list

Mandatory parameters:

There is noCopy the code

Interface address:

/user/playlist
Copy the code

Optional parameters:

limitThe default value is 30. Offset: number of offsets used for paging, for example, (current page number -1)*30, where 30 islimitThe default value is 0Copy the code

Call examples:

GET /user/playlist @query { limit? :30, offset? :1
}
Copy the code

2.11 Obtaining User Playback Records

Note: Call this interface after login, users can obtain playback records

Mandatory parameters:

There is noCopy the code

Interface address:

/user/playrecord
Copy the code

Optional parameters:

type: typeIf =1, only weekly data is returned,type=0 returns all dataCopy the code

Call examples:

GET /user/playrecord @query { type? :0
}
Copy the code

2.12 Obtaining the Collection Count of users

Note: After logging in to call this interface, users can obtain the collection count

Mandatory parameters:

There is noCopy the code

Interface address:

/user/subcount
Copy the code

Optional parameters:

There is noCopy the code

Call examples:

GET / user / subcount;
Copy the code

2.13 Updating User Information

After login, call this interface, pass in the relevant information, you can update the user information

Mandatory parameters:

Gender: 0: secret 1: male 2: female Birthday: date of birth, timestamp Unix nickname: user nickname type: Province ID // You can call /custom/ cityList interface to obtain city: city ID // you can call /custom/ cityList interface to obtain signature: user signatureCopy the code

Interface address:

/user/info
Copy the code

Optional parameters:

There is noCopy the code

Call examples:

PUT /user/info

// body
{
    gender: 0
    birthday: 134567788
    nickname: "* * *"
    province: 400022
    city: 2344554Signature:"* * * *"
}
Copy the code

2.14 Obtaining User Operation Records

Note: Call this interface after login, you can obtain user operation records

Mandatory parameters:

There is noCopy the code

Interface address:

/user/logs
Copy the code

Optional parameters:

There is noCopy the code

Call examples:

GET / user / logs;
Copy the code

2.15 Obtaining user FM information

After logging in to call this interface, you can obtain the user FM

Mandatory parameters:

There is noCopy the code

Interface address:

/user/fm
Copy the code

Optional parameters:

There is noCopy the code

Call examples:

GET / user / fm;
Copy the code

2.16 Obtaining recommended radio programs from users

Note: Call this interface to get recommended radio stations

Mandatory parameters:

There is noCopy the code

Interface address:

/user/rec/djprogram
Copy the code

Optional parameters:

There is noCopy the code

Call examples:

GET / user / rec / djprogram;
Copy the code

2.17 Obtaining the Recommended MV

Note: If you call this interface, you can get the recommended MV

Mandatory parameters:

There is noCopy the code

Interface address:

/user/rec/mv
Copy the code

Optional parameters:

There is noCopy the code

Call examples:

GET / user / rec / mv;
Copy the code

2.18 Obtaining new songs recommended by users

Call this interface, you can get recommended new songs

Mandatory parameters:

There is noCopy the code

Interface address:

/user/rec/newsong
Copy the code

Optional parameters:

There is noCopy the code

Call examples:

GET / user / rec / newsong;
Copy the code

2.19 Exclusive broadcast

Call this interface, you can get exclusive broadcast

Mandatory parameters:

There is noCopy the code

Interface address:

/user/privatecontent
Copy the code

Optional parameters:

There is noCopy the code

Call examples:

GET / user / privatecontent;
Copy the code

2.20 Obtaining user recommended Playlists

Call this interface, you can get the unique recommended song list

Mandatory parameters:

There is noCopy the code

Interface address:

/user/rec/playlist
Copy the code

Optional parameters:

limit: Number returned. The default value is 30Copy the code

Call examples:

GET /user/rec/playlist @query { limit? :30
}
Copy the code

3. Album module

3.1 Obtaining album Dynamic Information

Note: Call this interface, you can get the album dynamic information

Mandatory parameters:

AlbumId: album IDCopy the code

Interface address:

/album/:albumId/detail/dynamic
Copy the code

Optional parameters:

There is noCopy the code

Call examples:

GET /album/:albumId/detail/dynamic

@param
{
	albumId: 12244
}
Copy the code

3.2 Obtaining the latest album

Call this interface, you can get the latest album

Mandatory parameters:

There is noCopy the code

Interface address:

/album/latest
Copy the code

Optional parameters:

There is noCopy the code

Call examples:

GET / album / latest;
Copy the code

3.3 Collection | cancel collection album

Call this interface, can be favorites | unfavorites album

Mandatory parameters:

AlbumId: albumId actionType: operation type, save:"sub", cancel collection:"unsub"
Copy the code

Interface address:

/album/:albumId/sub/:actionType
Copy the code

Optional parameters:

limit: Number returned. The default value is 30Copy the code

Call examples:

POST /album/:albumId/sub/:actionType

@param
{
	albumId: "* * * *".actionType: "sub"
}
Copy the code

3.4 Obtaining the List of collected albums

Call this interface to get a list of favorite albums

Mandatory parameters:

There is noCopy the code

Interface address:

/album/sublist
Copy the code

Optional parameters:

limitThe default value is 30. Offset: number of offsets used for paging, for example, (current page number -1)*30, where 30 islimitThe value of theCopy the code

Call examples:

GET /album/sublist @query { offset? :0, limit? :30
}
Copy the code

3.5 Obtaining Album Information

Note: Call this interface, you can get album information

Mandatory parameters:

AlbumId: album IDCopy the code

Interface address:

/album/:albumId/info
Copy the code

Optional parameters:

There is noCopy the code

Call examples:

GET /album/:albumId/info

@param
{
	albumId: "* * * *"
}
Copy the code

4. Singer module

4.1 Obtaining the List of Singers

Call this interface to get a list of singers

Mandatory parameters:

There is noCopy the code

Interface address:

/artist/list
Copy the code

Optional parameters:

Call examples:

GET /artist/list @param { limit? :30, offset? :1
	categoryCode: 1001.initial: 'a'
}
Copy the code

4.2 Obtaining singer profiles

Call this interface, you can get singer profile

Mandatory parameters:

ArtistId: singer IDCopy the code

Interface address:

/artist/:artistId/brief
Copy the code

Optional parameters:

There is noCopy the code

Call examples:

GET /artist/:artistId/brief

@param
{
	artistId: "* * * *"
}
Copy the code

4.3 Obtaining singer information

Call this interface, you can get singer information

Mandatory parameters:

ArtistId: singer IDCopy the code

Interface address:

/artist/:artistId/info
Copy the code

Optional parameters:

There is noCopy the code

Call examples:

GET /artist/:artistId/info

@param
{
	artistId: "* * * *"
}
Copy the code

4.4 Obtaining artist albums

Call this interface, you can get the singer album

Mandatory parameters:

ArtistId: singer IDCopy the code

Interface address:

/artist/:artistId/albums
Copy the code

Optional parameters:

limitThe default value is 30. Offset: number of offset pages, for example, (number of pages -1)*30, where 30 islimitThe default value is 0Copy the code

Call examples:

GET /artist/:artistId/albums

@param
{
	artistId: "* * * *"} @query { limit? :30.offset: 1
}
Copy the code

4.5 Obtaining the Singer’s MV

Call this interface, you can get the singer MV

Mandatory parameters:

ArtistId: singer IDCopy the code

Interface address:

/artist/:artistId/mv
Copy the code

Optional parameters:

limitThe default value is 30. Offset: number of offset pages, for example, (number of pages -1)*30, where 30 islimitThe default value is 0Copy the code

Call examples:

GET /artist/:artistId/mv

@param
{
	artistId: "* * * *"} @query { limit? :30.offset: 1
}
Copy the code

4.6 Obtain 50 pop songs from the singer

Note: Call this interface, you can get album information

Mandatory parameters:

ArtistId: singer IDCopy the code

Interface address:

/artist/:artistId/top/song
Copy the code

Optional parameters:

There is noCopy the code

Call examples:

GET /artist/:artistId/top/song

@param
{
	artistId: "* * * *"
}
Copy the code

4.7 Collect | cancel collect singer

Note: Call this interface, you can get album information

Mandatory parameters:

ArtistId: singer ID: actionType:"sub", cancel collection:"unsub"
Copy the code

Interface address:

/artist/:artistId/sub/:actionType
Copy the code

Optional parameters:

There is noCopy the code

Call examples:

GET /artist/:artistId/sub/:actionType

@param
{
	artistId: "* * * *".actionType: "sub"
}
Copy the code

4.8 Obtaining the List of Subscribed Singers

Note: Call this interface, you can get album information

Mandatory parameters:

There is noCopy the code

Interface address:

/artist/sublist
Copy the code

Optional parameters:

limitThe default value is 30. Offset: number of offset pages, for example, (number of pages -1)*30, where 30 islimitThe default value is 0Copy the code

Call examples:

GET /artist/sublist @query { limit? :30, offset? :1
}
Copy the code

5. Comment module

5.1 Obtaining Resource Comments

Description: Call this interface to get resource comments

Mandatory parameters:

type: Resource type, optional: Album:"album"Radio:"dj"Song:"music"MV:"mv"Song list:"playlist"Video:"video"Dynamic:"event"ResourceId: resource IDCopy the code

Interface address:

/comment/resource/:resourceId/comments
Copy the code

Optional parameters:

limitThe default value is 20. Offset: indicates the offset number, which is used for paging, for example, (number of comment pages -1)*20, where 20 islimitBeforeTime: a paging parameter that takes the time of the last item on the previous page and gets the data on the next page (needed when getting more than 5000 comments)Copy the code

Call examples:

GET /comment/resource/:resourceId/hot/comments

@param {
    resourceId: "* * *"} @query { limit? :30, offset? :1.type: "music".beforeTime: 0
}
Copy the code

5.2 Obtaining Popular Comments on Resources

Call this interface, you can get hot comments on resources

Mandatory parameters:

type: Resource type, optional: Album:"album"Radio:"dj"Song:"music"MV:"mv"Song list:"playlist"Video:"video"Dynamic:"event"ResourceId: resource IDCopy the code

Interface address:

/comment/resource/:resourceId/hot/comments
Copy the code

Optional parameters:

limitThe default value is 20. Offset: indicates the offset number, which is used for paging, for example, (number of comment pages -1)*20, where 20 islimitBeforeTime: a paging parameter that takes the time of the last item on the previous page and gets the data on the next page (needed when getting more than 5000 comments)Copy the code

Call examples:

GET /comment/resource/:resourceId/hot/comments

@param {
    resourceId: "* * *"} @query { limit? :30, offset? :1.type: "music".beforeTime: 0
}
Copy the code

5.3 Obtaining resources Cloud Village reviews

Call this interface, you can get resource cloud village reviews

Mandatory parameters:

There is noCopy the code

Interface address:

/comment/hotwall/list
Copy the code

Optional parameters:

There is noCopy the code

Call examples:

GET / comment / hotwall / list;
Copy the code

5.4 Like | Unlike comment

Call this interface, you can like | unlike comments

Mandatory parameters:

ResourceId: resourceId actionType: actionType, like:"like", unlike:"unlike"CommentId: comment IDtype: Resource type, optional: Album:"album"Radio:"dj"Song:"music"MV:"mv"Song list:"playlist"Video:"video"Dynamic:"event"
Copy the code

Interface address:

/comment/resource/:resourceId/like/:actionType
Copy the code

Optional parameters:

There is noCopy the code

Call examples:

POST /comment/resource/:resourceId/like/:actionType

@param
{
    resourceId: "* * *".actionType: "like"
}
@body
{
   commentId: "* * *".type: "music"
}
Copy the code

5.5 Comment on resources

Description: Call this interface to publish resource comments

Mandatory parameters:

ResourceId: indicates the resourceId. Content: indicates the comment contenttype: Resource type, optional: Album:"album"Radio:"dj"Song:"music"MV:"mv"Song list:"playlist"Video:"video"Dynamic:"event"
Copy the code

Interface address:

/comment/resource/:resourceId/comment/send
Copy the code

Optional parameters:

There is noCopy the code

Call examples:

POST /comment/resource/:resourceId/comment/send

@body
{
    resourceId: "* * *".content: "* * *".type: "music"
}
Copy the code

5.5 Deleting resource Comments

Note: Call this interface to delete resource comments

Mandatory parameters:

ResourceId: indicates the resourceId. CommentId: indicates the commentIdtype: Resource type, optional: Album:"album"Radio:"dj"Song:"music"MV:"mv"Song list:"playlist"Video:"video"Dynamic:"event"
Copy the code

Interface address:

/comment/resource/:resourceId/comment
Copy the code

Optional parameters:

There is noCopy the code

Call examples:

DELETE /comment/resource/:resourceId/comment

@param
{
    resourceId: "* * *"
}
@body {
    commentId: "* * *".type: "music"
}
Copy the code

5.6 Replying to Resource Comments

Note: Call this interface to reply to resource comments

Mandatory parameters:

ResourceId: indicates the resourceId. CommentId: indicates the commentId. Content: indicates the comment contenttype: Resource type, optional: Album:"album"Radio:"dj"Song:"music"MV:"mv"Song list:"playlist"Video:"video"Dynamic:"event"
Copy the code

Interface address:

/comment/resource/:resourceId/comment/:commentId/reply
Copy the code

Optional parameters:

There is noCopy the code

Call examples:

POST /comment/resource/:resourceId/comment/:commentId/reply

@param
{
    resourceId: "* * *".commentId: "* * *"
}
@body {
    content: "* * * *".type: "music"
}
Copy the code

6. The MV module

6.1 Obtaining the MV List

Call this interface, you can get the MV list

Mandatory parameters:

There is noCopy the code

Interface address:

/mv/list
Copy the code

Optional parameters:

Call examples:

GET /mv/list @query { area? :0, type? :0, order? :0, offset? :1, limit? :30,}Copy the code

6.2 Obtaining MV Details

Call this interface to obtain MV details

Mandatory parameters:

mvId: MV ID
Copy the code

Interface address:

/mv/:mvId/detail
Copy the code

Optional parameters:

There is noCopy the code

Call examples:

GET /mv/:mvId/detail

@param
{
    mvId: "* * *"
}
Copy the code

6.3 Obtaining the MV produced by netease

Note: By invoking this interface, you can obtain the MV produced by netease

Mandatory parameters:

There is noCopy the code

Interface address:

/mv/exclusive/rcmd
Copy the code

Optional parameters:

limitThe default value is 30. Offset: number of offset pages, for example, (number of pages -1)*30, where 30 islimitThe default value is 0Copy the code

Call examples:

GET /mv/exclusive/rcmd @query { limit? :30, offset? :1
}
Copy the code

6.4 Obtaining the Latest MV

Note: Call this interface to obtain the latest MV

Mandatory parameters:

There is noCopy the code

Interface address:

/mv/latest
Copy the code

Optional parameters:

limitThe default value is 30. Offset: number of offset pages, for example, (number of pages -1)*30, where 30 islimitThe default value is 0Copy the code

Call examples:

GET /mv/latest @query { limit? :30, offset? :1
}
Copy the code

6.5 Collect | Cancel collect MV

Call this interface, can be favorites | unfavorites MV

Mandatory parameters:

MvId: MV ID actionType: Operation type, Favorites:"sub", cancel collection:"unsub"
Copy the code

Interface address:

/mv/:mvId/sub/:actionType
Copy the code

Optional parameters:

There is noCopy the code

Call examples:

GET /mv/:mvId/sub/:actionType

@param
{
    mvId: "* * *".actionType: "sub"
}
Copy the code

6.6 Obtaining the MV Favorites List

Call this interface to get MV favorites list

Mandatory parameters:

There is noCopy the code

Interface address:

/mv/sublist
Copy the code

Optional parameters:

limitThe default value is 30. Offset: number of offset pages, for example, (number of pages -1)*30, where 30 islimitThe default value is 0Copy the code

Call examples:

GET /mv/sublist @query { limit? :30, offset? :1
}
Copy the code

6.7 Obtaining the MV URL

Note: Call this interface, you can get album information

Mandatory parameters:

MvId: MV ID Resolution: indicates the resolution. The default value is 1080Copy the code

Interface address:

/mv/url
Copy the code

Optional parameters:

There is noCopy the code

Call examples:

GET /mv/url

@query
{
    mvId: "* * *", resolution? :1080
}
Copy the code

7. Radio module

7.1 Obtaining the Banner of a Radio Station

Call this interface to get the banner of the station

Mandatory parameters:

There is noCopy the code

Interface address:

/dj/banner
Copy the code

Optional parameters:

There is noCopy the code

Call examples:

GET / dj / banner;
Copy the code

7.2 Obtaining the unpopular classification of radio stations

Note: Call this interface, you can get the non-popular radio classification

Mandatory parameters:

There is noCopy the code

Interface address:

/dj/category/excludehot
Copy the code

Optional parameters:

There is noCopy the code

Call examples:

GET / dj / category / excludehot;
Copy the code

7.3 Obtaining Radio Recommendation Categories

Note: Call this interface to get recommended classification of radio stations

Mandatory parameters:

There is noCopy the code

Interface address:

/dj/category/rec
Copy the code

Optional parameters:

There is noCopy the code

Call examples:

GET / dj / category / rec;
Copy the code

7.4 Obtaining the Radio Classification List

Call this interface to get a list of radio stations

Mandatory parameters:

There is noCopy the code

Interface address:

/dj/category/list
Copy the code

Optional parameters:

There is noCopy the code

Call examples:

GET / dj / category / list;
Copy the code

7.5 Acquiring popular radio stations

Call this interface, you can get popular radio stations

Mandatory parameters:

There is noCopy the code

Interface address:

/dj/hot
Copy the code

Optional parameters:

limitThe default value is 30. Offset: number of offset pages, for example, (number of pages -1)*30, where 30 islimitThe default value is 0Copy the code

Call examples:

GET /dj/hot @query { limit? :30, offset? :1
}
Copy the code

7.6 Obtaining paid Radio stations

Call this interface to get paid radio stations

Mandatory parameters:

There is noCopy the code

Interface address:

/dj/paygift
Copy the code

Optional parameters:

limitThe default value is 30. Offset: number of offset pages, for example, (number of pages -1)*30, where 30 islimitThe default value is 0Copy the code

Call examples:

GET /dj/paygift @query { limit? :30, offset? :1
}
Copy the code

7.7 Obtain the 24-hour radio program list

Call this interface, you can get the radio station 24 hours program list

Mandatory parameters:

There is noCopy the code

Interface address:

/dj/program/toplist/hours
Copy the code

Optional parameters:

limit: Number returned. The default value is 30Copy the code

Call examples:

GET /dj/program/toplist/hours @query { limit? :30
}
Copy the code

7.8 Get the radio show list

Call this interface, you can get the radio program list

Mandatory parameters:

There is noCopy the code

Interface address:

/dj/program/toplist
Copy the code

Optional parameters:

limitThe default value is 30. Offset: number of offset pages, for example, (number of pages -1)*30, where 30 islimitThe default value is 0Copy the code

Call examples:

GET /dj/program/toplist @query { limit? :30, offset? :1
}
Copy the code

7.9 Obtaining the Radio Program List

Call this interface to get a list of radio programs

Mandatory parameters:

DjId: station IDCopy the code

Interface address:

/dj/:djId/program/list
Copy the code

Optional parameters:

Asc: sort mode. The default value is asCfalse(New => Old) SettingstrueOld => newlimitThe default value is 30. Offset: number of offset pages, for example, (number of pages -1)*30, where 30 islimitThe default value is 0Copy the code

Call examples:

GET /dj/:djId/program/list

@param
{
    djId: "* * *"} @query { asc? :false, limit? :30, offset? :1
}
Copy the code

7.10 Obtaining classified popular radio stations

Call this interface, you can get classified hot radio

Mandatory parameters:

CategoryId: category IDCopy the code

Interface address:

/dj/category/:categoryId/djs
Copy the code

Optional parameters:

limitThe default value is 30. Offset: number of offset pages, for example, (number of pages -1)*30, where 30 islimitThe default value is 0Copy the code

Call examples:

GET /dj/category/:categoryId/djs

@param
{
    categoryId: "* * *"} @query { limit? :30, offset? :1
}
Copy the code

7.11 List of selected classified stations

Call this interface to get a list of selected classified stations

Mandatory parameters:

typeId: type Id, digital audio book: 10001, knowledge skills: 453050, commercial finance and economics, 453051, the humanities history: 11, the foreign language world: 13, parent-child baby: 14, creation | cover: 2001, music story: 2, 3 d | electronics: 10002, crosstalk quyi: 8, emotional FM: 3, prose reading: 6, talk show: 5, radio: 7, secondary yuan: 3001, star do anchor: 1, | film and television entertainment: 4, science and technology: 453052, campus | education: 4001, trip | city: 12,Copy the code

Interface address:

/dj/type/ :typeId/rec/djs
Copy the code

Optional parameters:

There is noCopy the code

Call examples:

GET /dj/type/:typeId/rec/djs

@param
{
    typeId: 1
}
Copy the code

7.12 Obtaining recommended Radio stations

Note: Call this interface to get recommended radio stations

Mandatory parameters:

There is noCopy the code

Interface address:

/dj/rec/djs
Copy the code

Optional parameters:

limitThe default value is 30. Offset: number of offset pages, for example, (number of pages -1)*30, where 30 islimitThe default value is 0Copy the code

Call examples:

GET / dj / rec / djs;
Copy the code

7.13 Subscribe | Unsubscribe radio station

Description: Call this interface, subscribe | unsubscribe radio

Mandatory parameters:

DjId: station ID actionType: operation type, subscribe:"sub"Unsubscribe:"unsub"
Copy the code

Interface address:

/dj/:djId/sub/:actionType
Copy the code

Optional parameters:

limitThe default value is 30. Offset: number of offset pages, for example, (number of pages -1)*30, where 30 islimitThe default value is 0Copy the code

Call examples:

POST /dj/:djId/sub/:actionType

@param
{
    djId: "* * *".actionType: "sub"
}
Copy the code

7.14 Obtaining the List of Subscribed Stations

Call this interface to get a list of subscribed stations

Mandatory parameters:

There is noCopy the code

Interface address:

/dj/sublist
Copy the code

Optional parameters:

limitThe default value is 30. Offset: number of offset pages, for example, (number of pages -1)*30, where 30 islimitThe default value is 0Copy the code

Call examples:

GET /dj/sublist @query { limit? :30, offset? :1
}
Copy the code

7.15 Get today’s preferred radio stations

Call this interface, you can get today’s preferred station

Mandatory parameters:

There is noCopy the code

Interface address:

/dj/totay/perfered
Copy the code

Optional parameters:

Offset: indicates the number of offset pages, for example, (number of pages -1)*30, where 30 islimitThe default value is 0Copy the code

Call examples:

GET /dj/totay/perfered @query { offset? :1
}
Copy the code

7.16 Access to 24-hour radio stations

Call this interface, you can get 24 hours list radio

Mandatory parameters:

There is noCopy the code

Interface address:

/dj/toplist/hours
Copy the code

Optional parameters:

limit: Number returned. The default value is 30Copy the code

Call examples:

GET /dj/toplist/hours @query { limit? :30
Copy the code

7. Radio newcomer list

Call this interface, you can get new radio list

Mandatory parameters:

There is noCopy the code

Interface address:

/dj/toplist/newcomer
Copy the code

Optional parameters:

limitThe default value is 30. Offset: number of offset pages, for example, (number of pages -1)*30, where 30 islimitThe default value is 0Copy the code

Call examples:

GET /dj/toplist/newcomer @query { limit? :30, offset? :1
}
Copy the code

7.18 Premium products

Note: Call this interface, can pay boutique

Mandatory parameters:

There is noCopy the code

Interface address:

/dj/toplist/pay
Copy the code

Optional parameters:

limit: Number returned. The default value is 30Copy the code

Call examples:

GET /dj/toplist/pay @query { limit? :30
}
Copy the code

7.19 Hot List

Call this interface, you can get the popular hot list

Mandatory parameters:

There is noCopy the code

Interface address:

/dj/toplist/popular
Copy the code

Optional parameters:

limit: Number returned. The default value is 30Copy the code

Call examples:

GET /dj/toplist/popular @query { limit? :30
}
Copy the code

7.20 Radio hot list

Note: Call this interface, you can get album information

Mandatory parameters:

There is noCopy the code

Interface address:

/dj/toplist
Copy the code

Optional parameters:

type: List type, 0 is the new radio list,1 is the hot radio list, default is 0limitThe default value is 30. Offset: number of offset pages, for example, (number of pages -1)*30, where 30 islimitThe default value is 0Copy the code

Call examples:

GET /dj/toplist

@query
{
    type: 0, limit? :30, offset? :1
}
Copy the code

7.21 Access to radio programme details

Call this interface to get details of radio programs

Mandatory parameters:

DjId: station IDCopy the code

Interface address:

/dj/:djId/program/detail
Copy the code

Optional parameters:

There is noCopy the code

Call examples:

GET /dj/:djId/program/detail

@param
{
    djId: "* * *"
}
Copy the code

7.22 Obtaining station details

Call this interface to get radio details

Mandatory parameters:

DjId: station IDCopy the code

Interface address:

/dj/:djId/detail
Copy the code

Optional parameters:

There is noCopy the code

Call examples:

GET /dj/:djId/detail

@param
{
    djId: "* * *"
}
Copy the code

8. Leaderboard module

8.1 Album Chart

Call this interface, you can get album rankings

Mandatory parameters:

There is noCopy the code

Interface address:

/top/album
Copy the code

Optional parameters:

area: 'ALL' | 'ZH' | 'EA' | 'KR' | 'JP'
limitThe default value is 30. Offset: number of offset pages, for example, (number of pages -1)*30, where 30 islimitThe default value is 0Copy the code

Call examples:

GET /top/album @query { area? :'ZH', limit? :30, offset? :1
}
Copy the code

8.2 Get a Hot artist

Call this interface to get hot singers

Mandatory parameters:

There is noCopy the code

Interface address:

/top/artist
Copy the code

Optional parameters:

limitThe default value is 30. Offset: number of offset pages, for example, (number of pages -1)*30, where 30 islimitThe default value is 0Copy the code

Call examples:

GET /top/artist @query { limit? :30, offset? :1
}
Copy the code

8.3 Obtaining the New Song List

Call this interface to get a list of new songs

Mandatory parameters:

Interface address:

/top/list
Copy the code

Optional parameters:

There is noCopy the code

Call examples:

GET /top/list

@query
{
    type: 0
}
Copy the code

8.4 Obtaining the MV Chart

Call this interface to get MV leaderboard

Mandatory parameters:

There is noCopy the code

Interface address:

/top/mv
Copy the code

Optional parameters:

Call examples:

GET /top/mv

@query
{
    area: 'Chinese', limit? :30, offset? :1
}
Copy the code

8.5 Access to high-quality playlist charts

Call this interface to get high quality playlist leaderboards

Mandatory parameters:

There is noCopy the code

Interface address:

/top/quality/playlist
Copy the code

Optional parameters:

limit: returns the number of entries (default: 30) lasttime: returns the number of entries (default: 30) Categories optional types: All, Mandarin, European and American, Korean, Japanese, Cantonese, minor languages, Sports,ACG, Film and Television acoustic, pop, Rock, back rock, antique, folk, light music, electronic, instrumental, rap, classical, jazzCopy the code

Call examples:

GET /top/quality/playlist

@query
{
    category: 'Chinese'limit? :30.lasttime: 0,}Copy the code

8.6 Obtain the List of songs

Call this interface to get the playlist leaderboard

Mandatory parameters:

There is noCopy the code

Interface address:

/top/playlist
Copy the code

Optional parameters:

Order: The value is optional'new''hot', respectively corresponding to the latest and hottest. The default value is'hot'Category:"Chinese","Antique""Europe and the United States." ","Pop"By default,"All"/playlist/category/listlimitThe default value is 30. Offset: number of offset pages, for example, (number of pages -1)*30, where 30 islimitThe default value is 0Copy the code

Call examples:

GET /top/playlist @query { order? :'new', category? :'antique'limit? :30, offset? :1
}
Copy the code

8.7 New Songs list

Call this interface, you can get the list of new songs

Mandatory parameters:

There is noCopy the code

Interface address:

top/songs
Copy the code

Optional parameters:

area:'all' | 'Chinese' | 'Europe and the United States' | 'Japan' | South Korea 'Copy the code

Call examples:

GET /top/songs

@query
{
    area: 'Chinese'
}
Copy the code

8.8 Obtaining the Singer list

Call this interface to get the list of singers

Mandatory parameters:

There is noCopy the code

Interface address:

/toplist/artist
Copy the code

Optional parameters:

type: number 1-4 1:'Chinese',
  2: 'Europe and the United States',
  3: 'Japan',
  4: 'Korea'.Copy the code

Call examples:

GET /toplist/artist

@query
{
   type: 2
}
Copy the code

8.9 Summary of all lists

Note: Call this interface to get a summary of all list contents

Mandatory parameters:

There is noCopy the code

Interface address:

/toplist/detail
Copy the code

Optional parameters:

There is noCopy the code

Call examples:

GET / toplist / detail;
Copy the code

8.10 List introduction

Note: Call this interface to get the list introduction

Mandatory parameters:

There is noCopy the code

Interface address:

/toplist/introduction
Copy the code

Optional parameters:

There is noCopy the code

Call examples:

GET / toplist / introduction;
Copy the code

9. Video module

9.1 Obtaining Video Information

Call this interface to get video information

Mandatory parameters:

VideoId: indicates the videoIdCopy the code

Interface address:

/video/:videoId/detail
Copy the code

Optional parameters:

There is noCopy the code

Call examples:

GET /video/:videoId/detail

@query
{
    videoId: "* * *"
}
Copy the code

9.2 Obtaining a Video Group List

Call this interface to get a list of video groups

Mandatory parameters:

There is noCopy the code

Interface address:

/video/group/list
Copy the code

Optional parameters:

There is noCopy the code

Call examples:

GET /video/group/list;
Copy the code

9.3 Obtaining Videos in a Video Group

Call this interface to get the video under the video group

Mandatory parameters:

GroupId: group IDCopy the code

Interface address:

/video/group/videos
Copy the code

Optional parameters:

(number of pages -1)*30, where 30 islimitThe default value is 0Copy the code

Call examples:

GET /video/group/videos

@query
{
    groupId: "* * *", resolution? :1080, offset? :1
}
Copy the code

9.4 Favorites | Unfavorites video

Call this interface, favorites | unfavorites video

Mandatory parameters:

VideoId: videoId actionType: actionType, favorites:"sub", cancel collection:"unsub"
Copy the code

Interface address:

/video/:videoId/sub/:actionType
Copy the code

Optional parameters:

There is noCopy the code

Call examples:

POST /video/:videoId/sub/:actionType

@query
{
    videoId: "* * *".actionType: "sub"
}
Copy the code

9.5 Obtaining the VIDEO URL

Note: Call this interface, you can get album information

Mandatory parameters:

VideoIds: videoIds are separated by commasCopy the code

Interface address:

/video/urls
Copy the code

Optional parameters:

Resolution: the default resolution is 1080Copy the code

Call examples:

GET /video/urls

@query
{
    videoIds: "* * *, * * *", resolution? :1080
}
Copy the code

10. Playlist module

10.1 Obtaining the Playlist Category List

Call this interface to get the playlist category list

Mandatory parameters:

There is noCopy the code

Interface address:

/playlist/category/list
Copy the code

Optional parameters:

There is noCopy the code

Call examples:

GET / playlist / category / list;
Copy the code

10.2 Creating a Playlist

Call this interface to create a playlist

Mandatory parameters:

Name: indicates the name of a song list. Privacy: 0 indicates a common song list, and 10 indicates a private song listCopy the code

Interface address:

/playlist/create
Copy the code

Optional parameters:

There is noCopy the code

Call examples:

POST /playlist/create

@query
{
    name: "* * *".privacy: 0
}
Copy the code

10.3 Deleting a Playlist

Call this interface to delete playlists

Mandatory parameters:

Pid: indicates the ID of the song listCopy the code

Interface address:

/playlist/delete
Copy the code

Optional parameters:

There is noCopy the code

Call examples:

DELETE /playlist/delete

@body
{
    pid: "* * *"
}
Copy the code

10.4 Updating the Playlist Description

Description: Call this interface to update playlist description

Mandatory parameters:

Pid: indicates the ID of the song list. Description: indicates the descriptionCopy the code

Interface address:

/playlist/des/update
Copy the code

Optional parameters:

There is noCopy the code

Call examples:

PUT /playlist/des/update

@query
{
    pid: "* * *".description: "* * *"
}
Copy the code

10.5 Obtaining Playlist Details

Call this interface to get playlist details

Mandatory parameters:

Pid: song list IDCopy the code

Interface address:

/playlist/detail
Copy the code

Optional parameters:

SubNum: The last subNum collector of a playlistCopy the code

Call examples:

GET /playlist/detail

@query
{
    pid: "* * * *", subNum? :10
}
Copy the code

10.6 Get the Hot songs list

Call this interface to get the hot song list

Mandatory parameters:

There is noCopy the code

Interface address:

/playlist/hot
Copy the code

Optional parameters:

There is noCopy the code

Call examples:

GET / playlist / hot;
Copy the code

10.7 Updating song Names

Call this interface to update the singleton name

Mandatory parameters:

Pid: indicates the song ID. Name: indicates the song nameCopy the code

Interface address:

/playlist/name/update
Copy the code

Optional parameters:

There is noCopy the code

Call examples:

PUT /playlist/name/update

@query
{
    pid: "* * *".name: "* * *"
}
Copy the code

10.8 Subscribe | Unsubscribe playlist

Call this interface, subscribe | unsubscribe playlist

Mandatory parameters:

Pid: Song list ID actionType: Subscribe:'subscribe'Unsubscribe:'unsubscribe'
Copy the code

Interface address:

/playlist/:pid/sub/:actionType
Copy the code

Optional parameters:

There is noCopy the code

Call examples:

POST /playlist/:pid/sub/:actionType

@param
{
  pid: "* * *".actionType: "subscribe"
}
Copy the code

10.9 Obtaining playlist subscribers

Description: Call this interface to get playlist subscribers

Mandatory parameters:

Pid: song list IDCopy the code

Interface address:

/playlist/:pid/subscribers
Copy the code

Optional parameters:

limitThe default value is 30. Offset: number of offset pages, for example, (number of pages -1)*30, where 30 islimitThe default value is 0Copy the code

Call examples:

GET /playlist/:pid/subscribers

@param
{
    pid: "* * *"} @query { limit? :30, offset? :1
}
Copy the code

10.10 Updating playlist labels

Call this interface to update playlist labels

Mandatory parameters:

Pid: Playlist ID Tags: Playlist tagCopy the code

Interface address:

/playlist/:pid/tags/update
Copy the code

Optional parameters:

limitThe default value is 30. Offset: number of offset pages, for example, (number of pages -1)*30, where 30 islimitThe default value is 0Copy the code

Call examples:

PUT /playlist/:pid/tags/update

@query
{
   pid: "* * *"
}
@body
{
    tags: "* * *"
}
Copy the code

10.11 Adding a Song to a Playlist

Call this interface to add a playlist song

Mandatory parameters:

Pid: indicates the ID of a song. SongIds: indicates the array of songIdsCopy the code

Interface address:

/playlist/:pid/songs/add
Copy the code

Optional parameters:

There is noCopy the code

Call examples:

POST /playlist/:pid/songs/add

{
   pid: "* * *"
}
@body
{
    songIds: ["* * *"."* * * *"]}Copy the code

10.12 Deleting a Song from a Playlist

Note: Call this interface, you can get album information

Mandatory parameters:

Pid: indicates the ID of a song. SongIds: indicates the array of songIdsCopy the code

Interface address:

/playlist/:pid/songs/del
Copy the code

Optional parameters:

There is noCopy the code

Call examples:

DELETE /playlist/:pid/songs/del

@param
{
   pid: "* * *"
}
@body
{
    songIds: ["* * *"."* * * *"]}Copy the code

10.13 Update playlist

Note: Call this interface, you can get album information

Mandatory parameters:

Pid: indicates the ID of the song list. Description: indicates the description tagsCopy the code

Interface address:

/playlist/:pid/update
Copy the code

Optional parameters:

There is noCopy the code

Call examples:

PUT /playlist/:pid/update

{
   pid: "* * *"
}
@body
{
    description: "* * *".tags: "* * *"
}
Copy the code

conclusion

The interfaces currently implemented are mainly these. The interfaces have not been tested strictly for the time being. If you have any questions, please send me an issue. Contribute out, is convenient for everyone to study together, prohibit commercial use. Next up, WebPack environment configuration. Follow my wechat public number and grow together.

@author: WaterMan