If you're referring to querying data from a game server, you do that using Valve's
Server Query protocol. There are some existing libraries out there for different languages that implement this procotol in a convenient package. For example, SourceQuery is one that I use for PHP.
__________________