Skip to content
xmrig edited this page Oct 2, 2017 · 6 revisions

In version 2.4.0 added HTTP API. If you build proxy from source, libmicrohttpd dependency added. If you want use API you need choice a port where is internal HTTP server will listen for incoming connections.

Example configuration:

"api": {
    "port": 8080,
    "access-token": "Optional Bearer Token used for authorization",
    "worker-id": "Optional proxy name"
}

If you prefer use command line options instead of config file, you can use options: --api-port, --api-access-token and --api-worker-id.

GET / endpoint

{
    "id": "85ae231636d180c3",
    "worker_id": "proxy",
    "version": "2.4.0-dev",
    "kind": "proxy",
    "ua": "xmrig-proxy/2.4.0-dev (Windows NT 10.0; Win64; x64) libuv/1.13.1 gcc/7.1.0",
    "donate_level": 2,
    "donated": 0.0,
    "uptime": 274,
    "hashrate": {
        "total": [
            0.0,
            0.0,
            0.0,
            0.0,
            0.0
        ]
    },
    "miners": {
        "now": 1,
        "max": 1
    },
    "upstreams": 1,
    "results": {
        "accepted": 9,
        "rejected": 0,
        "invalid": 0,
        "avg_time": 30,
        "latency": 86,
        "hashes_total": 18000,
        "hashes_donate": 0,
        "best": [
            62072,
            16792,
            8239,
            7117,
            3872,
            2776,
            2350,
            2327,
            2076,
            0
        ],
        "error_log": []
    }
}

GET /workers.json endpoint

Per worker and overall hashrate statistics.

{
    "hashrate": {
        "total": [
            0.1,
            0.0,
            0.0,
            0.0,
            0.0
        ]
    },
    "workers": [
        [
            "x",
            "192.168.1.2",
            1,
            14,
            0,
            0,
            28000,
            1506315222361,
            0.1,
            0.0,
            0.0,
            0.0,
            0.0
        ]
    ]
}

Worker information:

  1. Worker name, any string, equal to username used in miner.
  2. Last worker ip address.
  3. Connection count.
  4. Accepted shares count.
  5. Rejected by upstream pool shares count.
  6. Invalid shares (expired, etc), not passed to upstream pool.
  7. Total hashes.
  8. Timestamp of last submitted hash.
  9. 1 minute hashrate.
  10. 10 minutes hashrate.
  11. 1 hour hashrate.
  12. 12 hours hashrate.
  13. 24 hours hashrate.