Skip to content
ZILLEALI edited this page Jun 19, 2026 · 4 revisions

routeros-api Wiki

Welcome to the documentation for routeros-api, the RouterosAPI PHP client for the MikroTik RouterOS API Documentation written by @Zill E Ali.

This class gives you a thin, dependency-free PHP interface to the RouterOS API protocol: connect to a router, send commands, and read structured responses. It has no namespace and no external dependencies, just one file you can require or pull in with Composer.

Pages in this wiki

##30-second example

<?php
require 'routeros_api.class.php';

$API = new RouterosAPI();

if ($API->connect('192.168.88.1', 'admin', 'password')) {
    $interfaces = $API->comm('/interface/print');
    print_r($interfaces);
    $API->disconnect();
}

That is the whole workflow: connect, run a command, read the parsed result, disconnect. Everything else in this wiki is detail on top of that.

Where this class came from

The class was originally written by Denis Basta for the old MikroTik wiki (archived at web.archive.org), and has been maintained here since by Ben Menking and a number of contributors. It predates PSR autoloading standards, which is why it ships as a single global class rather than a namespaced package, that is expected, not a bug.

If you are looking for a more modern, namespaced, PHP 7/8 native alternative with PSR support, see the Changelog and Version Notes page for a short comparison note.

Clone this wiki locally