Skip to content
tjado edited this page Jul 29, 2016 · 5 revisions

pokecli.py

pokecli.py is a small pgoapi example script which shows the generic usage of pgoapi with few RPC calls.

usage: pokecli.py [-h] -a AUTH_SERVICE -u USERNAME -p PASSWORD -l LOCATION [-d] [-t]

optional arguments:
  -h, --help                                    show this help message and exit
  -a AUTH_SERVICE, --auth_service AUTH_SERVICE  Auth Service ('ptc' or 'google')
  -u USERNAME, --username USERNAME              Username
  -p PASSWORD, --password PASSWORD              Password
  -l LOCATION, --location LOCATION              Location
  -d, --debug                                   Debug Mode
  -t, --test                                    Only parse the specified location

pokecli with Docker (optional)

Build and run container:

docker build -t pokecli .
docker run pokecli

Optionally create an alias:

alias pokecli='docker run pokecli'

pgoapi extension

All (known) RPC calls against the original Pokemon Go servers are listed in the RequestType Enum in the POGOProtos/Networking/Requests/RequestType.proto file. These can be executed over the name, e.g. the call for get_player is:

api = PGoApi()
...
api.get_player()
api.call()

The pgoapi will send this as a RPC request and tries to parse the response over a protobuf object with the same name (get_player) converted to CamelCase + 'Response'. In our example, it would be 'GetPlayerResponse'.

If a request needs parameters, they can be added as arguments and pgoapi will try to add them automatically to the request, e.g.:

*DownloadSettingsMessage.proto:*
message DownloadSettingsMessage {
  optional string hash = 1;
}

*python:*
api = PGoApi()
...
api.download_settings(hash="4a2e9bc330dae60e7b74fc85b98868ab4700802e")
api.call()
Clone this wiki locally