GithubHelp home page GithubHelp logo

alfg / overwatch-api Goto Github PK

View Code? Open in Web Editor NEW
146.0 8.0 28.0 969 KB

:earth_americas: An Unofficial Overwatch HTTP API

Home Page: https://owapi.io/docs/

License: MIT License

JavaScript 99.38% Dockerfile 0.45% Procfile 0.17%
overwatch-api overwatch api blizzard esports

overwatch-api's Introduction

Overwatch API

An unofficial Overwatch and Overwatch League HTTP API and NodeJS module.

npm Build Status

Features

  • Profile Data*
  • Career Stats*
  • Overwatch League Data
    • Live Match
    • Standings
    • Schedule

**Please note, as of the JUNE 26, 2018 patch, Career Profiles will no longer be public by default (now defaults to Friends Only). An option to make Career Profiles visible has been added under Options > Social > Profile Visibility.

Your profile MUST be public to view most profile and career stats with this API.

Source: https://playoverwatch.com/en-us/news/patch-notes/pc#patch-47946

API Docs

See: https://owapi.io/docs/

NPM Module

If you wish to use the Javascript API in your own project, see api/README.md.

Demo

curl http://owapi.io/profile/pc/us/Jay3-11894
{
  "username": "Jay3",
  "level": 2970,
  "portrait": "https://d15f34w2p8l1cc.cloudfront.net/overwatch/190aa6150e33690e39a9c91308d5da9b2e262262657af26579b95e939c44d5ad.png",
  "endorsement": {
    "sportsmanship": {
      "value": 0.18,
      "rate": 18
    },
    "shotcaller": {
      "value": 0.44,
      "rate": 44
    },
    "teammate": {
      "value": 0.38,
      "rate": 38
    },
    "level": null,
    "frame": "https://static.playoverwatch.com/svg/icons/endorsement-frames-3c9292c49d.svg#_2",
    "icon": "data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQwIiB3aWR0aD0iNDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPjxjaXJjbGUgcj0iMTUuOTE1NDk0MzA5MTg5NTQiIGZpbGw9IiMyYTJiMmUiIHN0cm9rZS1kYXNoYXJyYXk9IjQ0IDU2IiBzdHJva2UtZGFzaG9mZnNldD0iMjUiIHN0cm9rZS13aWR0aD0iMyIgc3Ryb2tlPSIjZjE5NTEyIiBjeD0iNTAlIiBjeT0iNTAlIj48L2NpcmNsZT48Y2lyY2xlIHI9IjE1LjkxNTQ5NDMwOTE4OTU0IiBmaWxsPSJ0cmFuc3BhcmVudCIgc3Ryb2tlLWRhc2hhcnJheT0iMzggNjIiIHN0cm9rZS1kYXNob2Zmc2V0PSI4MSIgc3Ryb2tlLXdpZHRoPSIzIiBzdHJva2U9IiNjODFhZjUiIGN4PSI1MCUiIGN5PSI1MCUiPjwvY2lyY2xlPjxjaXJjbGUgcj0iMTUuOTE1NDk0MzA5MTg5NTQiIGZpbGw9InRyYW5zcGFyZW50IiBzdHJva2UtZGFzaGFycmF5PSIxOCA4MiIgc3Ryb2tlLWRhc2hvZmZzZXQ9IjQzIiBzdHJva2Utd2lkdGg9IjMiIHN0cm9rZT0iIzQwY2U0NCIgY3g9IjUwJSIgY3k9IjUwJSI+PC9jaXJjbGU+PHRleHQgeD0iNTAlIiB5PSI1MCUiIGR5PSIuM2VtIiBmb250LWZhbWlseT0iY2VudHVyeSBnb3RoaWMsYXJpYWwsc2Fucy1zZXJpZiIgZm9udC13ZWlnaHQ9IjMwMCIgZm9udC1zaXplPSIxNiIgc3Ryb2tlPSIjZjZmNmY2IiBzdHJva2Utd2lkdGg9IjEiIGZpbGw9IiNmNmY2ZjYiIHRleHQtYW5jaG9yPSJtaWRkbGUiPk5hTjwvdGV4dD48L3N2Zz4="
  },
  "private": false,
  "games": {
    "quickplay": {
      "won": 925,
      "played": 1671
    },
    "competitive": {
      "won": 145,
      "lost": 121,
      "draw": 4,
      "played": 270,
      "win_rate": 54.51
    }
  },
  "playtime": {
    "quickplay": "201:16:17",
    "competitive": "55:14:59"
  },
  "competitive": {
    "tank": {
      "rank": null,
      "rank_img": null
    },
    "damage": {
      "rank": 4553,
      "rank_img": "https://d1u1mce87gyfbn.cloudfront.net/game/rank-icons/rank-GrandmasterTier.png"
    },
    "support": {
      "rank": null,
      "rank_img": null
    }
  },
  "levelFrame": "https://d15f34w2p8l1cc.cloudfront.net/overwatch/9e8600f97ea4a84d822d8b336f2b1dbfe7372fb9f2b6bf1d0336193567f6f943.png",
  "star": "https://d15f34w2p8l1cc.cloudfront.net/overwatch/cd877430ccc400c10e24507dba972e24a4543edc05628045300f1349cf003f3a.png"
}

Install

Requirements

  • Node v8.0+
  • Redis
  • Or Docker
git clone https://github.com/alfg/overwatch-api.git
cd overwatch-api
npm install
npm start

Environment Variables

Set the following environment variables if you would like to override the default configuration.

REDIS_URL=redis://localhost:6379
CACHE_TTL=3600

Docker

A docker-compose.yml and Dockerfile are provided to easily setup an environment.

docker-compose build
docker-compose up

Development

This project is built using srv, a microservices stack based on express. After installation, run the project using the following:

node node_modules/srv-cli/build/srv app/index.js

nodemon is recommended for auto-reloading during development:

nodemon node_modules/srv-cli/build/srv app/index.js

Generate docs with the --docs app/routes flag.

See srv documentation for more info on srv specific options.

License

MIT

overwatch-api's People

Contributors

alfg avatar brunomoreira99 avatar derekholio avatar jenzk avatar kokonut27 avatar ozairp avatar rerbun avatar rxgx avatar shadorc avatar vomitaftertaste avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

overwatch-api's Issues

Clean up API/API documentation

Hey, I was looking at the overwatch-api npm package's documentation and I saw that the callback supposedly takes two arguments, err and data, where err contains error info and data is the response from the server, but as far as I can tell the second argument data is never actually used, and the first argument is used for both. I'm currently in the process of making a TypeScript types declaration file for the overwatch-api package so it would be helpful if you could either fix this or point me in the right direction for how the package works, thanks!

P.S. I really appreciate the work you've done on this package, nice to not have to manually figure this out myself 👍

Level doesn't factor in stars

My account is level 255, but the API returns level 55. I suspect this is because the official overwatch page shows 55 and has long numeric filenames for the stars under the portrait.

masteroverwatch.com shows the right value, so it looks like they've figured this out.

Endorsement level

Add endorsement_level to profile. The icon is rendered via 3 separate SVGs (one for each endorsement type).

<div class="EndorsementIcon-inner">
    <svg class="EndorsementIcon-background" viewBox="0 0 36 36">
        <circle cx="50%" cy="50%" r="15.915"></circle>
    </svg>
    <svg data-total="28" data-js="endorsement-border" data-value="25" class="EndorsementIcon-border EndorsementIcon-border--sportsmanship" style="stroke-dasharray: 88.2857, 100; transform: rotate(360deg);" viewBox="0 0 36 36">
        <circle cx="50%" cy="50%" r="15.915"></circle>
    </svg>
    <svg data-total="28" data-js="endorsement-border" data-value="2" class="EndorsementIcon-border EndorsementIcon-border--teammate" style="stroke-dasharray: 6.14286, 100; transform: rotate(681.429deg);" viewBox="0 0 36 36">
        <circle cx="50%" cy="50%" r="15.915"></circle>
    </svg>
    <svg data-total="28" data-js="endorsement-border" data-value="1" class="EndorsementIcon-border EndorsementIcon-border--shotcaller" style="stroke-dasharray: 2.57143, 100; transform: rotate(707.143deg);" viewBox="0 0 36 36">
        <circle cx="50%" cy="50%" r="15.915"></circle>
    </svg>
</div>

[Feature Request] All Top Heroes stats

Hello,
it would be nice to have access to each Top Heroes stats.
I don't know if there is a reason for this but we can only get "Time Played" and "Games Won" stats.

Sadly, I can't make a pull request and test it for now but here are the overwatch.guid values for each category (if it can help) ;

Weapon Accuracy: 0x086000000000002F
Eliminations per Life: 0x08600000000003D2
Multikill - Best: 0x0860000000000346
Objective Kills - Average: 0x086000000000039C

Thanks for this amazing API !

Error: Cannot find module 'async'

Making a Discord Bot using this module.

This is the snippet of the code that's causing the error

    /**
     * Validates a provided Overwatch Account
     * @param {String} platform The users platform
     * @param {String} name The users name
     * @returns {Boolean}
    */
    overwatchValidate(platform, name) {
        return new Promise((resolve, reject) => {
            const overwatch = require("overwatch-api");
            const validatePlatforms = ["pc", "xbl", "psn", "switch"];

            if (!validatePlatforms.includes(platform)) {
                reject(new Error("Invalid Platform Provided"));
            }

            overwatch.getProfile(platform, "global", name, err => {
                if (err) {
                    reject(err);
                } else {
                    resolve(true);
                }
            });
        });
    }

This is the error

Error: Cannot find module 'async'
Require stack:
- C:\Users\----\Documents\----\ErisBot\node_modules\overwatch-api\lib\parser\profile.js
- C:\Users\----\Documents\----\ErisBot\node_modules\overwatch-api\lib\parser\index.js
- C:\Users\----d\Documents\----\ErisBot\node_modules\overwatch-api\lib\index.js
- C:\Users\----d\Documents\----\ErisBot\library\functions\account.js
- C:\Users\----\Documents\----\ErisBot\library\functions\index.js
- C:\Users\----\Documents\----\ErisBot\index.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:982:15)
    at Function.Module._load (internal/modules/cjs/loader.js:864:27)
    at Module.require (internal/modules/cjs/loader.js:1044:19)
    at require (internal/modules/cjs/helpers.js:77:18)
    at Object.<anonymous> (C:\Users\----\Documents\----\ErisBot\node_modules\overwatch-api\lib\parser\profile.js:10:37)
    at Module._compile (internal/modules/cjs/loader.js:1158:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
    at Module.load (internal/modules/cjs/loader.js:1002:32)
    at Function.Module._load (internal/modules/cjs/loader.js:901:14)
    at Module.require (internal/modules/cjs/loader.js:1044:19)

Rank returning null

See example:

http://ow-api.herokuapp.com/profile/pc/us/GunBlade-1949

{"username":"GunBlade","level":954,"portrait":"https://d1u1mce87gyfbn.cloudfront.net/game/unlocks/0x0250000000000BBB.png","games":{"quickplay":{"won":2015},"competitive":{"won":241,"lost":246,"draw":11,"played":498}},"playtime":{"quickplay":"492 hours","competitive":"108 hours"},"competitive":{"rank":null,"rank_img":null},"levelFrame":"https://d1u1mce87gyfbn.cloudfront.net/game/playerlevelrewards/0x025000000000097C_Border.","star":"https://d1u1mce87gyfbn.cloudfront.net/game/playerlevelrewards/0x025000000000097C_Rank."}

Player level images on PlayOverwatch page intermittently fails to load

Occasionally when loading a player's career page on playoverwatch.com, the player-rank and player-level's background-image returns back as null. Therefore, this causes the respective properties in the json response for profile and stats to also return as null. This also affects tests failing occasionally.

Example:
https://playoverwatch.com/en-us/career/pc/xQc-11273

<div style="background-image:url(null)" class="player-rank"></div>
{
  "username": "xQc",
  ...
  "levelFrame": "",
  "star": ""
}

I don't think there's much we can do to prevent this since this is on Blizzard's PlayOverwatch website, but will use this issue as a task to keep an eye on this.

Hitting api returns an empty object

When I hit the api with an account code I know exists, such as, http://ow-api.herokuapp.com/profile/pc/us/VoA-1535 or http://ow-api.herokuapp.com/profile/pc/us/cupchip-2806 I get an empty object response (no error or explanation).

This only happens sometimes. Other times it works fine with the same credentials. This only started happening a few days ago as far as I can tell.

I can try another account (such as http://ow-api.herokuapp.com/profile/pc/us/OctopusPrime-1324 and it works fine. It only seems to be happening to some accounts some of the time.

Any ideas? My initial thought is rate limiting (though I probably only hit it a few times a day). Do you have rate limiting set up per account by any chance?

Error when deploying to Heroku

Error says: No app.json located in the repo URL provided.

Make sure that an app.json file exists in the project root directory.

Use NPM Module: Cross-domain Error

Sorry to trouble you, when I use the JS API based on document Example in my project for the test, I got a Cross-domain problem error...I don't know how to solve it.
image

Regarding Player "Star" URLs

Hey guys! Apologies if this is the incorrect channel to ask about this, but I have a question about the "star" data returned by your API.

From a quick look at your code, it looks like the urls you are returning are directly pulled from playoverwatch. Have you noticed any pattern in the star URLs?

There appear to be many alternate images for each level of stars.
One bronze star, for example, can be represented by any of the following URLs, among many others:
https://blzgdapipro-a.akamaihd.net/game/playerlevelrewards/0x0250000000000924_Rank.png
https://blzgdapipro-a.akamaihd.net/game/playerlevelrewards/0x0250000000000925_Rank.png
https://blzgdapipro-a.akamaihd.net/game/playerlevelrewards/0x0250000000000926_Rank.png
https://blzgdapipro-a.akamaihd.net/game/playerlevelrewards/0x0250000000000927_Rank.png
https://blzgdapipro-a.akamaihd.net/game/playerlevelrewards/0x0250000000000928_Rank.png

This makes parsing the total level (prestige/stars + "level") a difficult task.
(Currently I have a list of many of the URLs and their associated star-count in a look-up table, but this is inelegant.)

Do you happen to know of any pattern or trick for discerning the appropriate star-count from these urls?

Regardless, thanks for providing this tool!
It has been a pleasure to incorporate into my groups tracking spreadsheet.

search suggestion

I am not sure if it's possible. But is there a way to have something like a suggestion of players if I don't remember the whole battle tag?

Another quick question, when the query is to console, is the required information still battletag? or will it be something like psn ID or xbox live username? I don't play/own a console so I am not sure.

Thanks a lot for your help in advance

API package: Cannot find module 'svg-builder'

When I use the overwatch-api module in a node script:

const overwatch = require('overwatch-api');

const platform = 'xbl';
const region = 'us';
const tag = 'RXGX';

overwatch.getProfile(platform, region, tag, (error, json) => {
  console.log(error, json);
});

I get the error:

internal/modules/cjs/loader.js:583
    throw err;
    ^

Error: Cannot find module 'svg-builder'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
    at Function.Module._load (internal/modules/cjs/loader.js:507:25)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (/Users/rxgx/Projects/rxgx/overwatch-test/node_modules/overwatch-api/lib/parser/svg.js:7:18)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (/Users/rxgx/Projects/rxgx/overwatch-test/node_modules/overwatch-api/lib/parser/profile.js:159:12)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (/Users/rxgx/Projects/rxgx/overwatch-test/node_modules/overwatch-api/lib/parser/index.js:8:16)
    at Module._compile (internal/modules/cjs/loader.js:689:30)

When I add svg-builder to the dev dependencies, the error goes away.

Not all stats available

Since I last used this library a year ago, I noticed it no longer exposes the per-hero stats. Is that intended?

Role queue stats missing

Latest Travis builds are failing due to role queue stats missing:

  "competitive": {
    "tank": {
      "rank": null,
      "rank_img": null
    },
    "damage": {
      "rank": null,
      "rank_img": null
    },
    "support": {
      "rank": null,
      "rank_img": null
    }
  },

I no longer see the Role Queue stats on the playoverwatch.com page:
https://playoverwatch.com/en-us/career/pc/xQc-11273

The parser can't find the DOM elements:

$('.competitive-rank div[data-ow-tooltip-text="Tank Skill Rating"] img').attr('src') || null;
$('.competitive-rank div[data-ow-tooltip-text="Damage Skill Rating"] img').attr('src') || null;
$('.competitive-rank div[data-ow-tooltip-text="Support Skill Rating"] img').attr('src') || null;
$('.competitive-rank div[data-ow-tooltip-text="Tank Skill Rating"]').next().html();
$('.competitive-rank div[data-ow-tooltip-text="Damage Skill Rating"]').next().html();
$('.competitive-rank div[data-ow-tooltip-text="Support Skill Rating"]').next().html();

Did Blizzard change something around Role Queue? Any input would be appreciated.

Thanks!

When profile doesn't exist, receive "Callback was already called."

To reproduce, use either getProfile() or getStats() with a tag that doesn't exist. The issue is that the parseHTML and getHTML functions are both trying to callback() an error for the same reason.

I solved this by removing the catch in the getHTML. Let the catch bubble up instead.

Searching names with simbol Ƕ

I'm testing your API and liking it so far compared to many others, the only problem i found was when the battletag has the simbol Ƕ (the one people use to make the nickname big) and i haven't found a way to fix it

Requesting PSN/XBL stats

So, getting profiles from PC works fine with Platform/Region/BattleTag.
But there's no Battletag for PS and Xbox.
So how do I get the stats for that?
I tried

let platform = 'psn'; let region = 'us'; let tag = '<insert psn name here>']; var profile;

OverwatchApi.getProfile(platform, region, tag, (err, json) => { if (err) { console.error(err); } else { let username = json.username; let level = json.level; let rank = json.competitive.rank;

but it didn't give back the results

help needed - routing

Thank you very much for developing this API. Hope this is not to improper to ask. I am trying to use this API just for practice and fun. I am very new to nodejs. I am trying to add a router to the code of this API but it's giving me bad request....
I have created a test.js file in the routes directory:

const express = require('express');
const router = express.Router();
router.get('/', (req, res) => {
console.log("test request received");
});
export default router

I also added 2 lines to the index.js file in the app directory:
import test from './routes/test';
export default function(app) {
app.use('/', index);
app.use('/profile', profile);
app.use('/stats', stats);
app.use('/test', test);
app.use('*', badRequest);
}

May I ask for some help on why am I getting bad request? I probably have not changed something important. Thanks a lot in advance.

Notice: Use overwatchy.com instead of ow-api.herokuapp.com

If you happen to be using the hosted HTTP API, the old DNS ow-api.herokuapp.com is now deprecated and redirecting to the new DNS overwatchy.com.

You can use the following DNS entries (both http/https):

overwatchy.com
www.overwatchy.com
api.overwatchy.com

Decay

I have been looking for a decay stat on any profile. Is this doable or possible to obtain/implement in this API?

[feature request] Add support for redis-based caching

As traffic increases on the hosted version of owapi.io, memory usage is higher due to the in-memory caching from node-cache module. We should switch to a database store such as redis, or maybe even an LRU cache.

This only applies to the express server, and not the npm api module.

Querying a player with no Rank yields a truncated result

The array returned for a player who has yet to receive a rank is missing the entry for rank_img entirely, rather than having an entry marked null.

This makes the results inconsistently sized depending on whether a player has earned their rank or not.

Attached are the results for two players, one of whom is ranked for the current season and has 13 fields, while the player who has yet to rank only has 12 fields.

01

Ideally the returned array for both players would be the same length, with a placeholder for players with no rank, as is the case in "rank=null" or "draw=0".

(Thanks for this tool by the way! People like you make the world go 'round!)

同学,您这个项目引入了567个开源组件,存在14个漏洞,辛苦升级一下

检测到 alfg/overwatch-api 一共引入了567个开源组件,存在14个漏洞

漏洞标题:handlebars 安全漏洞
缺陷组件:[email protected]
漏洞编号:CVE-2021-23369
漏洞描述:handlebars是一款语义化的Web模板系统。
handlebars 4.7.7版本之前存在安全漏洞,该漏洞源于在选择某些编译选项来编译来自不受信任的源的模板时,handlebars容易受到远程代码执行(Remote Code Execution, RCE)的攻击。
国家漏洞库信息:https://www.cnvd.org.cn/flaw/show/CNVD-2021-29741
影响范围:(∞, 4.7.7)
最小修复版本:4.7.7
缺陷组件引入路径:[email protected]>[email protected]>[email protected]>[email protected]

另外还有14个漏洞,详细报告:https://mofeisec.com/jr?p=a02d22

Heroku deployment crashes

Hi! I'm trying to use this for a school project, but having issues getting a running copy online. I just used the deploy to Heroku button, and it crashes on launch. Here are the logs:

2017-11-13T17:51:04.731103+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=final301overwatch.herokuapp.com request_id=54307148-bd0a-4ae9-a3b3-06e948886ea2 fwd="209.210.157.165" dyno= connect= service= status=503 bytes= protocol=https
2017-11-13T17:51:05.121829+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=final301overwatch.herokuapp.com request_id=78d7cadf-5db8-434f-9ba1-2e60e6615715 fwd="209.210.157.165" dyno= connect= service= status=503 bytes= protocol=https

If I try to clone it locally, after running npm install and npm start I get this error in terminal:

Error: /Users/kat/codefellows/301/overwatch-api/app/index.js does not exist.
▼ Ready! Listening on: http://0.0.0.0:3000
Mon, 13 Nov 2017 17:56:11 GMT uncaughtException: Cannot read property 'default' of undefined
TypeError: Cannot read property 'default' of undefined
at Object.server (/Users/kat/codefellows/301/overwatch-api/node_modules/srv-cli/build/cmd/server:26:18)
at Object. (/Users/kat/codefellows/301/overwatch-api/node_modules/srv-cli/build/srv:132:5)
at Module._compile (module.js:624:30)
at Object.Module._extensions..js (module.js:635:10)
at Module.load (module.js:545:32)
at tryModuleLoad (module.js:508:12)
at Function.Module._load (module.js:500:3)
at Function.Module.runMain (module.js:665:10)
at startup (bootstrap_node.js:187:16)
at bootstrap_node.js:608:3
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: node node_modules/srv-cli/build/srv app/index.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/kat/.npm/_logs/2017-11-13T17_56_11_227Z-debug.log

Private profiles flag

Now that profiles are private by default, we should add another property indicating the profile is private. All other data is rendered as null.

Stats parser is not returning results for stat categories

The Overwatch career stats page DOM has changed a bit. This is causing most of the stats in the stats parser to return no results (Combat, Deaths, Match Awards, etc.).

https://github.com/alfg/overwatch-api/blob/master/app/parser/stats.js#L66

Example:
http://ow-api.herokuapp.com/stats/pc/us/Alf-1608
No stats for: 'Combat', 'Deaths', 'Match Awards', 'Assists', 'Average', 'Miscellaneous', 'Best', 'Game'

Fix:
Update the parser to scrape the stats.
https://playoverwatch.com/en-us/career/pc/us/Alf-1608

Percentage of heroes use

Hi, how can I get the percentage of heroes used? In this way I could generate bars like in playoverwatch...

I saw that in playoverwatch.com the percentage is printed in the style:
calc(0px + 23.2266%);"

Drawings and losses

Hello!
Was the draw and defeat removed from the profile?
They were very useful to me.

Thanks!

[Feature Request] Ability to get only one value from the object from url

Hello,

I was trying to use your api with twitch's nightbot's commands but it has a 400 character limit.
Therefore I would like to have a way to get only 1 value in plain text by changing the url.
Right now I have worked around it by hosting my own website and getting the exact data from your api but I'd love to just get it directly.

Thanks for reading and thanks for the cool API

Feature Request: Allow installation via `npm` for use in NodeJS services

Firstly, thanks for the amazing API.

I see that this package is already available via the npm registry and can be installed through npm. However, it looks like it's primarily optimized for running your own instance of the REST API server. I'm wondering if I could request the ability to install this package as an on-demand utility for making requests for OW stats instead. My use case is to use this package inside a Discord bot, so I have no need to run a standalone srv service with the API. I just need to make on-demand requests to the Overwatch stats from time to time.

My expectation is that I would be able to:

  • npm install overwatch-api
  • Then import it into NodeJS service as import OverwatchAPI from 'overwatch-api'
  • Then use either the profile or stats parsers directly via
  • OverwatchAPI.profile('us', 'pc', 'sometag-123', (response) => { console.log(response); })

However, at the moment there are a few issues preventing me from using this package this way:

  • The package is written with ES6 modules and cannot be easily imported as needed above. In order for this to work, you'd need to add a prepublish script to generate CommonJS modules in the output before publishing the package on npm.
  • There is no index.js file that exports all the available parser utility functions.
  • The main and module keys in package.json aren't setup correctly

If you don't object to this, I'd be happy to create a pull request with the needed changes.

API is down

Looks like the API went down yesterday. The site is not accessible.

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.