{"id":28529080,"url":"https://github.com/codemeapixel/fivem-stats-api","last_synced_at":"2025-09-05T05:45:10.000Z","repository":{"id":106962286,"uuid":"339019163","full_name":"CodeMeAPixel/fivem-stats-api","owner":"CodeMeAPixel","description":null,"archived":false,"fork":false,"pushed_at":"2021-02-15T09:10:38.000Z","size":8,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-29T08:38:46.019Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CodeMeAPixel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-02-15T09:02:24.000Z","updated_at":"2022-01-21T08:02:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"545bf225-5da1-4005-9909-c3dfd6ffeac4","html_url":"https://github.com/CodeMeAPixel/fivem-stats-api","commit_stats":null,"previous_names":["codemeapixel/fivem-stats-api","therealtoxicdev/fivem-stats-api"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/CodeMeAPixel/fivem-stats-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodeMeAPixel%2Ffivem-stats-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodeMeAPixel%2Ffivem-stats-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodeMeAPixel%2Ffivem-stats-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodeMeAPixel%2Ffivem-stats-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CodeMeAPixel","download_url":"https://codeload.github.com/CodeMeAPixel/fivem-stats-api/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodeMeAPixel%2Ffivem-stats-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273718113,"owners_count":25155486,"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","status":"online","status_checked_at":"2025-09-05T02:00:09.113Z","response_time":402,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2025-06-09T13:34:14.880Z","updated_at":"2025-09-05T05:45:04.991Z","avatar_url":"https://github.com/CodeMeAPixel.png","language":"JavaScript","readme":"# fivem-stats-api\nSmall package in order to interact with FiveM API\n\n**How-to install :**\n\n**How-to use :** \nHere is an example to display the number of players online on a server.\n\n```js\nconst fivem = require(\"discord-fivem-api\");\nfivem.getServerInfo(\"000.000.00.00:30120\").then((server) =\u003e console.log(server.players.length))\n```\n\n\n```js\nfivem.getServerInfo(ipServer:port)\n```\n(default port is 30120)\n\nIt returns a Promise with this object as parameter:\n```\n{\n    \"players\": [{\n        \"endpoint\"; string,\n        \"id\": int, // The server ID og the player\n        \"identifiers\": array, // Identifiers of the player\n        \"name\": string, // Username's player\n        \"ping\": int, // Le ping\n    }],\n    \"infos\": {\n        \"enhancedHostSupport\": boolean,\n        \"icon\": string, // Icon of the server (Base64)\n        \"resources\": array, // All started resources\n        \"server\": string, // FXServer's version (string format)\n        \"vars\": { // Some convars defined in server.cfg\n            \"sv_enhancedHostSupport\": boolean,\n            \"sv_lan\": boolean,\n            \"sv_licenseKeyToken\": string,\n            \"sv_maxClients\": int,\n            \"sv_scriptHookAllowed\": boolean,\n            \"sv_hostname\": string,\n        },\n        \"version\": int, // FXServer's version (numeric format)\n    }\n}\n```\n\n# Example :\n### Fivem Stats\n\n```js\nconst Discord = require(\"discord.js\");\nconst client = new Discord.Client();\nconst fivem = require(\"discord-fivem-api\");\n \nclient.on(\"ready\", () =\u003e {\n   console.log(`Logged in as ${client.user.tag}!`);\n});\n\nclient.on('message', async (message) =\u003e {\n if (message.author.bot) return;\n if (message.content === 'stats') {\n    fivem.getServerInfo(\"000.00.00.00:30120\").then(server =\u003e {\n      let result  = [];\n      let index = 1;\n      for (let player of server.players) {\n        result.push(`${index++}. ${player.name} | ${player.id} ID | ${player.ping} ping\\n`);\n      }\n      const Embed = new Discord.MessageEmbed()\n        .setColor(\"BLUE\")\n        .setAuthor(\"Server is online\")\n        .setTitle(`Players (${server.players.length}/${server.infos.vars.sv_maxClients})`)\n        .setDescription(result)\n        .setTimestamp();\n      message.channel.send(Embed);\n    }).catch(err =\u003e {\n      console.log(err);\n      const Embed = new Discord.MessageEmbed()\n      .setColor(\"RED\")\n      .setAuthor(\"Server is offline\")\n      .setTimestamp();\n    message.channel.send(Embed);\n    });\n }\n});\n\nclient.login(\"Your_Bot_Token_here\");\n```\n\n### Preview\n![FivemStats](https://cdn.discordapp.com/attachments/621111828025573396/771737140227866635/unknown.png)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodemeapixel%2Ffivem-stats-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodemeapixel%2Ffivem-stats-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodemeapixel%2Ffivem-stats-api/lists"}