Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hilliamt/node-steam-miniprofile
Fetches miniprofile data on any steam user
https://github.com/hilliamt/node-steam-miniprofile
steam-api
Last synced: 6 days ago
JSON representation
Fetches miniprofile data on any steam user
- Host: GitHub
- URL: https://github.com/hilliamt/node-steam-miniprofile
- Owner: HilliamT
- License: mit
- Created: 2021-01-05T03:45:50.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2021-07-11T10:48:22.000Z (over 3 years ago)
- Last Synced: 2024-10-13T01:01:36.296Z (about 1 month ago)
- Topics: steam-api
- Language: TypeScript
- Homepage:
- Size: 28.3 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# node-steam-miniprofile
### **Table of Contents**
- [Introduction](#introduction)
- [Getting Started](#getting-started)
- [Usage](#usage)
- [Example](#example)
- [Types](#types)### Introduction
A module to fetch Steam miniprofile data on any Steam user. This wraps around the `https://steamcommunity.com/miniprofile//json` endpoint.### Getting Started
You can download this from npm using the following command.```bash
npm install steam-miniprofile
```##### Usage
This module exports two functions, `getMiniprofile` and `getMiniprofileByID64` which both return a Promise that resolves to a `Miniprofile`.
##### Example
```typescript
const accountid = "120816906";
const steamid64 = "76561198081082634";
...
const miniprofile = await getMiniprofile(accountid);
console.log(miniprofile.level);
...
const { level, ... } = await getMiniprofileByID64(steamid64);
console.log(level);
...
```##### Types
The interface `Miniprofile` can be found below.```typescript
interface MiniProfile {
level: number;
level_class: string; // Determines badge
avatar_url: string; // Full image url
persona_name: string; // Current display namefavorite_badge?: {
name: string;
xp: string;
level: number;
description: string;
icon: string;
},
profile_background?: {
"video/webm": string;
"video/mp4": string;
image: string;
},
avatar_frame?: string;
}
```