Home / Academy / Going deeper

Use the Owner API

Read your machines, earnings, invoices and a summary from your own tools with a read-only key. How to create, use and revoke it.

Advanced

The Owner API lets your own tools read the figures you see in your portal: a spreadsheet, a script, a dashboard at home. It is read-only. A key can look at your data. It cannot change a setting, a payout address or an invoice.

What it gives you

EndpointWhat it returns
machinesYour machines and their current state
earningsThe bitcoin your machines have earned
invoicesYour monthly invoices and reports
summaryThe headline figures of your account in one call

The exact address of each endpoint, the fields in each answer and the limits are on the Developers page. That page is the reference. This guide shows the way of working.

Create a key

  1. Sign in to your portal and open API keys.
  2. Create a new key and give it a name that says where it will be used, such as the name of your spreadsheet.
  3. Copy the key at once and store it in a password manager.
  4. Use one key per tool. If one tool is retired or leaks, you revoke that key only.

Careful: Treat a key like a password. Anyone who has it can read your machines, earnings and invoices. Never paste it into a chat, an email, a screenshot or a shared document.

A first call with curl

curl is a small program, already on Mac and Linux and on recent versions of Windows, that fetches an address from the command line. A call sends your key in a header and receives your data as text. It has this shape:

curl -H 'KEY_HEADER: YOUR_KEY' 'API_ADDRESS/summary'

KEY_HEADER, YOUR_KEY and API_ADDRESS are placeholders. The Developers page gives the exact header and address, with an example you can copy: paste your key into it and run it. Change the last word to machines, earnings or invoices to call the other endpoints.

Google Sheets and Zapier, by polling

The API answers when asked. It does not push changes to you. To keep a tool up to date, have it ask on a schedule. This is called polling.

Good to know: Ask no more often than the figures change. Hashrate moves every few minutes, earnings once a day, invoices once a month. For most uses, once an hour is plenty.

Keep the key safe

Revoke a key

  1. Open API keys.
  2. Find the key by its name.
  3. Revoke it. It stops working at once.
  4. Create a new key and put it in the tool, if the tool is still in use.

Revoke a key the moment you suspect someone else has seen it. It costs nothing, and a new one takes a minute.

If a call fails

Open the Developers page

Read next

Open the Academy · Send a message