PHPackages                             saraivadaniel/mygeotab-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. saraivadaniel/mygeotab-php

ActiveLibrary[API Development](/categories/api)

saraivadaniel/mygeotab-php
==========================

Unofficial PHP client for the MyGeotab API

2.0.0(5y ago)084↓100%Apache-2.0PHPPHP &gt;=7.1.0

Since Mar 29Pushed 5y agoCompare

[ Source](https://github.com/SaraivaDaniel/mygeotab-php)[ Packagist](https://packagist.org/packages/saraivadaniel/mygeotab-php)[ RSS](/packages/saraivadaniel-mygeotab-php/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (4)Used By (0)

MyGeotab PHP API Client
=======================

[](#mygeotab-php-api-client)

[![Build Status](https://camo.githubusercontent.com/7d7816cbef49873838aac2f93849b7f62add4e1b2ba7d76a5bc67e462155ef25/68747470733a2f2f7472617669732d63692e6f72672f47656f7461622f6d7967656f7461622d7068702e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/Geotab/mygeotab-php)[![Packagist](https://camo.githubusercontent.com/df8b80746382c8a9227ba5d3a59fcee8195e4e831f692ffc8172607831ae704e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f67656f7461622f6d7967656f7461622d7068702e737667)](https://packagist.org/packages/geotab/mygeotab-php)

Provides a PHP client that can easily make API requests to a MyGeotab server.

Installation
------------

[](#installation)

You can use [composer](https://getcomposer.org/) and run the following command in your repo:

```
composer install mygeotab-php

```

This repository requires PHP &gt;=7.1, but if you're going to try integrate this into older versions then you can look at the code in `src` directly.

Quick start
-----------

[](#quick-start)

```
$api = new Geotab\API("user@example.com", "password", "DatabaseName", "my.geotab.com");
$api->authenticate();

$api->get("Device", ["resultsLimit" => 1], function ($results) {
    var_dump($results);
}, function ($error) {
    var_dump($error);
});
```

Instead of using the callback syntax, you can simply use the return result directly. Keep in mind, if an error occurs you won't be informed! It will throw as a `MyGeotabException`, so remember to use try &amp; catch.

```
$toDate = new DateTime();
$fromDate = new DateTime();
$fromDate->modify("-1 month");

try {
    $violations = $api->get("DutyStatusViolation", [
        "search" => [
            "userSearch" => ["id" => "b1"],
            "toDate" => $toDate->format("c"),   // ISO8601, or could use "2018-11-03 00:53:29.370134"
            "fromDate" => $fromDate->format("c")
        ],
        "resultsLimit" => 10
    ]);
} catch (Exception $e) {
    // Handle this or return
}

echo "The driver has " . count($violations) . " violations!";
```

Examples
--------

[](#examples)

In the `examples` folder, you can see the "Top Speeding Violations" example that was presented in the [Dev Channel video](https://www.geotab.com/video/mygeotab-php-api-client/). The code is not yet hooked up with the Node server and will likely have difficulty with PSR, but the code is there and should be easy to understand.

Trick: PHP-CGI NodeJS server
----------------------------

[](#trick-php-cgi-nodejs-server)

If you have a PHP-CGI handler installed, you can run a web server with just `server.js` in NodeJS. I found this quick and easy on Windows instead of setting up a complex web server.

First, find the php-cgi executable on your machine (e.g. C:\\Program Files\\PHP\\v7.2\\php-cgi.exe) and place that in the file. Then run:

```
npm install
node server.js

```

Should now visit localhost:8080/sample.php and voila - you're serving PHP from a NodeJS server!

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 97.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~897 days

Total

3

Last Release

1900d ago

Major Versions

1.1.0 → 2.0.02021-02-25

PHP version history (2 changes)1.0.0PHP &gt;=5.3.3

1.1.0PHP &gt;=7.1.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/305b7acf6fac7c9c2e3a8c7f3774978310fe8ae59ef66ba56055bed3c91f9b28?d=identicon)[SaraivaDaniel](/maintainers/SaraivaDaniel)

---

Top Contributors

[![colonelchlorine](https://avatars.githubusercontent.com/u/1085938?v=4)](https://github.com/colonelchlorine "colonelchlorine (45 commits)")[![SaraivaDaniel](https://avatars.githubusercontent.com/u/2118154?v=4)](https://github.com/SaraivaDaniel "SaraivaDaniel (1 commits)")

---

Tags

apisdkgeotabmygeotab

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/saraivadaniel-mygeotab-php/health.svg)

```
[![Health](https://phpackages.com/badges/saraivadaniel-mygeotab-php/health.svg)](https://phpackages.com/packages/saraivadaniel-mygeotab-php)
```

###  Alternatives

[checkout/checkout-sdk-php

Checkout.com SDK for PHP

553.3M7](/packages/checkout-checkout-sdk-php)[mailchimp/transactional

458.9M16](/packages/mailchimp-transactional)[convertkit/convertkitapi

Kit PHP SDK for the Kit API

2167.1k1](/packages/convertkit-convertkitapi)[kucoin/kucoin-futures-php-sdk

PHP SDK for KuCoin Futures API

111.9k](/packages/kucoin-kucoin-futures-php-sdk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
