2017 © Pedro Peláez
 

project pkm-go-api

The Pokemon Go API library.

image

nicklasw/pkm-go-api

The Pokemon Go API library.

  • Saturday, December 31, 2016
  • by NicklasWallgren
  • Repository
  • 34 Watchers
  • 131 Stars
  • 512 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 58 Forks
  • 9 Open issues
  • 9 Versions
  • 1 % Grown

The README.md

PokemonGoAPI-PHP

Total Downloads PHP7 Ready, (*1)

Pokemon GO PHP API library, (*2)

Install

Run the command composer require nicklasw/pkm-go-api., (*3)

Usage

EG:, (*4)

 // Create the authentication config
$config = new Config();
$config->setProvider(Factory::PROVIDER_PTC);
$config->setUser('INSERT_USER');
$config->setPassword('INSERT_PASSWORD');

// Create the authentication manager
$manager = Factory::create($config);

// Add a event listener,
$manager->addListener(function ($event, $value) {
    if ($event === Manager::EVENT_ACCESS_TOKEN) {
        /** @var AccessToken $accessToken */
        $accessToken = $value;

        // Persist the access token in session storage, cache or whatever.
    }
});

// Initialize the pokemon go application
$application = new ApplicationKernel($manager);

// Retrieve the pokemon go api instance
$pokemonGoApi = $application->getPokemonGoApi();

// Retrieve the inventory
$inventory = $pokemonGoApi->getInventory();

// Retrieve the poke bank
$pokeBank = $inventory->getPokeBank();

// Retrieve a pokemon of type pidgey
$pokemon = $pokeBank->getPokemonsByType(PokemonId::PIDGEY)->first();

// Transfer / Release the pokemon (Send to the meat grinder)
$pokemon->transfer();

TODO

  • Implement the Map API
  • Improve logging

Contributors

Testing

bash $ composer test, (*5)

Slack Chat

We use Slack for community discussions. You can find our team here: https://pokemongoapi-php.slack.com, (*6)

Credits

The Versions