Skip to content

matheus2x/otocyon

Repository files navigation

Otocyon

Otocyon megalotis

🤔 What is this?

This is the an REST API to get Infos about trophies and achievements in gamer platforms (steam, xbox, playstation). It is also the first time that I use some of these techs (restify, heroku, cheerio)

🚀 Techs used

  • Node.js - A JavaScript Interpreter
  • TypeScript - A Superset for JavaScript
  • Restify - A framework to building RESTful web services
  • Heroku - A cloud service used to deploy
  • Cheerio - JQuery but for server

🔥 Getting started

Sometimes I leave it on air hosted by Heroku in this endpoint: https://otocyon.herokuapp.com/

But if you want to run local, you can follow next steps:

  1. You will need an steam community key. Take yours in steam website
  2. Clone this repo with $ git clone https://github.com/matheus2x/otocyon.git
  3. Move yourself to repo with $ cd otocyon
  4. Run $ npm install to install dependencies
  5. Create an .env file and put yours STEAM_KEY (theres a .env.example in root to help)
  6. Run $ npm run build to gen bundle files
  7. Run $ npm run start to initialize server

📙 API Usage



Steam

getProfileData

Endpoint: /steam/getProfileData

Method: GET

Description: Pick some infos from your profile in steam

Query Params

Param Required Type Description
steamURL Yes String Steam Profile ID

Return examples

Success

Status: OK - Code: 200

 {
    "avatarImg": "https://steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/05/0564fb3e23aaab601433907a8a6d47de6231b883_full.jpg",
    "nickname": "FoxPerks",
    "steamID": "76561198104651572",
    "profileURL": "http://steamcommunity.com/profiles/76561198104651572"
}

> Back to the top <



GetPlatinumGameData

Endpoint: /steam/getPlatinumGameData

Method: GET

Description: Platinum confirmed. +300 social credits

Query Params

Param Required Type Description
steamProfileID Yes String Steam Profile ID
steamGameID Yes String Steam Game ID (you need to have all achievements)

Return examples

BadRequest

Status: Bad Request - Code: 400

 {
    "BadRequest": "\"steamProfileID\" is required"
}
Platinum NotFound

Status: Not Found - Code: 404

 {
    "NotFound": "Player with ID \"76561198104651572\" doesn't have 100% of \"Marvel's Guardians of the Galaxy\""
}
Success

Status: OK - Code: 200

 {
    "platinumGameData": {
        "playerID": "76561198104651572",
        "gameID": "851850",
        "gameName": "DRAGON BALL Z: KAKAROT",
        "gameThumb": "https://steamcdn-a.akamaihd.net/steam/apps/851850/capsule_616x353.jpg",
        "achievsLength": 42,
        "totalTimePlayed": "62.45",
        "lastFiveAchievs": [
            {
                "name": "NEW_ACHIEVEMENT_1_0",
                "unlockTime": 1628473956,
                "icon": "https://steamcdn-a.akamaihd.net/steamcommunity/public/images/apps/851850/1bdbd3d7d5ffea5a9ac84a61b51f77458809dfdc.jpg"
            },
            {
                "name": "NEW_ACHIEVEMENT_1_40",
                "unlockTime": 1628473503,
                "icon": "https://steamcdn-a.akamaihd.net/steamcommunity/public/images/apps/851850/3f6310d607458acc3d041599659c4f54cc3fb0f6.jpg"
            },
            {
                "name": "NEW_ACHIEVEMENT_1_22",
                "unlockTime": 1628473307,
                "icon": "https://steamcdn-a.akamaihd.net/steamcommunity/public/images/apps/851850/a8f3294b17400715de34f09177d6ebf27101476c.jpg"
            },
            {
                "name": "NEW_ACHIEVEMENT_1_32",
                "unlockTime": 1628473060,
                "icon": "https://steamcdn-a.akamaihd.net/steamcommunity/public/images/apps/851850/16ccee04c64aa757c557407603a84dea1deee187.jpg"
            },
            {
                "name": "NEW_ACHIEVEMENT_1_16",
                "unlockTime": 1628456331,
                "icon": "https://steamcdn-a.akamaihd.net/steamcommunity/public/images/apps/851850/2b20caac700356c882f6c726d550e1ea1020810a.jpg"
            }
        ]
    }
}

> Back to the top <




Made with 🦊 by Matheus Henrique