background
Lu Xun said, “ACGer who does not like to stir is not a good siege lion.”
Therefore, after the completion of the open source APP “AcgClub”, in order to further enrich the scene function, anger point skill tree, I realized the back-end service by myself.
Effect of experience
The browser
Android App
Small program
interface
1. Obtain the dimensional wallpaper list
URL
-
Get all categories of wallpapers
https://rabtman.com/api/v2/acgclub/pictures
-
Gets the wallpaper of the specified category
https://rabtman.com/api/v2/acgclub/category/{type}/pictures
Supported formats
JSON
HTTP Request Mode
GET
Request parameters
parameter | Will choose | type | instructions |
---|---|---|---|
{type} | false | string | Path parameter to get the specified type of wallpaper. Currently supported categories:moeimg ,cosplay ,gamersky |
offset | false | int | Page number of the request, default: 1 |
limit | false | int | The default value is 20. The value ranges from 20 to 60 |
query | false | string | Search keywords |
Return to the field
Return to the field | The field type | instructions |
---|---|---|
title | string | The name of the wallpaper |
type | string | Wallpaper Category |
thumbnail | string | Wallpaper display thumbnails |
sort | string or int | Wallpaper order ID |
imgUrls | array | All wallpaper addresses under this theme |
Interface sample
Address: rabtman.com/api/v2/acgc…
{
"message": "Request successful"."data": [{
"thumbnail": "http://imgs.gamersky.com/upimg/2018/201802031433291315.jpg"."title": "Fate/Stay Night" official Birthday wallpapers released by Rin Yuan."type": "gamersky"."sort": 1010964."imgUrls": [
"http://img1.gamersky.com/image2018/02/20180203_ljt_220_5/gamersky_01origin_01_201823142764B.jpg"."http://img1.gamersky.com/image2018/02/20180203_ljt_220_5/gamersky_02origin_03_2018231427A25.jpg"]]}}Copy the code
Other instructions
The wallpaper is updated once a day, around 5am, and proper caching is recommended.
The appendix
The underlying field returned
Return to the field | The field type | instructions |
---|---|---|
message | string | Request response information |
data | object or array | The result information of the response, which may be an object or array |
Request limits
To reduce server stress, the frequency of requests is limited.
Currently, API requests are limited to 30/ min and 3/ SEC
Status code
Status code | describe |
---|---|
200 | The request is successful |
400 | Parameters of the abnormal |
404 | The page could not be found |
500 | Server Exception |
The last
If you have any questions or suggestions, please feel free to use the github Wiki at github.com/Rabtman/Acg…