Python RouterOS-api minimal example (system identity) for a factory-configured MikroTik
The following example works for me with a factory-configured MikroTik wAP-LTE kit.
#!/usr/bin/env python3
import routeros_api
connection = routeros_api.RouterOsApiPool(
'192.168.88.1', username='admin', password='L9TYAUV7R8',
plaintext_login=True
)
api = connection.get_api()
# Print system identity
print(f"System identity: {api.get_resource('/system/identity').get()}")
Note: The password is individual for each device. You can find it on a sticker on the device.
Note: Without plaintext_login=True
, you’d need to use a hash of the password. Consider that the password is submitted in plaintext over the network, so SSL would be recommended but is not available on the factory-configured device.