{"id":16931548,"url":"https://github.com/jadtermsani/pubgrecords-server","last_synced_at":"2025-04-11T18:33:31.651Z","repository":{"id":40932961,"uuid":"147386298","full_name":"JadTermsani/PubgRecords-server","owner":"JadTermsani","description":"A GraphQL proxy between the PUBG API and the PubgRecords Apps","archived":false,"fork":false,"pushed_at":"2024-06-17T21:41:24.000Z","size":374,"stargazers_count":15,"open_issues_count":3,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-25T14:38:13.750Z","etag":null,"topics":["graphql-interface","graphql-server","heroku","javascript","nodejs","player","player-statistics","playerunknowns-battlegrounds","proxy","pubg","pubg-api","pubg-graphql","pubgapi","pubgtracker","telemetry-data"],"latest_commit_sha":null,"homepage":"https://pubgrecords-graphql.herokuapp.com/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JadTermsani.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-09-04T17:55:38.000Z","updated_at":"2024-05-19T15:24:31.000Z","dependencies_parsed_at":"2025-02-19T22:31:44.589Z","dependency_job_id":"da5cd8ce-8c73-48e5-b1fc-d1fcca148828","html_url":"https://github.com/JadTermsani/PubgRecords-server","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JadTermsani%2FPubgRecords-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JadTermsani%2FPubgRecords-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JadTermsani%2FPubgRecords-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JadTermsani%2FPubgRecords-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JadTermsani","download_url":"https://codeload.github.com/JadTermsani/PubgRecords-server/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248459034,"owners_count":21107208,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["graphql-interface","graphql-server","heroku","javascript","nodejs","player","player-statistics","playerunknowns-battlegrounds","proxy","pubg","pubg-api","pubg-graphql","pubgapi","pubgtracker","telemetry-data"],"created_at":"2024-10-13T20:44:13.871Z","updated_at":"2025-04-11T18:33:31.626Z","avatar_url":"https://github.com/JadTermsani.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pubgrecords.com GraphQL server\n\n[![All Contributors](https://img.shields.io/badge/all_contributors-2-orange.svg?style=flat-square)](#contributors)\n[![Heroku](http://heroku-badges.herokuapp.com/?app=pubgrecords-graphql\u0026style=flat)](https://pubgrecords-graphql.herokuapp.com/)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)\n\nThis server is currently deployed on [heroku](https://pubgrecords-graphql.herokuapp.com/api/graphql) and serves as a proxy between the [PUBG API](https://documentation.playbattlegrounds.com/en/introduction.html) and both Pubg Records Apps:\n\nWeb App: [PubgRecords.com](https://www.pubgrecords.com)\n\n## Table of Contents\n\n- [pubgrecords.com GraphQL server](#pubgrecordscom-graphql-server)\n  - [Table of Contents](#table-of-contents)\n  - [Run locally :computer:](#run-locally-computer)\n  - [Test using the GraphQL interface](#test-using-the-graphql-interface)\n    - [Query examples](#query-examples)\n      - [Player ID](#player-id)\n      - [All match IDs for a given player](#all-match-ids-for-a-given-player)\n      - [Match Details for 1 or more matches](#match-details-for-1-or-more-matches)\n      - [Seasonal stats for a given player](#seasonal-stats-for-a-given-player)\n      - [Lifetime stats for a given player](#lifetime-stats-for-a-given-player)\n      - [Weapon Mastery for a given player](#weapon-mastery-for-a-given-player)\n      - [Leaderboards](#leaderboards)\n  - [Telemetry data :tada:](#telemetry-data-tada)\n    - [Coordinates](#coordinates)\n      - [Scale Example](#scale-example)\n      - [Player or Team](#player-or-team)\n      - [Safety, Red, and Black Zones](#safety-red-and-black-zones)\n  - [Contributors](#contributors)\n\n## Run locally :computer:\n\nInstall dependencies\n\n```bash\nyarn install\n```\n\nRename `.env.example` to `.env` and include your own API Key that you can get from [here](https://developer.playbattlegrounds.com/).\n\nRun the dev server\n\n```bash\nyarn dev\n```\n\nGo to http://localhost:3001/\n\n## Test using the GraphQL interface\n\n- Locally :computer: :\n\nAfter starting the server, go to http://localhost:3001/api/graphql to launch it.\n\n- Online :earth_asia: :\n\nGo to https://pubgrecords-graphql.herokuapp.com/api/graphql\n\n### Query examples\n\n#### Player ID\n\nQuery:\n\n```graphql\nquery {\n  playerId(region: \"steam\", playerName: \"JadT26\")\n}\n```\n\nResult:\n\n```json\n{\n  \"data\": {\n    \"playerId\": \"account.c04b3561ec5442c9bb52433648482b65\"\n  }\n}\n```\n\n#### All match IDs for a given player\n\nQuery:\n\n```graphql\nquery {\n  playerGames(region: \"steam\", playerName: \"JadT26\") {\n    id\n  }\n}\n```\n\nResult:\n\n```json\n{\n  \"data\": {\n    \"playerGames\": [\n      {\n        \"id\": \"a3f7f354-bab0-4b54-9a3f-3ba5f0bc0cdb\"\n      },\n      {\n        \"id\": \"a3d0171b-0288-4e59-be08-2414eb1ebc31\"\n      },\n      {\n        \"id\": \"22a67e10-30e6-4fcd-b902-9759015c0dcc\"\n      },\n      ...\n    ]\n  }\n}\n```\n\n#### Match Details for 1 or more matches\n\nQuery:\n\n```graphql\nquery {\n  matchesInfo(\n    region: \"steam\"\n    playerId: \"account.c04b3561ec5442c9bb52433648482b65\"\n    matchesId: \"a3d0171b-0288-4e59-be08-2414eb1ebc31\"\n    // matchesId: [\"a3d0171b-0288-4e59-be08-2414eb1ebc31\", \"22a67e10-30e6-4fcd-b902-9759015c0dcc\", \"4780ad2f-6d93-4a8b-b4da-efe5c0db2fda\"]\n  ) {\n    playersInfo {\n      assists\n      damage\n      DBNOs\n      headshotKills\n      heals\n      killPlace\n      kills\n      longestKill\n      name\n      playerId\n      rank\n      revives\n      rideDistance (meters)\n      roadKills\n      swimDistance (meters)\n      teamKills\n      timeSurvived (minutes)\n      vehiclesDestroyed\n      walkDistance (meters)\n    }\n    generalInfo {\n      date (YYYY-MM-DD)\n      gameMode\n      mapName\n      matchDuration (minutes)\n      participants\n      team\n      teams\n      telemetryUrl\n      time (HH:MM:SS)\n      userRank\n    }\n  }\n}\n```\n\nResult (of a single match):\n\n```json\n{\n  \"data\": {\n    \"matchesInfo\": [\n      {\n        \"playersInfo\": [\n          {\n            \"assists\": 0,\n            \"damage\": 335,\n            \"DBNOs\": 0,\n            \"headshotKills\": 0,\n            \"heals\": 12,\n            \"killPlace\": 23,\n            \"kills\": 1,\n            \"longestKill\": 28,\n            \"name\": \"JadT26\",\n            \"playerId\": \"account.c04b3561ec5442c9bb52433648482b65\",\n            \"rank\": 9,\n            \"revives\": 1,\n            \"rideDistance\": 2048,\n            \"roadKills\": 0,\n            \"swimDistance\": 0,\n            \"teamKills\": 0,\n            \"timeSurvived\": 24,\n            \"vehiclesDestroyed\": 1,\n            \"walkDistance\": 3341\n          },\n          {\n            \"assists\": 1,\n            \"damage\": 99,\n            \"DBNOs\": 1,\n            \"headshotKills\": 1,\n            \"heals\": 11,\n            \"killPlace\": 24,\n            \"kills\": 1,\n            \"longestKill\": 32,\n            \"name\": \"sguss\",\n            \"playerId\": \"account.c04b3561ec5442c9bb52433648482b65\",\n            \"rank\": 9,\n            \"revives\": 1,\n            \"rideDistance\": 2035,\n            \"roadKills\": 0,\n            \"swimDistance\": 0,\n            \"teamKills\": 0,\n            \"timeSurvived\": 24,\n            \"vehiclesDestroyed\": 0,\n            \"walkDistance\": 3654\n          }\n        ],\n        \"generalInfo\": {\n          \"date\": \"2018-09-17\",\n          \"gameMode\": \"duo-fpp\",\n          \"mapName\": \"Erangel_Main\",\n          \"matchDuration\": 31,\n          \"participants\": 87,\n          \"team\": [\"JadT26\", \"sguss\"],\n          \"teams\": 44,\n          \"telemetryUrl\": \"https://telemetry-cdn.playbattlegrounds.com/bluehole-pubg/pc-eu/2019/03/23/14/11/8a691612-4d75-11e9-ad4d-0a586463690a-telemetry.json\",\n          \"time\": \"20:35:47\",\n          \"userRank\": 9\n        }\n      }\n    ]\n  }\n}\n```\n\n#### Seasonal stats for a given player\n\nQuery:\n\n```graphql\nquery {\n  getSeasonStats(\n    region: \"steam\"\n    playerId: \"account.c04b3561ec5442c9bb52433648482b65\"\n    season: \"division.bro.official.2018-08\"\n  ) {\n    assists\n    damage\n    deaths\n    drivingDistance (meters)\n    heals\n    kdRatio\n    kills\n    longestGame (minutes)\n    longestKill (meters)\n    mostKills\n    revives\n    rounds\n    runningDistance (meters)\n    suicides\n    teamKills\n    timePlayed (minutes)\n    top10s\n    vehiclesDestroyed\n    wins\n  }\n}\n```\n\nResult:\n\n```json\n{\n  \"data\": {\n    \"getSeasonStats\": {\n      \"assists\": 22,\n      \"damage\": 7675,\n      \"deaths\": 69,\n      \"drivingDistance\": 16212,\n      \"heals\": 169,\n      \"kdRatio\": 0.65,\n      \"kills\": 45,\n      \"longestGame\": 26,\n      \"longestKill\": 226.07,\n      \"mostKills\": 5,\n      \"revives\": 14,\n      \"rounds\": 69,\n      \"runningDistance\": 54739,\n      \"suicides\": 0,\n      \"teamKills\": 1,\n      \"timePlayed\": 578,\n      \"top10s\": 16,\n      \"vehiclesDestroyed\": 0,\n      \"wins\": 1\n    }\n  }\n}\n```\n\n#### Lifetime stats for a given player\n\nQuery:\n\n```graphql\nquery {\n  getLifetimeStats(\n    region: \"steam\"\n    playerId: \"account.c04b3561ec5442c9bb52433648482b65\"\n  ) {\n    assists\n    damage\n    dBNOs\n    deaths\n    drivingDistance (meters)\n    headshotKills\n    heals\n    kdRatio\n    kills\n    longestGame (minutes)\n    longestKill (meters)\n    revives\n    roadKills\n    roundMostKills\n    rounds\n    runningDistance (meters)\n    suicides\n    swimDistance (meters)\n    teamKills\n    timePlayed (minutes)\n    top10s\n    vehiclesDestroyed\n    weaponsAcquired\n    wins\n  }\n}\n```\n\nResult:\n\n```json\n{\n  \"data\": {\n    \"getLifetimeStats\": {\n      \"assists\": 98,\n      \"damage\": 39734,\n      \"dBNOs\": 205,\n      \"deaths\": 507,\n      \"drivingDistance\": 314073,\n      \"headshotKills\": 62,\n      \"heals\": 980,\n      \"kdRatio\": 0.49,\n      \"kills\": 246,\n      \"longestGame\": 31,\n      \"longestKill\": 413.64,\n      \"revives\": 109,\n      \"roadKills\": 2,\n      \"roundMostKills\": 6,\n      \"rounds\": 512,\n      \"runningDistance\": 354559,\n      \"suicides\": 11,\n      \"swimDistance\": 1935,\n      \"teamKills\": 15,\n      \"timePlayed\": 4453,\n      \"top10s\": 73,\n      \"vehiclesDestroyed\": 0,\n      \"weaponsAcquired\": 1377,\n      \"wins\": 6\n    }\n  }\n}\n```\n\n#### Weapon Mastery for a given player\n\nQuery:\n\n```graphql\nquery {\n  weaponMastery(\n    region: \"steam\"\n    playerId: \"account.c04b3561ec5442c9bb52433648482b65\"\n  ) {\n    name\n    stats {\n      damage\n      defeats\n      headshots\n      kills\n      knocks\n      levelCurrent\n      longRangeKills\n      longestKill\n      roundMostDamage\n      roundMostDefeats\n      roundMostHeadshots\n      roundMostKills\n      roundMostKnocks\n      tierCurrent\n      xpTotal\n    }\n    medals {\n      count\n      medalId\n    }\n  }\n}\n```\n\nResult:\n\n```json\n{\n  \"data\": {\n    \"weaponMastery\": [\n      {\n        \"name\": \"Item_Weapon_AK47_C\",\n        \"stats\": {\n          \"damage\": 2353.9,\n          \"defeats\": 19,\n          \"headshots\": 14,\n          \"kills\": 12,\n          \"knocks\": 14,\n          \"levelCurrent\": 10,\n          \"longRangeKills\": 0,\n          \"longestKill\": 50.36,\n          \"roundMostDamage\": 407.51,\n          \"roundMostDefeats\": 3,\n          \"roundMostHeadshots\": 3,\n          \"roundMostKills\": 2,\n          \"roundMostKnocks\": 3,\n          \"tierCurrent\": 2,\n          \"xpTotal\": 50790\n        },\n        \"medals\": [\n          {\n            \"count\": 6,\n            \"medalId\": \"MedalDeadeye\"\n          },\n          {\n            \"count\": 5,\n            \"medalId\": \"MedalAssassin\"\n          },\n          {\n            \"count\": 2,\n            \"medalId\": \"MedalPunisher\"\n          }\n        ]\n      },\n      {\n        \"name\": \"Item_Weapon_AUG_C\",\n        \"stats\": {\n          \"damage\": 283.33,\n          \"defeats\": 1,\n          \"headshots\": 1,\n          \"kills\": 0,\n          \"knocks\": 1,\n          \"levelCurrent\": 2,\n          \"longRangeKills\": 0,\n          \"longestKill\": 28.1,\n          \"roundMostDamage\": 151.72,\n          \"roundMostDefeats\": 1,\n          \"roundMostHeadshots\": 1,\n          \"roundMostKills\": 0,\n          \"roundMostKnocks\": 1,\n          \"tierCurrent\": 1,\n          \"xpTotal\": 6142\n        },\n        \"medals\": [\n          {\n            \"count\": 1,\n            \"medalId\": \"MedalDeadeye\"\n          }\n        ]\n      },\n      ...\n      ...\n    ]\n  }\n}\n```\n\n#### Leaderboards\n\nQuery:\n\n```graphql\nquery {\n  leaderboards(\n    gameMode: \"solo\"\n    #gameMode: \"solo-fpp\"\n    count: 50\n    season: \"division.bro.official.pc-2018-06\"\n  ) {\n    id\n    name\n    rank\n    stats {\n      averageDamage\n      averageRank\n      games\n      killDeathRatio\n      kills\n      rankPoints\n      winRatio (%)\n      wins\n    }\n  }\n}\n```\n\nResults are ordered by player rank\n\n```json\n{\n  \"data\": {\n    \"leaderboards\": [\n      {\n        \"name\": \"HuYaTV-17044129\",\n        \"rank\": 1,\n        \"id\": \"account.829af3612d4c4bed8d82a93a176eb7a6\",\n        \"stats\": {\n          \"rankPoints\": 7508,\n          \"wins\": 685,\n          \"games\": 2637,\n          \"winRatio\": 25.98,\n          \"averageDamage\": 367,\n          \"kills\": 8609,\n          \"killDeathRatio\": 4.17,\n          \"averageRank\": 12.99\n        }\n      },\n      {\n        \"name\": \"XiGua-520820_Xg\",\n        \"rank\": 2,\n        \"id\": \"account.18455fef7f114facb739bd23ad370e29\",\n        \"stats\": {\n          \"rankPoints\": 7505,\n          \"wins\": 557,\n          \"games\": 2822,\n          \"winRatio\": 19.74,\n          \"averageDamage\": 314,\n          \"kills\": 7371,\n          \"killDeathRatio\": 3.16,\n          \"averageRank\": 12.81\n        }\n      },\n      ...\n```\n\n## Telemetry data :tada:\n\n### Coordinates\n\nThe coordinates represent the player's movement from the moment the player lands until his death (or victory).\nThe query requires a `telemetry url` and a `username` of a participant of this match.\nThe `scale` parameter is optional and you can use it to return the coordinated scaled to your preference.\n\n#### Scale Example\n\nErangel is 816000 x 816000 and I want to scale the coordinates to be translated on a 408x408 px canvas. To achieve this, I add a `scale` parameter to the query and give it a value of 2000.\n\nScales to fit a 408x408 px canvas:\n\n```js\n{\n  Erangel: 2000,\n  Miramar: 2000,\n  Sanhok: 1000,\n  Vikendi: 1500,\n  Karakin: 500\n}\n```\n\n#### Player or Team\n\n```graphql\nquery {\n  telemetry(\n    # Replace the url with your telemetry URL\n    url: \"https://telemetry-cdn.playbattlegrounds.com/bluehole-pubg/steam/2020-telemetry.json\"\n    users: \"JadT26\"\n    # users: [\"JadT26\", \"sguss\"]\n    scale: 2000\n  ) {\n    playerCoords {\n      Id\n      Coords {\n        x\n        y\n        z\n      }\n    }\n  }\n}\n```\n\nResponse of a single player:\n\n```json\n{\n  \"data\": {\n    \"telemetry\": {\n      \"playerCoords\": [\n        {\n          \"Id\": \"JadT26\",\n          \"Coords\": [\n            {\n              \"x\": 215,\n              \"y\": 333,\n              \"z\": 1255\n            },\n            {\n              \"x\": 215,\n              \"y\": 333,\n              \"z\": 1255\n            },\n          ...\n```\n\n#### Safety, Red, and Black Zones\n\n```graphql\nquery {\n  telemetry(\n    # Replace the url with your telemetry URL\n    url: \"https://telemetry-cdn.playbattlegrounds.com/bluehole-pubg/pc-eu/telemetry.json\"\n    users: \"JadT26\"\n    # users: [\"JadT26\", \"sguss\"]\n    scale: 500\n  ) {\n    safetyZoneCoords {\n      x\n      y\n      radius\n    }\n    redZoneCoords {\n      x\n      y\n      radius\n    }\n    blackZoneCoords {\n      x\n      y\n      radius\n    }\n  }\n}\n```\n\nResponse:\n\n```json\n{\n  \"data\": {\n    \"telemetry\": {\n      \"safetyZoneCoords\": [\n        {\n          \"x\": 234.6998125,\n          \"y\": 277.33684375,\n          \"radius\": 145.609578125\n        },\n        {\n          \"x\": 224.94015625,\n          \"y\": 289.24596875,\n          \"radius\": 101.926703125\n        },\n        ...\n      \"redZoneCoords\": [\n        {\n          \"x\": 234.6998125,\n          \"y\": 277.33684375,\n          \"radius\": 145.609578125\n        },\n        {\n          \"x\": 224.94015625,\n          \"y\": 289.24596875,\n          \"radius\": 101.926703125\n        },\n        ...\n      \"blackZoneCoords\": [\n        {\n          \"x\": 124.6998125,\n          \"y\": 277.33684375,\n          \"radius\": 15\n        },\n        {\n          \"x\": 224.94015625,\n          \"y\": 289.24596875,\n          \"radius\": 15\n        },\n        ...\n```\n\n## Contributors\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore --\u003e\n| [\u003cimg src=\"https://avatars0.githubusercontent.com/u/32297675?v=4\" width=\"100px;\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eJad Termsani\u003c/b\u003e\u003c/sub\u003e](https://github.com/JadTermsani)\u003cbr /\u003e[💻](https://github.com/JadTermsani/PubgRecords-server/commits?author=JadTermsani \"Code\") [📖](https://github.com/JadTermsani/PubgRecords-server/commits?author=JadTermsani \"Documentation\") | [\u003cimg src=\"https://avatars1.githubusercontent.com/u/7265811?v=4\" width=\"100px;\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eSerge Kamel\u003c/b\u003e\u003c/sub\u003e](https://github.com/Faultless)\u003cbr /\u003e[💻](https://github.com/JadTermsani/PubgRecords-server/commits?author=Faultless \"Code\") [📖](https://github.com/JadTermsani/PubgRecords-server/commits?author=Faultless \"Documentation\") |\n| :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nThis project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind welcome!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjadtermsani%2Fpubgrecords-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjadtermsani%2Fpubgrecords-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjadtermsani%2Fpubgrecords-server/lists"}