All Projects → filp → oversmash

filp / oversmash

Licence: MIT license
Overwatch API library for player details and career stats

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to oversmash

python-overwatch
A simple API for scraping Overwatch stats
Stars: ✭ 14 (-66.67%)
Mutual labels:  overwatch, scraping
ioweb
Web Scraping Framework
Stars: ✭ 31 (-26.19%)
Mutual labels:  scraping
MetropolisLauncher
A data-heavy Emulation & Gaming front-end for Windows
Stars: ✭ 35 (-16.67%)
Mutual labels:  gaming
RARBG-scraper
With Selenium headless browsing and CAPTCHA solving
Stars: ✭ 38 (-9.52%)
Mutual labels:  scraping
pyradox
Python parser for Paradox .txt files.
Stars: ✭ 28 (-33.33%)
Mutual labels:  gaming
scrapy-fieldstats
A Scrapy extension to log items coverage when the spider shuts down
Stars: ✭ 17 (-59.52%)
Mutual labels:  scraping
awesome-gnu-linux-gaming
A curated list of awesome GNU/Linux tips & tricks, games, tools, and resources - Mirrored from: https://gitlab.com/linuxcafefederation/awesome-gnu-linux-gaming.git
Stars: ✭ 135 (+221.43%)
Mutual labels:  gaming
competiwatch-desktop
Desktop app built in Electron for tracking your competitive match history in Overwatch.
Stars: ✭ 94 (+123.81%)
Mutual labels:  overwatch
shorter.recipes
A website dedicated to making recipes from any website easy to read.
Stars: ✭ 27 (-35.71%)
Mutual labels:  scraping
4cat
The 4CAT Capture and Analysis Toolkit provides modular data capture & analysis for a variety of social media platforms.
Stars: ✭ 144 (+242.86%)
Mutual labels:  scraping
arch-guide
My installation instructions and guide for Arch Linux
Stars: ✭ 25 (-40.48%)
Mutual labels:  gaming
html-table-to-json
Generate JSON representations of HTML tables
Stars: ✭ 39 (-7.14%)
Mutual labels:  scraping
valheim-ecs-fargate-cdk
AWS CDK/Cloudformation to deploy a Valheim Server using ECS Fargate!
Stars: ✭ 66 (+57.14%)
Mutual labels:  gaming
Architeuthis
MITM HTTP(S) proxy with integrated load-balancing, rate-limiting and error handling. Built for automated web scraping.
Stars: ✭ 35 (-16.67%)
Mutual labels:  scraping
asyncio-hn
Python (asyncio) wrapper for hackernews api
Stars: ✭ 27 (-35.71%)
Mutual labels:  scraping
socials
👨‍👩‍👦 Social account detection and extraction in Python, e.g. for crawling/scraping.
Stars: ✭ 37 (-11.9%)
Mutual labels:  scraping
ScrapeBot
A Selenium-driven tool for automated website interaction and scraping.
Stars: ✭ 16 (-61.9%)
Mutual labels:  scraping
diffbot-php-client
[Deprecated - Maintenance mode - use APIs directly please!] The official Diffbot client library
Stars: ✭ 53 (+26.19%)
Mutual labels:  scraping
lambda-moo-programming
Lambda MOO Programming collects and updates numerous MOO guides in one place and includes an updated and expanded version of the MOO Programmer's Manual in markdown and HTML5. It also includes the ToastStunt Programmers Guide and links to ToastStunt references.
Stars: ✭ 40 (-4.76%)
Mutual labels:  gaming
awesome-game-essays
Thoughtful and noteworthy links to awesome videogame "essay" kind of content .🎮
Stars: ✭ 25 (-40.48%)
Mutual labels:  gaming

oversmash npm version

Important note:

As of October 2022, Blizzard has disabled the pages and APIs used by Oversmash to capture player data, due to the release of Overwatch 2 (replacing Overwatch 1). This library will be updated with a 2.x release accordingly once Blizzard releases new information on new player profiles and APIs.


API wrapper for Blizzard's Overwatch player stats. Uses promises.

Blizzard does not expose an official API, so this library relies partially on scraping, using cheerio.

Please also keep in mind there is no builtin rate-limiting support, so it's on you to use the library responsibly.

Note: See CHANGELOG.MD for change details

Features

  • Ability to retrieve basic user information, such as name, portrait, level and accounts
    • Correctly identifies the platform for each account
  • Ability to retrieve detailed stats for a player, for a given region and platform
    • Includes all stats available on playoverwatch.com
    • Includes the player's current competitive rank
    • Includes full list of achievements, with details on which the player has completed
    • Stats are retrieved and grouped automatically per career type (quickplay/competitive), hero, and group (e.g combat, awards, etc)
    • Supports new heroes and new types of stats as they're added, no changes required to the code
  • Supports normalizing names and values (e.g converting achievement names to snake_case, properly handling floating-point values in stats, etc)
  • Minimalist and straightforward API

Usage

Install through npm or yarn:

$ yarn add oversmash
# or
$ npm i -S oversmash

Example:

import oversmash from 'oversmash';

// Create a new oversmash object. `oversmash()` accepts an options
// object (see below)
const ow = oversmash();

// Get basic details about a user, including their platform accounts.
//
ow.player('bob#12345').then((player) => {
  console.log(player);
});

// Output:
// { name: 'bob#12345',
//   accounts:
//    [ { level: 440,
//        portrait: 'https://blzgdapipro-a.akamaihd.net/game/unlocks/xyz.png',
//        displayName: 'bob#12345',
//        platform: 'pc' } ] }

// Get detailed stats about a user, including
// achievements unlocked, per-career and per-hero stats, and their
// current competitive rank
ow.playerStats('bob#12345', 'pc').then((player) => {
  console.log(player);
});

// Output:
// { name: 'bob#12345',
//   region: 'us',
//   platform: 'pc',
//   stats:
//    { competitiveRank: { support: 1234, tank: 1234, damage: 1234 },
//      endorsementLevel: 3,
//      gamesWon: 2500,
//      achievements:
//       [ { name: 'centenary', achieved: true },
//         { name: 'level_10', achieved: true },
//         { name: 'level_25', achieved: true },
//         { name: 'level_50', achieved: true },
//         { name: 'undying', achieved: true },
//         { name: 'survival_expert', achieved: true },
//         /* ... etc ... */],
//      quickplay:
//       { all: { /* avg stats across all characters */ }
//         reaper:
//          { combat:
//             { melee_final_blows: 190,
//               solo_kills: 2922,
//               objective_kills: 6592,
//               final_blows: 9519,
//               damage_done: 6897,
//               eliminations: 18456,
//               environmental_kills: 83,
//               multikills: 155 },
//            assists:
//             { healing_done: 1102,
//               recon_assists: 25,
//               teleporter_pads_destroyed: 18 },
//            best:
//             { eliminations_most_in_game: 44,
//               final_blows_most_in_game: 27,
//               damage_done_most_in_game: 17491,
//   /* ... etc ... */

oversmash() options

The following options are configurable.

{
  // Convert things like stat group names to snake_case (e.g ana.awards.medalsBronze vs ana.awards.medals_bronze)
  normalizeNames: true,

  // When set to snake, names are normalized as snake_case; when set to camel,
  // names are lowerCamelCase. Only applies if normalizeNames is enabled.
  normalizeNamesAs: 'snake' || 'camel',

  // Convert values to their correct format, e.g numbers in stats to JS numbers
  // When disabled, all stats values are strings as extracted from Blizzard
  normalizeValues: true,

  // Convert percentage values to ints, e.g '32%' to 32
  percentsToInts: true,

  // The url template used to build the full portrait url, where the player's Overwatch
  // career icon/profile image is available.
  //
  // %s is replaced with the value from the player's profile.
  portraitUrlTemplate: 'https://d1u1mce87gyfbn.cloudfront.net/game/unlocks/%s.png',

  // Default platform if none is specified in the options
  defaultPlatform: 'pc',

  baseURL: 'https://playoverwatch.com/en-us',
  headers: {
    'User-Agent': 'https://github.com/filp/oversmash (hi jeff)'
  }
}

Debugging

oversmash uses debug. Run your code calling oversmash with DEBUG=oversmash:* to enable debug logging

Stuff 🐝 🐝 🐝

See LICENSE.md for license information

Contributions are welcome - please follow the style guidelines as enforced by the included .eslintrc!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].