API: Difference between revisions

From PirateCraft
No edit summary
No edit summary
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
<code>__TOC__</code><code></code>PirateCraft application programming interface allowing access to data of the PirateCraft ecosystem.
__TOC__
PirateCraft application programming interface allowing access to data of the PirateCraft ecosystem.
This API has been created from scratch by [[GodsDead]] for the website https://piratemc.com
 
'''API is NOT currently public, this page has been created as a placeholder'''
 
=== Why? ===
To bring player statistics back to the website live, I needed a new way to get data between the live server and the web-server, so I made a JSON API, since these calls will be public anyway, I thought it best to write up how to use the APIs.
 
==Players API==
==Players API==
<p class="mw_paragraph">You can query players data by username or UUID using:
You can query players data by username or UUID using:
 
 
<syntaxhighlight lang="bash">
curl https://api.piratemc.com/pirate/<username>
</syntaxhighlight>
 
==Crews API==
This pulls overall data for all crews
 
 
<syntaxhighlight lang="bash">
curl https://api.piratemc.com/crews/<username>
</syntaxhighlight>
 
==Crew API==
This pulls a specific crews data




<syntaxhighlight line="line">
<syntaxhighlight lang="bash">
curl api.piratemc.com/players/<username>
curl https://api.piratemc.com/crew/<username>
</syntaxhighlight>
</syntaxhighlight>

Latest revision as of 12:29, 14 November 2019

PirateCraft application programming interface allowing access to data of the PirateCraft ecosystem. This API has been created from scratch by GodsDead for the website https://piratemc.com

API is NOT currently public, this page has been created as a placeholder

Why?[edit | edit source]

To bring player statistics back to the website live, I needed a new way to get data between the live server and the web-server, so I made a JSON API, since these calls will be public anyway, I thought it best to write up how to use the APIs.

Players API[edit | edit source]

You can query players data by username or UUID using:


curl https://api.piratemc.com/pirate/<username>

Crews API[edit | edit source]

This pulls overall data for all crews


curl https://api.piratemc.com/crews/<username>

Crew API[edit | edit source]

This pulls a specific crews data


curl https://api.piratemc.com/crew/<username>