Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Tustin/fortnite-php
A PHP wrapper for the official Fortnite API
https://github.com/Tustin/fortnite-php
Last synced: about 2 months ago
JSON representation
A PHP wrapper for the official Fortnite API
- Host: GitHub
- URL: https://github.com/Tustin/fortnite-php
- Owner: Tustin
- License: mit
- Archived: true
- Created: 2018-02-18T03:33:29.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-10-01T14:35:56.000Z (almost 5 years ago)
- Last Synced: 2024-07-28T07:48:42.759Z (2 months ago)
- Language: PHP
- Size: 80.1 KB
- Stars: 51
- Watchers: 12
- Forks: 26
- Open Issues: 28
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Fortnite-PHP Wrapper
Interact with the official Fortnite API using PHP.[![Packagist](https://img.shields.io/packagist/l/doctrine/orm.svg)]()
[![Packagist](https://img.shields.io/packagist/v/Tustin/fortnite-php.svg)]()## Installation
Pull in the project using composer:
`composer require Tustin/fortnite-php`## Usage
Create a basic test script to ensure everything was installed properly
```php
profile->stats);// Grab someone's stats
$sandy = $auth->profile->stats->lookup('sandalzrevenge');
echo 'Sandy Ravage has won ' . $sandy->pc->solo->wins . ' solo games and ' . $sandy->pc->squad->wins . ' squad games!';
```### Get Leaderboards
```php
$auth = Auth::login('[email protected]','password');
var_dump($auth->leaderboard->get(Platform::PC, Mode::DUO));```
### Get News
```php
$auth = Auth::login('[email protected]','password');
var_dump($auth->news->get(News::BATTLEROYALE, Language::ENGLISH));
```### Get Store
```php
$auth = Auth::login('[email protected]','password');
var_dump($auth->store->get(Language::ENGLISH));
```### Get Challenges
```php
$auth = Auth::login('[email protected]','password');
// All weekly challenges
var_dump($auth->profile->challenges->getWeeklys());// Or just get a specific week (in this example, week 1)
var_dump($auth->profile->challenges->getWeekly(1));
```### Constants
```
Platform [ PC, PS4, XB1 ]Mode [ SOLO, DUO, SQUAD ]
Language [ ENGLISH, GERMAN, SPANISH, CHINESE, FRENCH, ITALIAN, JAPANESE ]
News [ BATTLEROYALE, SAVETHEWORLD ]
```## Contributing
Fortnite now utilizes SSL certificate pinning in their Windows client in newer versions. I suggest using the iOS mobile app to do any future API reversing as both cheat protections on the Windows client make it difficult to remove the certificate pinning. If SSL certificate pinning is added to the iOS version, I could easily provide a patch to remove that as the iOS version doesn't contain any anti-cheat.