{"id":20398633,"url":"https://github.com/bsnext/mta-ase-query","last_synced_at":"2026-03-17T23:34:58.671Z","repository":{"id":246802888,"uuid":"586436244","full_name":"bsnext/MTA-ASE-Query","owner":"bsnext","description":"Node.JS library for send requests to MTA:SA servers and get basic info.","archived":false,"fork":false,"pushed_at":"2024-07-11T16:52:50.000Z","size":23,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-02T05:03:34.010Z","etag":null,"topics":["ase","mta","mtasa","multitheftauto","nodejs","query","server","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bsnext.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":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-08T05:48:31.000Z","updated_at":"2025-07-20T06:12:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"e3c8db9f-14dd-4042-b886-63dc345f79ec","html_url":"https://github.com/bsnext/MTA-ASE-Query","commit_stats":null,"previous_names":["bsnext/mta-ase-query"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bsnext/MTA-ASE-Query","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bsnext%2FMTA-ASE-Query","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bsnext%2FMTA-ASE-Query/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bsnext%2FMTA-ASE-Query/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bsnext%2FMTA-ASE-Query/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bsnext","download_url":"https://codeload.github.com/bsnext/MTA-ASE-Query/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bsnext%2FMTA-ASE-Query/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30635192,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-17T22:38:22.569Z","status":"ssl_error","status_checked_at":"2026-03-17T22:38:11.804Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["ase","mta","mtasa","multitheftauto","nodejs","query","server","typescript"],"created_at":"2024-11-15T04:23:02.322Z","updated_at":"2026-03-17T23:34:58.647Z","avatar_url":"https://github.com/bsnext.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MTA-ASE-Query\n\nLibrary for send requests to [Multi Theft Auto: San Andreas](https://mtasa.com) servers and get basic info.\u003cbr\u003e\nWorking around ASE protocol ([EYE1](https://github.com/multitheftauto/mtasa-blue/blob/615b9b67c89fb3448f1e7c284146ee0800a3215e/Server/mods/deathmatch/logic/ASE.cpp#L236)).\n\nAlso, possible request all servers info with \"partially\" fields from [those API](https://mtasa.com/api).\n\n```ts\n// These objects is returned by getServerInfo()\ninterface MTAServerResponse {\n    name: string;\n    ip: string;\n    port: number;\n    gamemode: string;\n    map: string;\n    version: string;\n    private: boolean;\n    players: number;\n    max_players: number;\n    rules: {\n        name: string;\n        value: string;\n    }[],\n    players_list: {\n        name: string;\n        ping: number;\n        score: number;\n    }[]\n}\n\n// These objects is returned by getServers()\ninterface MTAServerResponseLite {\n    name: string;\n    ip: string;\n    port: number;\n    version: string;\n    private: boolean;\n    players: number;\n    max_players: number;\n}\n```\n\n**[What is a \"Rules\"?](https://wiki.multitheftauto.com/wiki/SetRuleValue)** (MTA:SA Wiki)\u003cbr\u003e\n**[What is a \"Score\"?](https://wiki.multitheftauto.com/wiki/SetPlayerAnnounceValue)** (MTA:SA Wiki)\n\n## Installing:\n```bash\nnpm install @bsnext/mta-ase-query\n```\n\n## API:\n```ts\ngetServerInfo(\n    serverAdress: string, serverPort: number = 22003, requestTimeout: number = 7500\n): Promise\u003cMTAServerResponse\u003e;\n\n// serverAdress - Server adress, can be IP or Domain.\n// serverPort - Server port, 22003 by default.\n// requestTimeout - Timeout for close long-time requests.\n```\n\n```ts\ngetServers(): Promise\u003cMTAServerResponseLite\u003e;\n```\n\n## Usage:\n```ts\nimport { getServerInfo } from \"@bsnext/mta-ase-query\";\nconst serverInfo = await getServerInfo(`lime.dayzmta.ru`, 22003);\n\n/*\nserverInfo = {\n    name: '██ #3 | RU █ [BS] DAYZ ULTIMATE: LIME █ PVP, EASY, LOOT X3',\n    gamemode: 'RU ██ DayZ Ultimate 1.5',\n    map: 'None',\n    version: '1.6',\n    private: false,\n    players: 1,\n    max_players: 80,\n    rules: [],\n    players_list: [ \n        { name: 'WildDove83', ping: 7, score: 0 } \n    ]\n}\n*/\n```\n\n```ts\nimport { getServers } from \"@bsnext/mta-ase-query\";\nconst allServersInfo = await getServers();\n\n/*\nallServersInfo = [\n    ...,\n    {\n        name: '██ #3 | RU █ [BS] DAYZ ULTIMATE: LIME █ PVP, EASY, LOOT X3',\n        version: '1.6',\n        private: false,\n        players: 4,\n        max_players: 80,\n    },\n    {\n        name: '██ #4 | EU █ [BS] DAYZ ULTIMATE: MINT █ PVP, EASY, LOOT X3',\n        version: '1.6',\n        private: false,\n        players: 16,\n        max_players: 80,\n    },\n    ...\n]\n*/\n```\n\n## Example:\n**Basic example of request.**\n```ts\nconst result: MTAServerResponse = await getServerInfo(`lime.dayzmta.ru`, 22003);\n\nconsole.log(`Server Name: ${result.name}`);\nconsole.log(`Gamemode: ${result.gamemode}`);\nconsole.log(`Map: ${result.map}`);\nconsole.log(`Version: ${result.version}`);\nconsole.log(`Is Passworded: ${result.private ? `Yes` : `No`}`);\nconsole.log(`Players: ${result.players}/${result.max_players}`);\n\nif (result.rules.length \u003e 0) {\n    console.log(`Rules:`);\n    for (const rule of result.rules) {\n        console.log(`- ${rule.name}: ${rule.value}`);\n    }\n}\n\nif (result.players_list.length \u003e 0) {\n    console.log(`Players List:`);\n    for (const player of result.players_list) {\n        console.log(`- ${player.name}: ${player.score} (${player.ping} ms)`);\n    }\n}\n```\n\n**Catch the request error.**\n```ts\ntry {\n    const result: MTAServerResponse = await getServerInfo(`not-existed-server.dayzmta.ru`, 22003);\n    console.log(`Server Name: ${result.name}`);\n} catch(e) {\n    console.error(e);\n}\n```\n\n**Request all servers info, and filter by name.**\n```ts\nconst result: MTAServerResponseLite[] = await getServers();\n\nconst filteredResult = result.filter(\n    function (value) {\n        return value.name.search(`DAYZ ULTIMATE`) \u003e -1;\n    }\n);\n\nfor (const serverInfo of filteredResult) {\n    console.log(`----------------`);\n    console.log(`Server Name: ${serverInfo.name}`);\n    console.log(`Version: ${serverInfo.version}`);\n    console.log(`Is Passworded: ${serverInfo.private ? `Yes` : `No`}`);\n    console.log(`Players: ${serverInfo.players}/${serverInfo.max_players}`);\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbsnext%2Fmta-ase-query","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbsnext%2Fmta-ase-query","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbsnext%2Fmta-ase-query/lists"}