Learn how to join our server and start playing in 60 seconds!
Play Now

Was this thread helpful?


  • Total voters
    21

ImAhmadAbdullah

Legendary Pika
Joined
Jan 25, 2022
Messages
337
Points
63

What is an API?

An API (Application Programming Interface) is a way for two or more computers to communicate with eachother. It is a type of software interface, offering a service to other pieces of software.

PikaNetwork has an API?
Well yes, sadly it is not known to most of the programmers in the PikaNetwork community. But today I am going to tell you all about PikaNetwork's API.

VARIABLES
playerIGN
= The player's in-game name.
interval = Which time period? (weekly/yearly/monthly/total)
mode = Which mode? [BEDWARS (SOLO/DOUBLES/TRIPLES/QUADS/ALL_MODES)], [SKYWARS (SOLO/DOUBLES/ALL_MODES)]
stat = Which leaderboard stat? {played/BED_DESTROYED/FINAL_KILLS/HIGHEST_WIN_STREAK/wins/kills}
offset = Which position the leaderboard starts from. (For example, if offset is 5, the leaderboard starts from #6. If it's 0, the leaderboard starts from #1)
limit = Which position the leaderboard ends at. (For example, if the limit 10, it will show the top 10 players)
gamemode = Any PikaNetwork gamemode. (e.g. opfactions, bedwars, opprison, opskyblock, classicskyblock, survival, kitpvp, practice, skywars, lifesteal)


RESPONSES
200 (The player exists)
400 (The player is not registered in the PikaNetwork database)
404 (There was a mistake in the link)

Profile API (https://stats.pika-network.net/api/profile/${playerIGN})
The profile API can be used to get a player's friend status, email and discord verification status, friend list, rank information, friend list, guild information, etc.
Bedwars API (https://stats.pika-network.net/api/profile/${playerIGN}/leaderboard?type=bedwars&interval=${interval}&mode=${mode})
The bedwars API can be used to get bedwars related stats such as final kills and bed breaks.
Skywars API (https://stats.pika-network.net/api/profile/${playerIGN}/leaderboard?type=skywars&interval=${interval}&mode=${mode})
The skywars API can be used to get skywars related stats such as kills, bow shots, ender pearls, etc.
Leaderboards API (https://stats.pika-network.net/api/leaderboards?type=${gameMode}&stat=${stat}&interval=${interval}&mode=${mode}&offset=${offset}&limit=${limit})
The leaderboards API can be used to view leaderboards of bedwars or skywars in certain offsets and time intervals.


Thanks to @A4As and @NOT_YAHYA for helping me with this forum post.
Here is a bot by me and @mallusrgreat which makes full use of the PikaNetwork API!
 
Last edited:

mallusrgreat

Epic Pika
Joined
Nov 2, 2020
Messages
108
Points
36
You did very well to figure it out. My bot DiscoPika already has implemented all these in its commands. It makes use of everything in the API. Currently, it's not available to add because the website is down. But there is an invite link to the support server in my thread
 

Whiskey

Legendary Pika
Joined
Aug 13, 2022
Messages
217
Points
43

What is an API?

An API (Application Programming Interface) is a way for two or more computers to communicate with eachother. It is a type of software interface, offering a service to other pieces of software.

PikaNetwork has an API?
Well yes, sadly it is not known to most of the programmers in the PikaNetwork community. But today I am going to tell you all about PikaNetwork's API.

VARIABLES
playerIGN
= The player's in-game name.
interval = Which time period? (weekly/yearly/monthly/total)
mode = Which mode? [BEDWARS (SOLO/DOUBLES/TRIPLES/QUADS/ALL_MODES)], [SKYWARS (SOLO/DOUBLES/ALL_MODES)]
stat = Which leaderboard stat? {played/BED_DESTROYED/FINAL_KILLS/HIGHEST_WIN_STREAK/wins/kills}
offset = Which position the leaderboard starts from. (For example, if offset is 5, the leaderboard starts from #6. If it's 0, the leaderboard starts from #1)
limit = Which position the leaderboard ends at. (For example, if the limit 10, it will show the top 10 players)

RESPONSES
200 (The player exists)
400 (The player is not registered in the PikaNetwork database)
404 (There was a mistake in the link)

Profile API (https://stats.pika-network.net/api/profile/${playerIGN})
The profile API can be used to get a player's friend status, email and discord verification status, friend list, rank information, friend list, guild information, etc.

Minigames API (It can be used to view stats of a certain minigame)
Bedwars API (https://stats.pika-network.net/api/profile/${playerIGN}/leaderboard?type=bedwars&interval=${interval}&mode=${mode})
Skywars API (https://stats.pika-network.net/api/profile/${playerIGN}/leaderboard?type=skywars&interval=${interval}&mode=${mode})
Leaderboards API (https://stats.pika-network.net/api/leaderboards?type=${gameMode}&stat=${stat}&interval=${interval}&mode=${mode}&offset=${offset}&limit=${limit})


Thanks to @A4As and @NOT_YAHYA for helping me with this forum post.
Interesting! I wish I knew how to code discord bots 😭
 
Top