npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@osirion/api

v2.0.1

Published

> A typescript client wrapper for the osirion public api

Downloads

121

Readme

@osirion/api

A typescript client wrapper for the osirion public api

This package makes it easy to use our public api for fortnite match data.

We recommend checking out the generated docs for our package on tsdocs.dev at https://tsdocs.dev/docs/@osirion/api.

Prerequisites

To use the api, you need to:

Once done, you can use the @osirion/api library.

Each api call costs credits, and 1000 credits is about equal to €1.

  • Uploading replays costs 20 credits (~€0.02).
  • Ping costs 1 credit per request (0.001€).
  • Every other request is charged based on a pay-as-you-go compute model. Credits are charged per second of compute used, with a 10-second minimum.
  • Match events are charged the same way but scaled by the number of events being requested. With a maximum of 8 events being charged.

Note that this is subject to change as we develop the api further.

Getting started

Install the @osirion/api package with your preferred package manager.

pnpm

pnpm add @osirion/api

npm

npm i @osirion/api

yarn

yarn add @osirion/api

Then, initialize the client:

import { OsirionClient } from '@osirion/api';

const osirion = new OsirionClient('<OSIRION_API_KEY>');

Once initialized, you can make async calls to request fortnite match data or upload fortnite replays to-be-parsed.

Uploading a replay

You can upload a replay by its filepath or the file buffer.

import fsp from 'fs/promises';

const filepath = '/path/to/file.replay';

// buffer
const buffer = await fsp.readFile(filepath);
const trackingId = await osirion.uploadReplay(buffer);

// filepath
const trackingId = await osirion.uploadReplay(filepath);

Upload all replays

This uploads all replays in your demos folder, remember that one replay costs 20 credits, so this will likely cost a lot of credits.

const demoDir = `${process.env.LOCALAPPDATA}/FortniteGame/Saved/Demos`;
const demoDirEntries = await fsp.readdir(demoDir);
const demos = demoDirEntries.filter((f) => f.endsWith('.replay'));

for (const demo of demos) {
	const trackingId = await osirion.uploadReplay(`${demoDir}/${demo}`);
	console.info(`Uploaded ${demo}: ${trackingId}`);
}

Check upload status

You can check the status of a uploaded replay with the returned track id.

const result = await osirion.getUploadStatus("<TrackingId>");

// pending
{
    status: 'PENDING',
    matchId: ''
}

// parsed
{
    status: 'COMPLETE',
    matchId: 'e55969a0a86d7b4e843e912f752c2a35'
}

Get matches

This operation returns a sorted list of the matches for specified Epic IDs. Include options to select from specific time periods, seasons, or to limit the number of returned matches.

const matches = await osirion.getMatches(['<EpicAccountId1>', '<EpicAccountId2>']);

Get match info

You can get basic info about a match using a match ID.

const match = await osirion.getMatchInfo('<MatchId>');

Get match events

You can get specific events from a match.

// here we get all cosmetic and normal player events
const events = await osirion.getMatchEvents('<MatchId>', ['cosmeticsV2', 'players']);

Get available credits

You can get the available credits left on your osirion account.

const credits = await osirion.getCredits();

Get tournament player stats

You can get player stats for tournaments with filters (stats from server replays).

// get player stats for that specific event window (tournament session)
const playerStats = await osirion.getTournamentPlayerStats({
	eventWindowId: 'S34_PerformanceEvaluation_Event1Round1_EU',
});

Disclaimer

The public api is in its early stages, and it may have periods of downtime. This client wrapper library may also have bugs and issues, and the docs may be outdated.

If you have questions or feedback, please contact the Osirion team on our discord server.