REST API Documentation :
-
Secure your API by putting a secure and random password in the
rest_api_passwordsetting in your config.properties file or therestApiPasswordsetting in your JSON file(s). Each bot has its own password, so use the correct one in the next step (or if you are lazy, use the same value everywhere). If the configuration key is not set, it will be generated and saved in the config file. -
Request an access token with a
POSTtohttp://localhost:8080/api/bot/{name}/authwhere{name}is the name of your bot (=defaultby default) and the raw body must be the value from therest_api_passwordsetting from the first step. Mind the default server port, which is 8080 (to change this, run the bot asjava -jar PokemonGoBot.jar --server-port=XXXX) and do NOT use the socket port defined in your bot configuration (which is by default 8001). You will get a response from the server with a random session token which must be placed in theX-PGB-ACCESS-TOKENheader for further use of the API. -
General end-point :
- GET
/api/bots=> List all bots (this does not need theX-PGB-ACCESS-TOKENheader)
- GET
-
Bot end-point :
- POST
/api/bot{name}/load=> Load bot - POST
/api/bot{name}/unload=> Unload bot - POST
/api/bot{name}/reload=> Reload bot - POST
/api/bot{name}/stop=> Stop bot - POST
/api/bot{name}/start=> Start bot
- POST
-
Pokemon end-point :
- GET
/api/bot{name}/pokemons=> List all pokemons - POST
/api/bot{name}/pokemon/{id}/transfer=> Transfer pokemon - POST
/api/bot{name}/pokemon/{id}/evolve=> Evolve pokemon - POST
/api/bot{name}/pokemon/{id}/powerup=> Power-up pokemon - POST
/api/bot{name}/pokemon/{id}/favorite=> Toggle favorite for this pokemon - POST
/api/bot{name}/pokemon/{id}/rename=> Rename pokemon, request body MUST be the new name of the pokemon
- GET
-
Item end-point :
- GET
/api/bot{name}/items=> List all items - DELETE
/api/bot{name}/item/{id}/drop/{quantity}=> Dropquantityof this item - POST
/api/bot{name}/useIncense=> Use an incense - POST
/api/bot{name}/useLuckyEgg=> Use a lucky egg
- GET
-
Misc end-points :
- GET
/api/bot{name}/location=> Get bot current location - POST
/api/bot{name}/location/{latitude}/{longitude}=> Change bot location - GET
/api/bot{name}/profile=> Get account profile - GET
/api/bot{name}/pokedex=> Get account pokedex - GET
/api/bot{name}/eggs=> Get eggs
- GET
A very simple proof of concept with javascript can be found here.