How do I use the XMRig HTTP API to monitor my miner?
You can monitor XMRig through its built-in HTTP API, a local web interface that returns your miner’s status as structured data. Enable it in XMRig’s configuration, keep it limited to your own computer, and request the summary endpoint to check mining speed, submitted work, and your pool connection.
Enable the HTTP API
XMRig is standalone mining software, not a browser miner. Its API lets another program—or a command-line tool—read its status without watching the mining window.
Stop XMRig and open the config.json file it uses. Add or update this top-level section, keeping the rest of your mining settings:
"http": {
"enabled": true,
"host": "127.0.0.1",
"port": 18088,
"access-token": "REPLACE_WITH_A_LONG_RANDOM_SECRET",
"restricted": true
}
If an "http" section already exists, edit it rather than adding a second one. Make sure neighboring sections have the commas required by JSON, the configuration file’s format.
Here is what these settings do:
enabledswitches the API on.hostsets where it listens.127.0.0.1means only your own computer can connect.portchooses the connection number.18088is an example; choose another unused port if needed.access-tokensets a secret that your monitoring requests must include.restrictedkeeps access limited to read-only status features.
Save the file and restart XMRig. Check its startup messages for configuration errors or a port already in use.
Request your miner’s status
An endpoint is a particular address within an API. For recent XMRig versions, the main status endpoint is /2/summary.
Run this command on the same computer as XMRig:
curl -H "Authorization: Bearer REPLACE_WITH_A_LONG_RANDOM_SECRET" \
http://127.0.0.1:18088/2/summary
Replace the secret with the exact value from your configuration. On Windows PowerShell, use curl.exe if curl invokes a different command.
XMRig returns JSON, a text format containing named values. You do not need a mining pool account or wallet password to query this local API.
Read the numbers that matter
Start with these fields in the summary response:
hashrate.total: Your total mining speed, normally shown as averages over 10 seconds, 60 seconds, and 15 minutes. Speed is measured in hashes per second—how many mining calculations your computer performs each second.results.shares_good: Work submissions accepted by your pool.results.shares_total: Total shares recorded. Compare this with accepted shares and the mining log if submissions are failing.connection: Pool connection details, including connection uptime and failures.uptime: How long XMRig has been running.
A share is proof of work submitted to a mining pool, where miners combine their efforts. It is not a whole Monero block or a direct payment.
Longer hashrate averages may initially be unavailable. Give the miner time to settle before judging performance.
Monitor safely and troubleshoot
For a simple dashboard, request the summary every 10–30 seconds. Watch for sustained hashrate drops, connection failures, or accepted shares no longer increasing.
If you get “connection refused,” check that XMRig is running and the address and port match. An authorization error usually means the token is missing or incorrect.
Do not expose this API directly to the internet. For remote monitoring, keep it on localhost and use a secure SSH tunnel rather than opening a router port.
The bottom line
Enable read-only access, protect it with a token, and monitor /2/summary. Its numbers show miner health—not guaranteed earnings or confirmed wallet payments.
