Skip to main content

Async API for FiveM endpoints

Project description


Asynchronous FiveM package for retrieving Player and Server infos utilizing the aiohttp package.


import asyncio
from fivem import FiveM

ip = ""
port = 30120

async def main():
    fivem = FiveM(ip=ip, port=port)
    # raw list of players like you get from /players.json
    players = await fivem.get_players_raw()
    # raw json of server-info like you get from /info.json
    info = await fivem.get_info_raw()
    # raw json of server-info like you get from /dynamic.json
    dynamic = await fivem.get_dynamic_raw()
    # parsed list of Player objects 
    players = await fivem.get_players()
    # parsed Server object
    server = await fivem.get_server_info()

loop = asyncio.get_event_loop()

Api Reference


class FiveM(ip: str, port: int):

  • await get_players_raw() -> list: /players.json endpoint - raw list of players
  • await get_info_raw() -> dict: /info.json endpoint - raw dict with server-info
  • await get_dynamic_raw() -> dict: /dynamic.json endpoint - raw dict with server-info
  • await get_players() -> [Player]: returns parsed list of Player objects
  • await get_server_info() -> Server: returns parsed server info Server


class Player:

  • name: player username
  • id: player id
  • ping: current player ping
  • xbl_id: xbl id, None if not available
  • steam_id: steam id, None if not available
  • discord_id: discord id, None if not available
  • live_id: live id, None if not available
  • license_id: license id, None if not available


class Server:

  • hostname: servers hostname
  • clients: current number of clients
  • max_clients: max clients allowed on server
  • game_type: servers game type
  • map_name: servers map name


Issues and Features

If you're having any issues or want additional features please create an Issue on github.


Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

async-fivem-1.0.2.tar.gz (16.0 kB view hashes)

Uploaded source

Built Distribution

async_fivem-1.0.2-py3-none-any.whl (16.1 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page