Coder Social home page Coder Social logo

andrevarandas / fortnite-api Goto Github PK

View Code? Open in Web Editor NEW
4.0 3.0 1.0 202 KB

A wrapper for the https://fortniteapi.com/ api.

License: MIT License

PHP 100.00%
fortnite fortnite-api php fortnitebr fortnite-stats fortnite-wrapper api-wrapper api

fortnite-api's Introduction

Deprecated

Unfortunately the team behind fortniteapi.com has moved into another project, making this wrapper obsolete.

But a there is a new api available at https://fortnite-api.com/ and there's also a PHP wrapper for it at https://github.com/Fortnite-API/php-wrapper

FortniteAPI.com

This is a wrapper for the https://fortniteapi.com/ API.

Fortnite API (get player stats WITH STATS V2, leaderboards and more)

You can get user wins, kills, the latest news, fortnite server status and many more with this API.

logo

About

This is an updated wrapper of https://github.com/samhoogantink/Fortnite-API. The API has changed and now most of the endpoints require an access token, so I've made the required changes and added the new endpoints.

You can see the available endpoints here https://docs.fortniteapi.com/?version=latest

Requirements

  1. Composer https://getcomposer.org/
  2. Authorization key. You can get one for free at https://console.fortniteapi.com/.

Install

Install with composer using: composer require varandas/fortnite-api && composer dump-autoload --optimize

Usage

<?php

// Require autoload
require 'vendor/autoload.php';

use Varandas\FortniteApi\FortniteClient;

// Get an instance of FortniteClient
$api = new FortniteClient();
$api->setKey("your api key");

/** ITEMS API **/

// Get the daily store
$data = $api->items->store();

// Get upcoming items
$data = $api->items->upcoming();

// List items
$data = $api->items->list();

// Get a random item
$data = $api->items->random();

// Get a popular item
$data = $api->items->popular();

// Get detailed data for an item
$data = $api->items->data('8403b27-7c9f125-ef5487b-552aeab');

// Search for an item
$data = $api->items->search('item name');

var_dump($data);

/** CHALLENGES **/

// Get season 3 challenges
$data = $api->challenges->get("season 3");

// Get current season challenges
$data = $api->challenges->get();

var_dump($data);

/** USERS **/

// First find a user:
$data = $api->user->id('ninja');

// After that we can query for user stats
$stats = $api->user->stats();

// If you want to query for old v1 stats:
$stats = $api->user->v1Stats();

/** WEAPONS **/

// List all current weapons:
$data = $api->weapons->get();

Disclaimer

Portions of the materials used are trademarks and/or copyrighted works of Epic Games, Inc. All rights reserved by Epic. This material is not official and is not endorsed by Epic.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.