PHPackages                             ums/mikrotik - 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. ums/mikrotik

ActiveLibrary[API Development](/categories/api)

ums/mikrotik
============

A PHP SDK for Mikrotik API

2.4.5(1y ago)51082MITPHPPHP ^7.4 || ^8.0

Since Jan 24Pushed 1y ago1 watchersCompare

[ Source](https://github.com/alvin-kiveu/MikroTik-RouterOS-Api-Php-Sdk)[ Packagist](https://packagist.org/packages/ums/mikrotik)[ RSS](/packages/ums-mikrotik/feed)WikiDiscussions main Synced today

READMEChangelog (6)Dependencies (1)Versions (8)Used By (0)

MIKROTIK - ROUTEROS - API - PHP - SDK
-------------------------------------

[](#mikrotik---routeros---api---php---sdk)

This PHP SDK provides a convenient interface for interacting with the Mikrotik RouterOS API. You can use this SDK to connect to a Mikrotik device, execute commands, and manage the RouterOS configuration.

### Installation

[](#installation)

This PHP SDK provides a convenient interface for interacting with the Mikrotik RouterOS API. You can use this SDK to connect to a Mikrotik device, execute commands, and manage the RouterOS configuration.

```
composer require ums/mikrotik
```

### Usage

[](#usage)

To use the SDK, create an instance of the MikrotikSdk class, and then use its methods to connect to a Mikrotik device.

```
use MikrotikSdk\MikrotikSdk;

$mikrotik = new MikrotikSdk;

// Connect to Mikrotik
$connect = $mikrotik->connect('192.168.88.1', 'admin', 'password');
if ($connect) {
    echo 'Connected';
} else {
    echo 'Not Connected';
}
```

### Methods

[](#methods)

connect($ip, $username, $password)

Connects to the Mikrotik device using the specified IP address, username, and password. Returns true on successful connection, otherwise false.

```
$connect = $mikrotik->connect('192.168.88.1', 'admin', 'password');
```

disconnect()

Disconnects from the Mikrotik device. Returns true on successful disconnection, otherwise false.

```
$disconnect = $mikrotik->disconnect();
```

### Additional Methods

[](#additional-methods)

You can use the following methods to perform various operations on the Mikrotik device:

executeCommand($command, $param2 = true): Executes a RouterOS command. Returns true on success.

```
$result = $mikrotik->executeCommand('/interface/print');
```

sendCommand($com, $arr = array()): Sends a custom command with optional parameters. Returns the parsed response.

```
$response = $mikrotik->sendCommand('/ip/address/print', ['?interface' => 'ether1']);
```

parseResponse($response): Parses the raw response from RouterOS. Returns an array with parsed data.

```
$parsedData = $mikrotik->parseResponse($response);
```

### Example

[](#example)

Here's a complete example demonstrating the usage of the SDK:

```
use MikrotikSdk\MikrotikSdk;

$mikrotik = new MikrotikSdk;

// Connect to Mikrotik
$connect = $mikrotik->connect('192.168.88.1', 'admin', 'password');
if ($connect) {
    // Execute a command
    $response = $mikrotik->sendCommand('/ip/address/print', ['?interface' => 'ether1']);

    // Parse and display the response
    $parsedData = $mikrotik->parseResponse($response);
    print_r($parsedData);

    // Disconnect from Mikrotik
    $mikrotik->disconnect();
} else {
    echo 'Not Connected';
}
```

The ip address, username, and password should be replaced with the actual values of your Mikrotik device.

### License

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

### Donate to this project

[](#donate-to-this-project)

If you find this project useful, please consider making a donation. Any funds donated will be used to help further development on this project.

[![Donate](https://camo.githubusercontent.com/7cc3c6b3951a6fd823ce76e681a10cd5d1a5e71475b5f91e0a1fec2a8a312f92/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f446f6e6174652d506179537461636b2d627269676874677265656e)](https://paystack.com/pay/oqwdgv9xck)

### Credits

[](#credits)

- Nick Barnes
- \[Ben Menking\](ben \[at\] infotechsc \[dot\] com)
- [Jeremy Jefferson](http://jeremyj.com)
- \[Cristian Deluxe\](djcristiandeluxe \[at\] gmail \[dot\] com)
- \[Mikhail Moskalev\](mmv.rus \[at\] gmail \[dot\] com)

References
----------

[](#references)

- [Mikrotik RouterOS API Wiki](https://wiki.mikrotik.com/wiki/Manual:API)

```

## License

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

## Donate to this project

If you find this project useful, please consider making a donation. Any funds donated will be used to help further development on this project.

[![Donate](https://img.shields.io/badge/Donate-PayStack-brightgreen)](https://paystack.com/pay/oqwdgv9xck)

```

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance32

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~32 days

Recently: every ~27 days

Total

7

Last Release

696d ago

Major Versions

1.0.0.x-dev → 2.4.02024-04-18

1.4.2 → 2.4.52024-08-05

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/67068458?v=4)[Alvin Kiveu](/maintainers/alvin-kiveu)[@alvin-kiveu](https://github.com/alvin-kiveu)

---

Top Contributors

[![alvin-kiveu](https://avatars.githubusercontent.com/u/67068458?v=4)](https://github.com/alvin-kiveu "alvin-kiveu (38 commits)")

---

Tags

mikrotikmikrotik-apimikrotik-hotspotmikrotik-routerboardsrouterosrouteros-apirouteros-client

### Embed Badge

![Health badge](/badges/ums-mikrotik/health.svg)

```
[![Health](https://phpackages.com/badges/ums-mikrotik/health.svg)](https://phpackages.com/packages/ums-mikrotik)
```

###  Alternatives

[statamic/cms

The Statamic CMS Core Package

4.8k3.6M973](/packages/statamic-cms)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3741.3M46](/packages/tencentcloud-tencentcloud-sdk-php)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k656.1k38](/packages/neuron-core-neuron-ai)[avalara/avataxclient

Client library for Avalara's AvaTax suite of business tax calculation and processing services. Uses the REST v2 API.

528.5M7](/packages/avalara-avataxclient)[files.com/files-php-sdk

Files.com PHP SDK

2481.1k](/packages/filescom-files-php-sdk)[aimeos/prisma

A powerful PHP package for integrating media related Large Language Models (LLMs) into your applications

1943.1k5](/packages/aimeos-prisma)

PHPackages © 2026

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