This is the AMP version of this page.
If you want to load the real page instead, click this text.

Tool Play Ninja Legend API

pl0nk

Platinian
Original poster
Jul 13, 2021
39
1,842
183
Jakarta
Hi guys,

I noticed this game (Ninja Legends) just launched few days ago. It's still in very early stage of release. I tried to extract some of it APIs, and created a python library project for it. It's not really well designed API, but enough to get it working. I'll try to maintain through some updates, if I have the time.

Link to the project: playninjalegends

Some example code to use,

Python:
# Use all attempt for daily hunting house
from playninjalegends import NinjaLegendsAPI

nlapi = NinjaLegendsAPI("https://playninjalegends.com/amf_nl/")
user = nlapi.systemLogin.loginUser(username='xxx', password='xxx')

charId = 1234 # get your charId from Profile panel
res = nlapi.huntingHouse.getData(user, charId)

# parse data for attempt left, and loop through it
for bossNum, attemptLeft in enumerate(res['data'].split(',')):
    for _ in range(int(attemptLeft)):
        battleCode = nlapi.huntingHouse.startHunting(charId, bossNum)
        print(nlapi.huntingHouse.finishHunting(charId, bossNum, battleCode))
Python:
# This will complete mission indefinitely until stopped with Ctrl+C
from playninjalegends import NinjaLegendsAPI

nlapi = NinjaLegendsAPI("https://playninjalegends.com/amf_nl/")

charId = 1234  # get your charId from Profile panel
missionId = 10  # choose mission number

# Press Ctrl+C to stop
while True:
    try:
        battleCode = nlapi.battleSystem.startMission(charId, missionId)
        print(nlapi.battleSystem.finishMission(charId, missionId, battleCode))
    except KeyboardInterrupt:
        break
    except Exception as e:
        print(f"[!] Oh no, something happened. {e}")
        break
 
Last edited:
Mar 2, 2018
4
0
1
26
hi, i want to learn how to build api and a python library for this game. so i can contribute. can you build a tutorial from scratch?
 

nik2143

Jr. PMT Modder
Staff member
Modding-Team
Jun 30, 2018
539
28,736
1,193
Italy
hi, i want to learn how to build api and a python library for this game. so i can contribute. can you build a tutorial from scratch?
To get requests to send you can use a proxy that intercept requests and responses