# Moku Scripting API

Moku is a versatile, high‑performance test platform, and the Moku Scripting API enables direct instrument control for automation and repeatable experiments.

To start, install the API for Python, MATLAB or LabVIEW.

The MokuCLI utility is required to download bitstreams for your Moku, for data streaming through the APIs, and provides command-line functionality for MokuOS, API Server, etc. management. Download and install it from the Moku Utilities page (opens new window).

# Get Started

# Python

The Moku Scripting API for Python requires Python 3.5 or newer.

Start with Python

# MATLAB

The Moku Scripting API for MATLAB requires MATLAB 2014b or newer.

Start with MATLAB

# Features

# RESTful API

The Moku Scripting API is built around a RESTful HTTP interface, allowing for access from a wide range of programming languages. It makes remote access easy, as the standard HTTP protocol is low bandwidth and commonly allowed to traverse firewalls.

Support for the next generation of Moku products. The Scripting API supports almost all the same features of the Moku iPad and Desktop Applications; if you need something that's missing, visit the Knowledge Base (opens new window) for further information and support.

Python and MATLAB libraries are provided that wrap the RESTful API in a way that feels natural to programmers of all levels.

# Device Discovery

Quickly find and connect to the right device without worrying about network configurations. List available devices with mokucli list. Install from our Utilities (opens new window) page and read more about MokuCLI (mokucli).

$ mokucli --help

 Usage: mokucli [OPTIONS] COMMAND [ARGS]...

 Moku command line utility

 Version: 4.2.1.1

 (c) Liquid Instruments 2016-2026

╭─ Options ──────────────────────────────────────────────────────────────────╮
│ --version                                                                  │
│ --install-completion          Install completion for the current shell.    │
│ --show-completion             Show completion for the current shell, to    │
│                               copy it or customize the installation.       │
│ --help                        Show this message and exit.                  │
╰────────────────────────────────────────────────────────────────────────────╯
╭─ Commands ─────────────────────────────────────────────────────────────────╮
│ instrument  Manage Moku instrument bitstreams                              │
│ firmware    Fetch and upload Moku firmware                                 │
│ feature     Manage Moku features                                           │
│ config      Configuration file management commands                         │
│ cache       Manage local cache of downloaded resources                     │
│ command     Execute a single Moku API command.                             │
│ convert     Convert Liquid Instruments binary data files to standard       │
│             formats.                                                       │
│ download    Download bitstreams (backward compatibility).                  │
│ list        Search for Moku devices on the local network.                  │
│ files       Manage files on Moku                                           │
│ license     Manage Moku licenses                                           │
│ proxy       Create a network proxy from a local IPv4 address to a Moku     │
│             device                                                         │
│ stream      Stream real-time data from a Moku device. This is usually used │
│             through a language binding, e.g. the Python API.               │
│ mc          Moku Compile is an offline toolchain that enables you to       │
│             build, compile, and deploy custom FPGA logic to Moku devices   │
│             without requiring an internet connection.                      │
│ login       Interactive sign-in and token refresh setup; caches session    │
│             locally.                                                       │
│ logout      Logout of the current session and clear cached credentials.    │
╰────────────────────────────────────────────────────────────────────────────╯
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41

# Troubleshooting

# USB and IPv6 Supported Environments

You may wish to use IPv6 on your network, and it must be noted that the USB Connection uses IPv6 internally. IPv6 is not universally supported, and as such the API cannot be used over USB in some environments. A non-exhaustive list is

If you require API connectivity from these environments, you must use a network connection like Ethernet or WiFi, including a point-to-point network with Static IPs if security is a concern.