A2SQuery

A2SQuery is a python implementation of Valve's A2S protocol.
Docs
View the full A2SQuery documentation here.
Features
A2SQuery can retrieve various information from any game server that implements the protocol. This includes all Source and GoldSource games. The library will handle connecting, parsing, and even automatically respond to challenge requests.
A2SQuery does not support multi-packet responses as they are impossible to parse without knowing information about the server beforehand.
Prerequisites
- Python >= 3.6
Installation
Install the library via pypi with
pip install a2squery
Getting Started
To start querying servers, we'll need an
instance of a2squery.A2SQuery. We can either create one manually,
or use a context manager. For this example, we will be using a context manager.
>>> from a2squery import A2SQuery
>>> with A2SQuery("127.0.0.1", 27015) as a2s:
Now, with the A2SQuery instance, we can query the game server.
When using
a2squery.A2SQuerywithout a context manager. Remember to calla2squery.A2SQuery.close()when finished.
>>> from a2squery import A2SQuery
>>> with A2SQuery("127.0.0.1", 27015) as a2s:
>>> print(a2s.info())
SourceInfo(
protocol=17, name="Awp Bhop", map="awp_iceworld",
folder="csgo", game="Counter-Strike: Global Offensive",
app_id=730, players=43, max_players=64, bots=0,
server_type=ServerType.Dedicated, environment=Environment.Linux,
password=False, vac=True, version="1.38.4.4", extra_data_flag=177,
mode=None, witnesses=None, duration=None,
port=27015, steam_id=85568392924437989, spectator_port=None,
spectator_name=None, keywords="awp,bhop,a2squeryiscool", game_id=730
)
Supported Games
| App ID | Game | Notes |
|---|---|---|
| ... | All Half-Life/Half-Life 2 mods and games | |
| 10 | Counter-Strike 1.6 | |
| 440 | Team Fortress 2 | |
| 550 | Left For Dead 2 | |
| 730 | Counter-Strike: Global Offensive | |
| 1002 | Rag Doll Kung Fu | |
| 2400 | The Ship: Murder Party | This game has various unique fields on a2squery.SourceInfo and a2squery.Player. |
| 4000 | Garry's Mod | |
| 17710 | Nuclear Dawn | |
| 70000 | Dino D-Day | |
| 107410 | Arma 3 | The query port is the server port + 1. |
| 115300 | Call of Duty: Modern Warfare 3 | |
| 211820 | Starbound | |
| 244850 | Space Engineers | The query port is the server port + 1. |
| 304930 | Unturned | The query port is the server port + 1. |
| 251570 | 7 Days To Die | |
| 252490 | Rust | |
| 282440 | Quake Live | |
| 346110 | ARK: Survival Evolved | |
| 108600 | Project: Zomboid |
Metadata
Release files for a2squery 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| a2squery-0.0.3.tar.gz | 12.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| a2squery-0.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 23.0 kB
Release files / a2squery-0.0.3.tar.gz
| Download URL | a2squery-0.0.3.tar.gz |
|---|---|
| Size | 12.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8495f6369e4b9bf0785b08dcf02b5c4d20dd5864b8aa3f5ad0968d89ebdb5183
|
|
BLAKE2b-256 checksum How to use checksums |
716ac0ea8f8a2abc07620b8d82efa42643a8d8c0097f0221c4f341b86a676269
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 6, 2026.
Transparency logRelease files / a2squery-0.0.3-py3-none-any.whl
| Download URL | a2squery-0.0.3-py3-none-any.whl |
|---|---|
| Size | 10.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c745bf3baabee6451ced4da86770faed56f3c901640c132536212f09523cefc4
|
|
BLAKE2b-256 checksum How to use checksums |
0cf5c38f9d66416ceae6e7d145e12ceb60cc9438858e4574c999a2aac5049f82
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 6, 2026.
Transparency log