Skip to content

r3spberry/js-wrapper

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JavaScript wrapper for Fortnite-API.com

GitHub release (latest by date) GitHub issues MIT License

This repository offers an async request API around the endpoints of fortnite-api.com.

Browser support

Because we used the more modern fetch API as our alternative of XMLHttpRequest you may experience problems on old browsers and especially on older mobile browsers.

Please use a polyfill for the fetch api (like this) if you want to support them.

Deployment

You can use this by either downloading one of the releases or by using the file provided by jsDelivr.

<script type="text/javascript" src="https://cdn.jsdelivr.net/gh/Fortnite-API/js-wrapper@0.2.0/dist/fortnite-api.min.js"></script>

Documentation

Here is a quick overview of the API so you can get started very quickly. If you need a real example, please take a look at our test file.

  • Accessing the API

We offer a const fortniteApi object with 3 properties where you can access the endpoints.

fortniteApi.cosmetics
fortniteApi.shop
fortniteApi.news

All methods are mapped to the exact same layout as on fortnite-api.com/documentation.

Each method can be used in async manner using either async/await or promises with .then/.catch.

  • Query parameters

Some methods like fortniteApi.cosmetics.search require a query parameter. In order to use them you need to provide them an object which later gets translated into to URL query parameters.

var promise = fortniteApi.cosmetics
  .search(
  {
    rarity: "uncommon",
    hasIcon: true
  });

Others like fortniteApi.cosmetics.searchIds may be supplied with an array of id's.

var promise = fortniteApi.cosmetics
  .searchIds(
  [
      "bannertoken_001_cattus",
      "bannertoken_008_s11_diamondshapes",
      "bannertoken_stw006_starlight6"
  ]);

Contribute

if you can provide any help, may it only be spell checking please contribute!

We are open for any contribution.

License

API developed by Fortnite-API.com

About

JavaScript implementation for https://fortnite-api.com

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 94.9%
  • HTML 5.1%