jakejames/valorant-api-php-wrapper

PHP wrapper for the valorant api

1.0.0 2021-04-03 18:58 UTC

This package is auto-updated.

Last update: 2024-04-29 05:05:25 UTC


README

Latest Version on Packagist Build Status Total Downloads

This is a simple package for the recently released Valorant Api, it's a php wrapper that makes calling the api much easier. The package follows psr-12 standards and has complete test coverage.

Installation

You can install the package via composer:

composer require jakejames/valorant-api-php-wrapper

Note:

I don't currently have access to the match api endpoints due to it not being available in my policy

Usage

Instantiate the Valorant API class with your api token and your region. If you want to call the account endpoints for your riot account details then you need to use the riot region enum rather than the valorant enum.

For Valorant Calls:
new ValorantApi('Your riot API Token', ValorantRegion::EUROPE());
Example:
$api = new ValorantApi('Your riot API Token', ValorantRegion::EUROPE());

$api->content()->getContent();
$api->ranked()->getLeaderboardByAct('actId');
$api->match()->getRecentMatches('unrated');
$api->status()->getPlatformData();
For Riot Calls:
new ValorantApi('Your riot API Token', RiotRegion::EUROPE());
Example:
$api = new ValorantApi('Your riot API Token', RiotRegion::EUROPE());

$api->account()->getAccountByPuuid('Your Puuid');

The Valorant api has 5 classes available, each one has methods related to that class

  • Match
  • Content
  • Ranked
  • Status
  • Account
Response Formatting

Responses are returned inside a data array which contains the response from riot.

Success
array:2 [
  "data" => ['test']
  "status" => 200
]
Error
array:2 [
  "error" => "An unexpected error occurred, please try again"
  "status" => "403"
]

Testing

composer test

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email jakejames18@virginmedia.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

PHP Package Boilerplate

This package was generated using the PHP Package Boilerplate.