Skip to content

API ​

A way for another program, a client app or a server panel, to read and control a running Apranik. Each API is a module with its own listener. This build has one: the Clash API.

Structure ​

json
{
  "apis": [
    {
      "type": "clash",
      "settings": {
        "listen": "127.0.0.1",
        "port": 9090,
        "secret": "a long random string"
      }
    }
  ]
}

Fields ​

type ​

stringRequired

The API module: clash.

settings ​

object

The module's settings, address and secret included.

Lifecycle ​

  • apranik run starts the APIs last, after the inbounds are up, and closes them first. If one cannot start, for example its port is taken, run stops.
  • apranik check never starts an API, so a taken port shows only at run.
  • An API can see where users go and can change users. Give it a long secret and a loopback address.