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

1392PHPCI 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 1mo ago

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

20

—

LowBetter than 14% of packages

Maintenance37

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity19

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

[friendsofsymfony/rest-bundle

This Bundle provides various tools to rapidly develop RESTful API's with Symfony

2.8k73.3M319](/packages/friendsofsymfony-rest-bundle)[php-http/discovery

Finds and installs PSR-7, PSR-17, PSR-18 and HTTPlug implementations

1.3k309.5M1.2k](/packages/php-http-discovery)[nyholm/psr7

A fast PHP7 implementation of PSR-7

1.3k235.4M2.4k](/packages/nyholm-psr7)[pusher/pusher-php-server

Library for interacting with the Pusher REST API

1.5k94.8M293](/packages/pusher-pusher-php-server)[spatie/crawler

Crawl all internal links found on a website

2.8k16.3M52](/packages/spatie-crawler)[react/http

Event-driven, streaming HTTP client and server implementation for ReactPHP

78126.4M414](/packages/react-http)

PHPackages © 2026

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