1. Hello!

    First of all, welcome to MapleLegends! You are currently viewing the forums as a guest, so you can only view the first post of every topic. We highly recommend registering so you can be part of our community.

    By registering to our forums you can introduce yourself and make your first friends, talk in the shoutbox, contribute, and much more!

    This process only takes a few minutes and you can always decide to lurk even after!

    - MapleLegends Administration-
  2. Experiencing disconnecting after inserting your login info? Make sure you are on the latest MapleLegends version. The current latest version is found by clicking here.
    Dismiss Notice

Player info API

Discussion in 'Accepted' started by Mii, Apr 5, 2019.

  1. Mii
    Offline

    Mii Mixed Golem

    173
    41
    173
    Sep 21, 2018
    MapleLegends
    10:09 AM
    LilMi / miii
    Bowmaster
    152
    ⚔️ Beaters
    Hey!

    I would love to see a more developed API that allows a user to fetch player data using some kind url, returning in forms of eg a JSON object.

    There's already a request url to return a players image:
    Code:
    https://maplelegends.com/api/getavatar?name=Tinymi
    Let's say i would want to build a Discord bot, that fetches information about a player (like the DRODS bot), or a website/app that want to display player data somehow.

    It would be nice to be able to call an api like so:
    Code:
    https://maplelegends.com/api/getinfo?name=Tinymi
    or individual requests:
    Code:
    https://maplelegends.com/api/getlevel?name=Tinymi
    Code:
    https://maplelegends.com/api/getjob?name=Tinymi
    Code:
    https://maplelegends.com/api/getguild?name=Tinymi
    and it would return info in the form of a JSON object like so:

    Code:
    {
        "data": {
            "job": "Bishop",
            "level": 139,
            "name": "Tinymi",
            "rank": 2011
            [...]
        }
    }
    To counter bots and too many requests, the admins could simply limit the number of requests by IP, or use private API keys handed out to requesting individuals.

    I think a solution like this would be fairly easy to implement.
     
    Last edited: Apr 7, 2019
    • Like Like x 4
    • Great Work Great Work x 1
    • Useful Useful x 1
  2. FeroxAnima
    Offline

    FeroxAnima Web Developer Staff Member Web Developer

    162
    91
    178
    Dec 29, 2017
    Male
    11:09 AM
    Zelretch/HerSlave
    Bishop
    181
    Horny/Muse
    qtpie DraudsDrauds just implemented a cute & simple interface to request character data with a JSON object as the output format. It doesn't expose anything the website doesn't provide you with, and mainly acts as a more convenient method of fetching such information versus web scraping, which is the method ML-related external applications had to employ until this point.
    Try the following:
    https://maplelegends.com/api/character?name=drauds

    Thanks for the feedback :heart:
     
    • Like Like x 2
    • Great Work Great Work x 1
    • Friendly Friendly x 1
  3. FeroxAnima
    Offline

    FeroxAnima Web Developer Staff Member Web Developer

    162
    91
    178
    Dec 29, 2017
    Male
    11:09 AM
    Zelretch/HerSlave
    Bishop
    181
    Horny/Muse
    Speaking of APIs, this post also reminded me to commit an extra feature I wrote for getavatar: you can use the "face" parameter to add a face expression. Accepted values are either f# (following the emote names in ML's Discord server; so "F14", for instance, is sparkly), or the actual expression's name as seen in https://maplestory.design (so sporkle would be "glitter").

    Supported parameters so far are mount (values 0 or 1), animated (values 0 or 1) which adds walking animation, and face.

    [​IMG] ____________________________ [​IMG] [​IMG]
     
    Last edited: Apr 7, 2019
    • Great Work Great Work x 2
  4. OP
    OP
    Mii
    Offline

    Mii Mixed Golem

    173
    41
    173
    Sep 21, 2018
    MapleLegends
    10:09 AM
    LilMi / miii
    Bowmaster
    152
    ⚔️ Beaters
    omgomg hell yeeeeeeeeeeeee

    thanks a lot guys!!

    this is a great asset for the community!!
     
    • Friendly Friendly x 1

Share This Page