So, I've been wondering about this API for quiet some time now. I know there is an API endpoint for user already but if the api could be designed like below that'd be great!
Endpoints:
Base Endpoint: api.warmerise.com/
User Endpoint: api.warmerise.com/user/USERNAME
Clan Endpoint: api.warmerise.com/clan/CLAN_NAME
User Rankings: api.warmerise.com/ranks/users
Clans Rankings: api.warmerise.com/ranks/clans
All those endpoints can return a JSON object and for authentication they should accept user's login information or api key generated in settings and perhaps a ratelimit can be added like 5 requests per second.
Base Endpoint:
{
"stats": {
"members": 0,
"friendships": 0,
"posts": 0,
"comments": 0,
"polls": 0,
"poll_votes": 0,
"videos": 0,
"groups": 0,
"forum_topics": 0,
"events": 0,
"photos": 0,
"currentEvent": {
"name": "WLC"
},
"latest_posts": [
{
"1": {
"title": "NEED HELP WITH API",
"Author": "USER OBJECT",
"description": "A short description max 200 characters"
}
}
]
},
"version": "Game version"
}
User endpoint basically returns what's on user's profile.
Clan also returns what's on clan page; avatars, member count, clan rank, name, owner.
User ranking returns a paginated response and reflects what the TOP 100 page returns and same for clan ranking as well.
It becomes tiresome to continously parse site information and often times it makes too many requests.
Max said:Yeah there is already an endpoint for user stats, but I will consider adding suggested endpoints as well.
Also you said "it becomes tiresome to continuously parse site information", may I know where is the data used, is it on another website or somewhere else?
I had created a bot that'd scrape your site for the stuff that I mentioend above. After realizing how certain things were breaking my bot every now and then I decided to give up.
Couple conditions were: Profiles being private. Getting general site stats, Clans being private, etc.
But if a dedicated api is made that'd really help with all the tiresome regex parsing and scarping your site to display a clean version of x thing.