tustin / fortnite-php Goto Github PK
View Code? Open in Web Editor NEWA PHP wrapper for the official Fortnite API
License: MIT License
A PHP wrapper for the official Fortnite API
License: MIT License
Hello, whenver I run my php function to refresh my current player data by using the refresh function from Auth I get this error.
PHP Notice: Undefined property: stdClass::$access_token in /var/www/third_party/fortnite-api/vendor/tustin/fortnite-php/src/Auth.php on line 121
PHP Fatal error: Uncaught Exception: Unable to unpack offline token: Invalid serialized unsecured/JWS/JWE object: Missing second delimiter in /var/www/third_party/fortnite-api/vendor/tustin/fortnite-php/src/Auth.php:122
Stack trace:
#0 /home/cron/fortnite.php(14): Fortnite\Auth::refresh('eg1~eyJraWQiOiJ...')
#1 {main}
thrown in /var/www/third_party/fortnite-api/vendor/tustin/fortnite-php/src/Auth.php on line 122
I don't know what the error could be since I'm using the token 30sec right after I get the token.
Hello,
I have a problem with the installation, here it is:
My command: composer require tustin/fortnite-php
Result: Root package 'tustin/fortnite-php' cannot require itself in its composer.json
Did you accidentally name your root package after an external package?
Hi
First of all thanks for this awesome API.
So the problem I'm having with it is that after many requests with an epic games account it gives me an error saying that I have too many connections going on.
Is that a way to logout after retrieving data with the api?
This is the error:
https://i.gyazo.com/84e4efe60a54bd90b12d835a0b0826ef.png
PHP Parse error: syntax error, unexpected 'array' (T_ARRAY), expecting ';' or '{' in /var/www/fortniteleaderboards.org/vendor/tustin/fortnite-php/src/Stats.php on line 98
Is there any way to pull friend messages and requests from the API?
Fatal error: Uncaught exception 'GuzzleHttp\Exception\ClientException' with message 'Client error: `POST https://fortnite-public-service-prod11.ol.epicgames.com/fortnite/api/game/v2/profile/893913b952a44596ab99414dc183cf2a/client/QueryProfile?profileId=athena&rvn=-1` resulted in a `403 Forbidden` response: {"errorCode":"errors.com.epicgames.common.missing_action","errorMessage":"Login is banned or does not posses the action (truncated...) ' in /home/xpolishp/public_html/addon/xpolish.pl/discordbot/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:113 Stack trace: #0 /home/xpolishp/public_html/addon/xpolish.pl/discordbot/vendor/guzzlehttp/guzzle/src/Middleware.php(66): GuzzleHttp\Exception\RequestException::create(Object(GuzzleHttp\Psr7\Request), Object(GuzzleHttp\Psr7\Response)) #1 /home/xpolishp/public_html/addon/xpolish.pl/discordbot/vendor/guzzlehttp/promises/src/Promise.php(203): GuzzleHttp\Middleware::GuzzleHttp\{closure}(Object(GuzzleHttp\Psr7\Response)) #2 /home/xpolishp/public_html/addon/xpolish.pl/disc in /home/xpolishp/public_html/addon/xpolish.pl/discordbot/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php on line 113
Fortnite server status class needs implementing.
Hello, a user using my website reported for an issue with his account, i tried to get data using his name and his id but i get this error "Invalid argument supplied for foreach()",
He is a ps4 user and changed his name on epic and ps4 newly after the change he started getting this error.
Fatal error: Uncaught GuzzleHttp\Exception\ServerException: Server error: 'POST https://fortnite-public-service-prod11.ol.epicgames.com/fortnite/api/leaderboards/type/global/stat/br_placetop1_pc_m0_p10/window/weekly?ownertype=1&itemsPerPage=50
resulted in a 500 Internal Server Error' response: {"errorCode":"errors.com.epicgames.common.server_error","errorMessage":"Sorry an error occurred and we were unable to re (truncated...) in C:\xampp\htdocs\fortnite\vendor\guzzlehttp\guzzle\src\Exception\RequestException.php:113 Stack trace: #0 C:\xampp\htdocs\fortnite\vendor\guzzlehttp\guzzle\src\Middleware.php(66): GuzzleHttp\Exception\RequestException::create(Object(GuzzleHttp\Psr7\Request), Object(GuzzleHttp\Psr7\Response)) #1 C:\xampp\htdocs\fortnite\vendor\guzzlehttp\promises\src\Promise.php(203): GuzzleHttp\Middleware::GuzzleHttp\{closure}(Object(GuzzleHttp\Psr7\Response)) #2 C:\xampp\htdocs\fortnite\vendor\guzzlehttp\promises\src\Promise.php(156): GuzzleHttp\Promise\Promise::callHandler(1, Object(GuzzleHttp\Psr7\Response), in C:\xampp\htdocs\fortnite\vendor\guzzlehttp\guzzle\src\Exception\RequestException.php on line 113
{#448 โผ
+"errorCode": "errors.com.epicgames.common.oauth.unauthorized_client"
+"errorMessage": "Sorry your client is not allowed to use the grant type password"
+"messageVars": []
+"numericErrorCode": 1015
+"originatingService": "com.epicgames.account.public"
+"intent": "prod"
+"error_description": "Sorry your client is not allowed to use the grant type password"
+"error": "unauthorized_client"
}
Did they change anything recently? It was working yesterday
Fatal error: Uncaught GuzzleHttp\Exception\ClientException: Client error: POST https://fortnite-public-service-prod11.ol.epicgames.com/fortnite/api/game/v2/profile/62d343e3caea47e881e8919e31b8f1ac/client/QueryProfile?profileId=athena&rvn=-1
resulted in a 403 Forbidden
response: {"errorCode":"errors.com.epicgames.common.missing_action","errorMessage":"Login is banned or does not posses the action (truncated...) in E:\Programmi\XAMPP\htdocs\provaTinti\vendor\guzzlehttp\guzzle\src\Exception\RequestException.php:113 Stack trace: #0 E:\Programmi\XAMPP\htdocs\provaTinti\vendor\guzzlehttp\guzzle\src\Middleware.php(66): GuzzleHttp\Exception\RequestException::create(Object(GuzzleHttp\Psr7\Request), Object(GuzzleHttp\Psr7\Response)) #1 E:\Programmi\XAMPP\htdocs\provaTinti\vendor\guzzlehttp\promises\src\Promise.php(203): GuzzleHttp\Middleware::GuzzleHttp{closure}(Object(GuzzleHttp\Psr7\Response)) #2 E:\Programmi\XAMPP\htdocs\provaTinti\vendor\guzzlehttp\promises\src\Promise.php(156): GuzzleHttp\Promise\Promise::callHandler(1, in E:\Programmi\XAMPP\htdocs\provaTinti\vendor\guzzlehttp\guzzle\src\Exception\RequestException.php on line 113
Hello,
The latest commit on master fixes an issue with "Division by zero" but the commit is not tagged as a release so i can't download the fixed version through composer
Calling $auth->leaderboard->find(platform, mode) throws the following error:
"Undefined property: Fortnite\Leaderboard::$account" at:
$accounts = $this->account->getDisplayNamesFromID($ids);
Hello I have some problems with latest version.
Get leadeboards is not working because:
Uncaught Error: Class 'Platform' not found
news and store not working because
Uncaught Error: Class 'Language' not found
Full error:
FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Error: Class 'Language' not found in /domain/file.php:5
Stack trace:
#0 {main}
thrown in /domain/file.php on line 5" while reading response header from upstream
My code:
<?php
require_once 'vendor/autoload.php';
use Fortnite\Auth;
$auth = Auth::login('[email protected]','x');
var_dump($auth->store->getStore(Language::ENGLISH));
Help I get this error:
Fatal error: Uncaught GuzzleHttp\Exception\ClientException: Client error: POST https://fortnite-public-service-prod11.ol.epicgames.com/fortnite/api/game/v2/profile/848a9343e9124aed8b188677ddc40278/client/QueryProfile?profileId=athena&rvn=-1 resulted in a 403 Forbidden response: {"errorCode":"errors.com.epicgames.common.missing_action","errorMessage":"Login is banned or does not posses the action (truncated...) in .....
There is a way to get active challenges?
Hey,
is there a way to get the stats of a switch/IOS/Android profile?
Hi, I'm not sure if this is an issue, but I got problems getting constants SAVETHEWORLD
and BATTLEROYALE
of news module.
<br /> <b>Warning</b>: Use of undefined constant SAVETHEWORLD - assumed 'SAVETHEWORLD'
Maybe adding Self before constants:
35 if ($type != Self::SAVETHEWORLD && $type != Self::BATTLEROYALE)
36 throw new \Exception("Only SaveTheWorld and BattleRoyale news are currently supported");
Solves the problem. #33
Hello, I just install package and configure it but now I can see API is no longer accessible.
Client error: `POST https://fortnite-public-service-prod11.ol.epicgames.com/fortnite/api/game/v2/profile/10722fbb55c5414a9d5acc1427a838e5/client/QueryProfile?pr โถ
{"errorCode":"errors.com.epicgames.common.missing_action","errorMessage":"Login is banned or does not posses the action
I update User-Agent parameters to the latest version of the launcher and no success.
Hey! Great stuff, the Uri is what I've been looking for . . . lol and you have it. My question or issue is getting STW information - (stormshield one) style.
Can your wrapper do that ?
I just pushed a new commit to support challenges but I wasn't able to test them with the battle pass challenges as I don't own the battle pass. If someone who has it could test out the challenges and make sure they work, that would be great! Just post a reply stating if it works or not. Mostly just want to make sure you don't run into any parse errors with the Challenges class and also that getWeekly() and getWeeklys()
work fine.
Thanks!
I am now using php 7 but am getting this error? Any ideas?
PHP Warning: Division by zero in /var/www/fortnitetest/vendor/tustin/fortnite-php/src/Model/FortniteStats.php on line 72
PHP Fatal error: Uncaught Error: Call to undefined method Fortnite\Leaderboard::getLeaderboardData() in /var/www/fortnitetest/basic2.php:18
Stack trace:
#0 {main}
thrown in /var/www/fortnitetest/basic2.php on line 18
HI, there's an error. Pls can u help me.
Fatal error: Uncaught GuzzleHttp\Exception\ClientException: Client error: POST https://account-public-service-prod03.ol.epicgames.com/account/api/oauth/token
resulted in a 400 Bad Request
response: { "errorCode" : "errors.com.epicgames.account.invalid_account_credentials", "errorMessage" : "Sorry the account cred (truncated...) in /Users/migueld/projects/php/fortnite_api/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:113 Stack trace: #0 /Users/migueld/projects/php/fortnite_api/vendor/guzzlehttp/guzzle/src/Middleware.php(66): GuzzleHttp\Exception\RequestException::create(Object(GuzzleHttp\Psr7\Request), Object(GuzzleHttp\Psr7\Response)) #1 /Users/migueld/projects/php/fortnite_api/vendor/guzzlehttp/promises/src/Promise.php(203): GuzzleHttp\Middleware::GuzzleHttp{closure}(Object(GuzzleHttp\Psr7\Response)) #2 /Users/migueld/projects/php/fortnite_api/vendor/guzzlehttp/promises/src/Promise.php(156): GuzzleHttp\Promise\Promise::callHandler(1, Object(GuzzleHttp\Psr7\Response), Array) #3 /Users/migueld/proje in /Users/migueld/projects/php/fortnite_api/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php on line 113
I also used your fortnitetracker app.
and I have this error
(1/1) ClientException
Client error: POST https://account-public-service-prod03.ol.epicgames.com/account/api/oauth/token
resulted in a 400 Bad Request
response:
{
"errorCode" : "errors.com.epicgames.account.invalid_account_credentials",
"errorMessage" : "Sorry the account cred (truncated...)
Hi, I am getting this error when trying to retrieve the BattleRoyale news:
PHP Fatal error: Uncaught Error: Undefined class constant 'BATTLEROYALE'
Solved:
Used NewsType::'BATTLEROYALE'
instead of News::'BATTLEROYALE'
Not Sure if the contribution message is related.
However, I am getting the following error when trying to run the test php file in cmd (Windows)
PHP Fatal error: Uncaught GuzzleHttp\Exception\RequestException: cURL error 60: SSL certificate problem: unable to get local issuer certificate (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)
Any ideas on how to resolve this issue in order to use this wrapper?
Thanks
[kill_death_ratio] => 0
Is always set to 0.
[kill_death_per_game] => 4.51
But we have kill_death_per_games
hello, is there a possibility to search the profile of a friend to see his stats ????
Hello, I was wondering if there's a way to see if a player is currently in a game.
hi, i still use this api with php and get this error when search someone users.
Fatal error: Uncaught exception 'Fortnite\Exception\UserNotFoundException' with message 'User NAMEPLAYER was not found.' in /web/htdocs/src/vendor/tustin/fortnite-php/src/Stats.php:79 Stack trace: #0 /web/htdocs/test.php(14): Fortnite\Stats->lookup('NamePlayer') #1 {main} thrown in /web/htdocs/src/vendor/tustin/fortnite-php/src/Stats.php on line 79
i get this error only with this api, if i use a web fortnite tracker finded on google, it' works.
Cant i get the stats for a specific season, not alltime?
i tried to change in stats.php from bulk/window/alltime to season4 or season5 it doesn't work :/
how fortnitetracker and fortnite api gets the stats of each season ?
Hello
Is there any reason why you're ignoring the 'lastmodified' attribute from the raw stats?. That number would greatly reduce the amount of validation i'd need to do for storing historical statistics
2FA needs fixing (never got the original working) and needs to be supported in the rewrite.
hello, how can i encode the store result to json? im tryint to make an app and i need json to parse it!
Hi!
Is there a way that I can retrieve the news information located at this link?
https://www.epicgames.com/fortnite/en-US/news
I thought that the code below would get it but it doesn't.
Any ideas? Perhaps I am missing something?
Thank you, kindly.
It takes around 3-4 seconds to receive the data.
Is there anyway to speed this up?
Anyone meet this like me? Don't know why and need help.
Thanks a lot.
403
{"errorCode":"errors.com.epicgames.common.missing_action","errorMessage":"Login is banned or does not posses the action 'PLAY' needed to perform the requested operation for platform ''","messageVars":["PLAY",""],"numericErrorCode":1023,"originatingService":"fortnite","intent":"prod-livecn"}
Hello, I found a problem, I have 4 account on fortnite for testing with data (xbox one, ps4 ,switch and PC).
When i try to connect on my PS4 account with the
$auth = Auth::login('[email protected]','password');
that not work and when I try with the PC account or Xbox One that work.
Someone can help me please ?
Thank
When I try to login, I receive the following error message:
Two-Factor authentication required to process request.
Is there any way to support 2-factor authentication?
Know anyone how to convert or decode the offerId for items at the store.
EX:
offerId: 11fb033c9cf9e251b35b7487cdea9357135054de607c011913609b06eae7d8d9 (I get this string direct from Epic Games API).
TO:
Item ID (api): d633710-bf33be9-4821704-8e006cf
Many thanks! :)
Implement #44 on the rewrite.
Where can I get the 'vendor/autoload.php' ?
Hello, i have little problem
erreur
Fatal error: Uncaught Error: Class 'GuzzleHttp\Client' not found in /home/xxxxxx/api/xxxxxx/libs/Fortnite/FortniteClient.php:67
Stack trace: #0 /home/xxxxxx/api/xxxxxx/libs/Fortnite/Auth.php(48)
Fortnite\FortniteClient::sendUnrealClientPostRequest('https://account...', Array) #1 /home/xxxxxx/api/xxxxxx/index.php(7):
Fortnite\Auth::login('xxxxxx@xxxxxx', 'xxxxxx')
#2 {main} thrown in /home/xxxxxx/api/xxxxxx/libs/Fortnite/FortniteClient.php on line 67
code
<?php
require_once 'libs/Fortnite/auto_loader.php';
use Fortnite\Auth;
$auth = Auth::login('xxx','xxx);
var_dump($auth->profile->stats);
?>
in auto_loader.php
require_once('Exception/InvalidGameModeException.php');
require_once('Exception/InvalidStatException.php');
require_once('Exception/StatsNotFoundException.php');
require_once('Exception/UserNotFoundException.php');
require_once('Model/FortniteStats.php');
require_once('Model/Items.php');
require_once('Auth.php');
require_once('Stats.php');
require_once('Platform.php');
require_once('Profile.php');
require_once('FortniteClient.php');
If you know how to solve my problem, in any case very pretty work ๐
Hello i know you have addressed this , can you tell me when it will be available via composer?
I need all data for accounts with and without 2 factor if possible
thanks in advance.
Hello Tustin, Here is a cleanup for the K/D ratio in
FortniteStats.php
$this->kill_death_ratio = ($this->matches_played - $this->wins === 0) ? 0 : round(@($this->kills) / ($this->matches_played - $this->wins), 2);
Hi, when player stats are fetched I think that something is not working properly, for example, the top 3, 5, 6, 12 and maybe more, always are 0.
Someone noticed about this?
Thanks
how i can terminate all sessions created with login function of AUTH class?
Fatal error: Uncaught exception 'RuntimeException' with message 'GuzzleHttp requires cURL, the allow_url_fopen ini setting, or a custom HTTP handler.' in /users/tusta/www/EpicRoyale/vendor/guzzlehttp/guzzle/src/functions.php:119 Stack trace: #0 /users/tusta/www/EpicRoyale/vendor/guzzlehttp/guzzle/src/HandlerStack.php(40): GuzzleHttp\choose_handler() #1 /users/tusta/www/EpicRoyale/vendor/guzzlehttp/guzzle/src/Client.php(65): GuzzleHttp\HandlerStack::create() #2 /users/tusta/www/EpicRoyale/vendor/tustin/fortnite-php/src/FortniteClient.php(74): GuzzleHttp\Client->__construct() #3 /users/tusta/www/EpicRoyale/vendor/tustin/fortnite-php/src/Auth.php(55): Fortnite\FortniteClient::sendUnrealClientPostRequest('https://account...', Array) #4 /users/tusta/www/EpicRoyale/index.php(34): Fortnite\Auth::login('', '') #5 {main} thrown in /users/tusta/www/EpicRoyale/vendor/guzzlehttp/guzzle/src/functions.php on line 119
Hello, i found this endpoint: https://fortnite-public-service-prod11.ol.epicgames.com/fortnite/api/calendar/v1/timeline for game events.
You can get results only get request.
Also this endpoint: https://fortnite-public-service-prod11.ol.epicgames.com/fortnite/api/storefront/v2/keychain
Hello,
Just wanted to start off by saying awesome work here. Is anyone aware of a match stats endpoint? Something that provides maybe damage done, damage taken, etc..
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.