PHPackages                             comitidn/routeros-api - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. comitidn/routeros-api

ActiveLibrary[HTTP &amp; Networking](/categories/http)

comitidn/routeros-api
=====================

RouterOS API PHP Client

1452PHPCI passing

Since Sep 9Pushed 1y agoCompare

[ Source](https://github.com/ComitIdn/routeros-api)[ Packagist](https://packagist.org/packages/comitidn/routeros-api)[ RSS](/packages/comitidn-routeros-api/feed)WikiDiscussions dev-main Synced today

READMEChangelogDependenciesVersions (2)Used By (0)

RouterOS PHP API Client
=======================

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

`routeros-api` is a PHP client library for interacting with MikroTik's RouterOS API. This library allows developers to remotely manage and monitor MikroTik devices by executing various RouterOS commands directly from their PHP applications.

Features
--------

[](#features)

- **Connection Management**: Easily connect to MikroTik RouterOS using IP, username, and password.
- **Command Execution**: Execute RouterOS commands and retrieve results in a structured format.
- **Data Parsing**: Automatically parse responses from RouterOS API into associative arrays for easy manipulation.
- **Error Handling**: Comprehensive error handling to capture and respond to connection issues or invalid commands.
- **Extensibility**: The library is designed to be extended and customized according to your specific needs.

Use Cases
---------

[](#use-cases)

- **Network Monitoring**: Fetch and display traffic statistics, interface statuses, and other metrics from MikroTik devices.
- **Configuration Management**: Remotely change configurations, manage users, and update firmware on MikroTik routers.
- **Automation**: Automate repetitive tasks such as backup scheduling, user management, and network diagnostics.

Requirements
------------

[](#requirements)

- **PHP 7.2+**
- **MikroTik RouterOS with API enabled**

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

[](#installation)

You can include this library in your project using Composer.

### Quick Installation

[](#quick-installation)

To install this package quickly using Composer, run the following command:

### method 1

[](#method-1)

```
composer require comitidn/routeros-api
```

If method 1 fails, use

### method 2

[](#method-2)

```
composer require comitidn/routeros-api:*@dev
```

Manual Installation
===================

[](#manual-installation)

Alternatively, you can manually add the package to your `composer.json` file:

Step 1: Add the package to your Composer configuration
------------------------------------------------------

[](#step-1-add-the-package-to-your-composer-configuration)

Add the following to your `composer.json` file:

```
{
    "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/comitidn/routeros-api.git"
        }
    ],
    "require": {
        "comitidn/routeros-api": "dev-main"
    }
}
```

### Step 2: Install the package

[](#step-2-install-the-package)

Run the following command to install the package:

```
composer update
```

### Usage

[](#usage)

Here's a basic example of how to use the `routeros-api` library:

```
use RouterOSAPI\RouterOSAPI;

$api = new RouterOSAPI();
$api->connect('192.168.88.1', 'admin', 'password', 8728); // 8728 port default for API

// Example: Retrieve all interfaces
$api->write('/interface/print');
$interfaces = $api->read();

print_r($interfaces);

$api->disconnect();
```

### Advanced Usage

[](#advanced-usage)

You can extend the basic usage to handle more complex tasks, such as:

- **Fetching Specific Data**: Filter results based on specific parameters.
- **Configuring Devices**: Send commands to change configurations on the router.
- **Error Handling**: Capture and handle errors during the API communication. Example of filtering data:

```
$api->write('/interface/print', false);
$api->write('?name=ether1', true);
$ether1 = $api->read();

print_r($ether1);
```

### Contributing

[](#contributing)

Contributions are welcome! If you have suggestions or bug reports, please open an issue or submit a pull request.

### License

[](#license)

This project is licensed under the MIT License. See the LICENSE file for details.

###  Health Score

19

—

LowBetter than 9% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity20

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/e63c4e3fbad9a641ad664fa1c27640b574df6ec749b0075ae324c1e4f21aadd5?d=identicon)[ComitIdn](/maintainers/ComitIdn)

---

Top Contributors

[![ComitIdn](https://avatars.githubusercontent.com/u/34952269?v=4)](https://github.com/ComitIdn "ComitIdn (12 commits)")

### Embed Badge

![Health badge](/badges/comitidn-routeros-api/health.svg)

```
[![Health](https://phpackages.com/badges/comitidn-routeros-api/health.svg)](https://phpackages.com/packages/comitidn-routeros-api)
```

###  Alternatives

[php-http/cache-plugin

PSR-6 Cache plugin for HTTPlug

25126.1M82](/packages/php-http-cache-plugin)[illuminate/http

The Illuminate Http package.

11937.9M6.9k](/packages/illuminate-http)[rdkafka/rdkafka

A PHP extension for Kafka

2.2k24.3k1](/packages/rdkafka-rdkafka)[httpsoft/http-message

Strict and fast implementation of PSR-7 and PSR-17

87965.9k114](/packages/httpsoft-http-message)[mezzio/mezzio-router

Router subcomponent for Mezzio

265.4M92](/packages/mezzio-mezzio-router)[serpapi/google-search-results-php

Get Google, Bing, Baidu, Ebay, Yahoo, Yandex, Home depot, Naver, Apple, Duckduckgo, Youtube search results via SerpApi.com

69127.2k](/packages/serpapi-google-search-results-php)

PHPackages © 2026

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