PHPackages                             a909m/routeros-php-sdk - 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. a909m/routeros-php-sdk

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

a909m/routeros-php-sdk
======================

RouterOS REST API v7.23.1 SDK - A PHP SDK for MikroTik RouterOS built with Saloon

v0.1.0(1mo ago)01MITPHP ^8.2

Since Jul 6Compare

[ Source](https://github.com/A909M/routeros-php-sdk)[ Packagist](https://packagist.org/packages/a909m/routeros-php-sdk)[ Docs](https://github.com/a909m/routeros-php-sdk)[ RSS](/packages/a909m-routeros-php-sdk/feed)WikiDiscussions Synced 1w ago

READMEChangelog (1)Dependencies (5)Versions (2)Used By (0)

RouterOS PHP SDK
================

[](#routeros-php-sdk)

[![Tests](https://github.com/a909m/routeros-php-sdk/actions/workflows/tests.yml/badge.svg)](https://github.com/a909m/routeros-php-sdk/actions)[![Latest Version on Packagist](https://camo.githubusercontent.com/b7a3827151a733c65d0bcd5b91f9c59b1b5f2242fec5adba572e140e0a79d8a7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f613930396d2f726f757465726f732d7068702d73646b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/a909m/routeros-php-sdk)[![Total Downloads](https://camo.githubusercontent.com/cc95719944694ecb8cdf78f2d247a8242383da53fda6b5d1779fcccd2ae8063b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f613930396d2f726f757465726f732d7068702d73646b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/a909m/routeros-php-sdk)![Status](https://camo.githubusercontent.com/74a488a85131bf922de57f5aa68f4a9706168a5073d99f04f13fbf590ab19c0a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7374617475732d756e646572253230646576656c6f706d656e742d6f72616e6765)

> **Note:** This package is under active development. The API may change between minor versions until a stable release.

A PHP SDK for the [MikroTik RouterOS](https://mikrotik.com/software) REST API, built with [Saloon](https://docs.saloon.dev/).

This SDK was auto-generated from the RouterOS v7.23.1 OpenAPI specification and covers all available REST API endpoints.

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

[](#requirements)

- PHP 8.2 or higher
- Composer

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

[](#installation)

Install the package via Composer:

```
composer require a909m/routeros-php-sdk
```

Usage
-----

[](#usage)

### Basic Usage

[](#basic-usage)

Initialize the SDK with your RouterOS credentials:

```
use A909M\RouterOS\RouterOS;

$routerOS = new RouterOS(
    host: '192.168.88.1',
    port: '80',
    username: 'admin',
    password: 'your-password'
);

// List all interfaces
$response = $routerOS->interfaceResource()->getInterface();
$interfaces = $response->json();

// Get specific IP address
$response = $routerOS->ip()->getIpAddressId('*1');
$ipAddress = $response->json();
```

### Authentication

[](#authentication)

The SDK uses HTTP Basic Authentication by default. For HTTPS connections, pass `useHttps: true` (the REST API typically runs on port 443):

```
$routerOS = new RouterOS(
    host: '192.168.88.1',
    port: '443',
    username: 'admin',
    password: 'your-password',
    useHttps: true,
);
```

### Timeouts

[](#timeouts)

Default timeouts: 60s connection, 120s request. To customize, extend the `RouterOS` class:

```
use A909M\RouterOS\RouterOS;

class MyRouterOS extends RouterOS
{
    protected int $connectTimeout = 30;
    protected int $requestTimeout = 60;
}
```

### Error Handling

[](#error-handling)

The SDK throws Saloon exceptions when requests fail. Wrap calls in try/catch to handle errors gracefully:

```
use Saloon\Exceptions\Request\FatalRequestException;
use Saloon\Exceptions\Request\StatusRequestException;

try {
    $response = $routerOS->system()->getSystemResource();
    $systemInfo = $response->json();
} catch (FatalRequestException $e) {
    echo "Connection failed: " . $e->getMessage();
} catch (StatusRequestException $e) {
    echo "API error ({$e->getResponse()->status()}): " . $e->getResponse()->body();
}
```

### Available Resources

[](#available-resources)

The SDK provides access to all RouterOS REST API resources:

ResourceMethodDescription`app()`App managementManage RouterOS apps`capsMan()`CapsManWireless CAPsMAN management`certificate()`CertificatesCertificate management`console()`ConsoleConsole settings`container()`ContainersContainer management`disk()`DiskDisk management`dude()`DudeThe Dude network monitoring`environment()`EnvironmentEnvironment variables`file()`FilesFile management`interfaceResource()`InterfacesNetwork interfaces`iot()`IoTIoT configurations`ip()`IPIP address, routes, firewall`ipv6()`IPv6IPv6 configurations`log()`LogsSystem logs`mpls()`MPLSMPLS configurations`openflow()`OpenFlowOpenFlow settings`port()`PortsPort management`ppp()`PPPPPP configurations`queue()`QueuesQueue management`radius()`RADIUSRADIUS settings`root()`RootRoot-level operations`routing()`RoutingRouting protocols`safeMode()`Safe ModeSafe mode operations`snmp()`SNMPSNMP settings`specialLogin()`Special LoginSpecial login methods`system()`SystemSystem settings`task()`TasksTask management`terminal()`TerminalTerminal access`tool()`ToolsVarious tools`tr069client()`TR-069TR-069 client settings`user()`UsersUser management`userManager()`User ManagerUser manager settings### Examples

[](#examples)

#### Get System Information

[](#get-system-information)

```
use A909M\RouterOS\RouterOS;

$routerOS = new RouterOS('192.168.88.1', '80', 'admin', 'password');

// Get system resource information
$response = $routerOS->system()->getSystemResource();
$systemInfo = $response->json();

echo "RouterOS Version: " . $systemInfo['version'];
echo "Uptime: " . $systemInfo['uptime'];
```

#### Manage IP Addresses

[](#manage-ip-addresses)

```
// List all IP addresses
$response = $routerOS->ip()->getIpAddress();
$ipAddresses = $response->json();

// Add a new IP address
$response = $routerOS->ip()->putIpAddress(
    address: '192.168.100.1/24',
    interface: 'ether1'
);
```

#### Firewall Rules

[](#firewall-rules)

```
// List all firewall filter rules
$response = $routerOS->ip()->getIpFirewallFilter();
$rules = $response->json();

// Add a new firewall rule
$response = $routerOS->ip()->putIpFirewallFilter(
    chain: 'input',
    action: 'drop',
    protocol: 'tcp',
    dstPort: '22'
);
```

#### Wireless Configuration

[](#wireless-configuration)

```
// Get wireless interfaces
$response = $routerOS->interfaceResource()->getInterfaceWireless();
$wirelessInterfaces = $response->json();

// Get wireless registration table
$response = $routerOS->interfaceResource()->getInterfaceWirelessRegistrationTable();
$registrations = $response->json();
```

### Working with Proplists

[](#working-with-proplists)

You can specify which properties to return using the `proplist` parameter:

```
// Get only specific fields
$response = $routerOS->ip()->getIpAddress(proplist: 'address,interface,dynamic');
```

Testing
-------

[](#testing)

Run the test suite:

```
composer test
```

Run static analysis:

```
composer analyse
```

Format code:

```
composer format
```

API Documentation
-----------------

[](#api-documentation)

This SDK was generated from the RouterOS OpenAPI specification. For detailed API documentation, refer to the [MikroTik Wiki](https://wiki.mikrotik.com/wiki/Manual:REST_API).

Credits
-------

[](#credits)

- [Saloon](https://docs.saloon.dev/) - The PHP HTTP client library used to build this SDK
- [Saloon SDK Generator](https://github.com/crescat-io/saloon-sdk-generator) - The tool used to generate this SDK from the OpenAPI specification
- [RouterOS OpenAPI Spec](https://github.com/tikoci/restraml) - The OpenAPI specification source

Changelog
---------

[](#changelog)

See [CHANGELOG.md](CHANGELOG.md) for a list of changes and release notes.

Security
--------

[](#security)

If you discover any security-related issues, please email  instead of using the issue tracker.

License
-------

[](#license)

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

###  Health Score

34

—

LowBetter than 74% of packages

Maintenance90

Actively maintained with recent releases

Popularity1

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

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

Unknown

Total

1

Last Release

48d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/153864?v=4)[Assem Bayahi](/maintainers/Assem)[@Assem](https://github.com/Assem)

---

Tags

apisdkrestsaloonrouterosmikrotikrouteros-v7

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/a909m-routeros-php-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/a909m-routeros-php-sdk/health.svg)](https://phpackages.com/packages/a909m-routeros-php-sdk)
```

###  Alternatives

[jlevers/selling-partner-api

PHP client for Amazon's Selling Partner API

4365.5M2](/packages/jlevers-selling-partner-api)

PHPackages © 2026

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