JavaScript API

A package that helps you interacting with the, FiveM & RedM API.

How to install

npm i cfx-api

Example usage:

const cfx = require("cfx-api");

(async () => {
  // Retrieve a CitizenFX server (could be a FiveM or a RedM server)
  const server = await cfx.fetchServer("qrbm5v") // Replace "qrpm7v" with a server id
  console.log(`Server: ${server.hostname} has ${server.players.length} players online`);

  // Retrieve status
  const status = await cfx.fetchStatus()
  console.log(status.everythingOk ? "All systems are operational" : " is experiencing issues");

  // And get status of all individual components
  const components = await status.fetchComponents()
  for (let component of components)
    console.log(`${}: ${component.status}`);


View Github