2017 © Pedro Peláez
 

library pokapi

image

sjaakmoes/pokapi

  • Thursday, March 9, 2017
  • by Droeftoeter
  • Repository
  • 4 Watchers
  • 10 Stars
  • 43 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 3 Open issues
  • 15 Versions
  • 0 % Grown

The README.md

PHP Pokemon Go API

Pokemon API PHP. Not finished at all so far., (*1)

Supports request signing., (*2)

Captcha

Pokapi can now solve captchas if you provide a Captcha-Solver. A class for AntiCaptcha.com is built in:, (*3)

// Solver
$solver = new AntiCaptcha("your_api_key_here", "PoGo_site_key");

$api->setCaptchaSolver($solver);

// The checkChallenge function will now try to resolve a possible captcha automatically with the provided resolver.
$result = $api->checkChallenge(); // FALSE on no capture, TRUE on resolved. Exception on failure to resolve.

You can implement your own resolvers by implementing the Solver interface., (*4)

Hashing Server

Pokapi now supports the use of a Hashing Server, see Usage., (*5)

Requirements

  • PHP 7.1+
  • php-xxhash extension
  • 64-bit PHP
  • Hashing server if you want to use the latest version (0.57.2)

Installation

To install with Composer, (*6)

composer require sjaakmoes/pokapi, (*7)

Usage

// PTC Account
$authentication = new TrainersClub('username', 'password');
$position = new Position($latitude, $longitude, $altitude);
$deviceInfo = DeviceInfo::getDefault($uniqueDeviceId);

// Version  
$version = new Version\Latest(); // 0.57.2 - You need a hashing server for this one.  
$version = new Version\Legacy(); // 0.45.0  

// Pogodev.io hashing server  
$hashProvider = new Hashing\Pogodev("your_api_key_here");  

$api = new API($version, $authentication, $position, $deviceInfo, $hashProvider);  

// Initializes like the real client
$api->initialize();

// Accept ToS
$api->acceptTerms();

// Execute operation
$getPlayerResponse = $api->getPlayerData();
$mapObjects = $api->getMapObjects();

The Versions