Getting Started
This guide is intended to get you up-and-running with real-world applications based on the Pandascore REST API. We'll cover everything you need to know, from authentication to results manipulation.
๐ Authentication
Access to our APIs is restricted by a token-based authentication. In other words, your account is associated with a unique secret key that is required to connect to the API endpoints. You can find your API token on your account page.
In order to identify you, we will require you to send your token with every HTTP request you make. This can be achieved in two different ways. You can either set it in the Authorization request header (e.g. Authorization: Bearer YOUR_TOKEN
), or you can include it directly in the token parameter of the URL (e.g. https://api.pandascore.co/some-url?token=YOUR_TOKEN
).
This token is private, be careful not to use it in client-side applications.
๐ Making your first request
Now, you have everything you need to call the API from your application.
Let's try to get all of the League of Legends champions:
curl -gi "https://api.pandascore.co/lol/champions?token=YOUR_TOKEN"
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Link: <https://api.pandascore.co/lol/champions?page=3&token=YOUR_TOKEN>; rel="last", <https://api.pandascore.co/lol/champions?page=2&token=YOUR_TOKEN>; rel="next"
X-Page: 1
X-Per-Page: 50
X-Request-Id: c51e8cf0-c397-421c-8a09-44c126f55a36
X-Runtime: 0.077614
X-Total: 133
[{"id":68,"name":"Twitch","armor":23,"armorperlevel":3,"attackdamage":49,"attackdamageperlevel":3,"attackrange":550, ...}, (...)]
We can see that our request returned only 50 items, that's because our API is paginated.
๐ Want to go further?
Continue by reading the full REST API documentation.