PHP code example of owainjones74 / puregym-api-wrapper

1. Go to this page and download the library: Download owainjones74/puregym-api-wrapper library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

owainjones74 / puregym-api-wrapper example snippets




use Owainjones74\Puregym\PureGymClient;

// Pass your puregym account email and pin. This is the same email and pin you use to login to the PureGym app.
$client = new PureGymClient('[email protected]', '12345678');

// Get your member
$member = $client->member();

// Echo out your name
echo $member->firstName . ' ' . $member->lastName;

$client = new PureGymClient('[email protected]`, '12345678');
$member = $client->member(); // The member linked to this information

$member = $client->member();

echo $member->firstName . ' ' . $member->lastName;

$gym = $client->gym(69);

echo $gym->name;

$activity = $member->activity();

echo $activity->totalVisits;

$attendance = $gym->attendance();

echo $attendance->totalPeopleInGym . '/' . $attendance->maximumCapacity;