Luno API (1.0.0)

Download OpenAPI specification:Download

The Luno API provides developers with a wealth of financial information provided through the Luno platform. Through this secure system developers can:

  • Create accounts for trading in cryptocurrencies
  • Access current and historic cryptocurrency market data
  • Submit trade orders and view order status
  • Buy and sell Bitcoin and Ethereum
  • Send and receive Bitcoin and Ethereum
  • Generate Bitcoin and Ethereum wallet addresses

The Luno API brings the world of Bitcoin and Ethereum to your doorstep.

Authentication

Some API calls require your application to authenticate itself. This is done using an API key associated with your account. You can create an API key by visiting the API Keys section on the settings page.

An API key consists of a key id and a key secret. For example, cnz2yjswbv3jd (key id) and 0hydMZDb9HRR3Qq-iqALwZtXLkbLR4fWxtDZvkB9h4I (key secret).

API requests are authenticated using HTTP basic authentication with the key id as the username and the key secret as the password. A missing, incorrect or revoked key causes error 401 to be returned.

Each API key is granted a set of permissions when it is created. The key can only be used to call the permitted API functions.

Permissions

The following is a list of the possible permissions.

  • Perm_R_Balance = 1 (View balance)
  • Perm_R_Transactions = 2 (View transactions)
  • Perm_W_Send = 4 (Send to any address)
  • Perm_R_Addresses = 8 (View addresses)
  • Perm_W_Addresses = 16 (Create addresses)
  • Perm_R_Orders = 32 (View orders)
  • Perm_W_Orders = 64 (Create orders)
  • Perm_R_Withdrawals = 128 (View withdrawals)
  • Perm_W_Withdrawals = 256 (Create withdrawals)
  • Perm_W_ClientDebit = 8192 (Debit accounts)
  • Perm_W_ClientCredit = 16384 (Credit accounts)
  • Perm_R_Beneficiaries = 32768 (View beneficiaries)
  • Perm_W_Beneficiaries = 65536 (Create and delete beneficiaries)

A set of permissions is represented as the bitwise OR of each permission in the set. For example the set of permissions required to view balances and orders is Perm_R_Balance | Perm_R_Orders = 33.

When API keys are created, users can select permission sets that automatically include various permissions for their key. These are listed below.

Permission Set Included Permissions
Read-only access View Balance
View transactions
Send to any address
View orders
View withdrawals
View Beneficiaries
Trading access View Balance
View transactions
Send to any address
View orders
View withdrawals
View Beneficiaries
Create Orders

Conventions

Timestamps are always represented as an integer number of milliseconds since the UTC Epoch (a Unix timestamp).

Prices and volumes are always represented as a decimal strings e.g. "123.3432". Strings are used rather than floats to preserve the precision.

Parameters for POST calls are sent as URL-encoded forms (application/x-www-form-urlencoded).

Currency

The following currencies are supported through the Luno market platform. For complete details, please see Fees & features:

  • XBT: Bitcoin
  • BCH: Bitcoin Cash
  • ETH: Ethereum
  • EUR: Euro
  • GBP: Pounds
  • LTC: Litecoin
  • MYR: Malaysian Ringgit
  • NGN: Nigerian Naira
  • UGX: Ugandan Shilling
  • ZAR: South African Rand
  • XRP: XRP
  • ZMW: Zambian Kwacha

The following are examples of currency pairs that are supported through the Luno market platform. For complete details, please see Fees & Features:

  • XBTEUR
  • XBTZAR
  • XBTUGX
  • XBTZMW
  • ETHXBT
  • BCHXBT

The following methods are available for Funds Withdrawal based on the type of currency or currency pair being withdrawn.

Currency:

  • BTC: Bitcoin
  • BCH: Bitcoin Cash
  • ETH: Ethereum
  • LTC: Litecoin
  • XRP: XRP

Withdrawal methods:

  • ZAR_EFT: EFT
  • NAD_EFT: EFT
  • KES_EFT: EFT
  • KES_MPESA: M-Pesa
  • MYR_IBG: Interbank GIRO / IBFT
  • IDR_LLG: Bank transfer, Lalu Lintas Giro
  • NGN_EFT: Bank transfer
  • ZMW_EFT: Bank transfer
  • SGD_GIRO: GIRO / FAST
  • SGD_WIRE: International Wire
  • EUR_SEPA: SEPA transfer
  • GBP: Bank transfer
  • UGX_EFT: Bank transfer

Libraries

The Go library is the recommended way to access the API.

The following libraries were implemented by third parties or are no longer under active development and are listed here for convenience. No support is provided by Luno and they may be out of date. A thorough review of the code is recommended before including them in any project.

Rate Limiting

Calls to the Market Data APIs are rate limited to 1 call per second per IP address, with a burst of 5 calls. All other API calls are rate limited to 5 calls per second per customer, with a burst of 25 calls. API call rate limits allow bursts of up to 5 consecutive calls. Exceeding the limit causes HTTP error Code 429 to be returned.

Security

Always use HTTPS when calling the API. Non-TLS HTTP requests cause error 403 to be returned. Using non-TLS requests can leak your authentication credentials.

Verify that your client validates the server's SSL certificate. Many libraries (e.g. urllib2 in Python2) do not validate server certificates by default. Failing to verify the server certificate makes your application vulnerable to man-in-the-middle attack.

Accounts

All transactions on the Luno platform operate on Accounts. Each Account is denominated in a single currency and contains an ordered list of entries that track its running balance.

Each Account has a separate balance and available balance. The available balance may be lower than the balance if some funds have been reserved (e.g. for an open limit order). Account entries affect the balance and available balance independently.

Account entries are numbered sequentially. It is guaranteed that entries are never reordered or deleted. It is also guaranteed that the core attributes of the entry (the running balances and index) are never modified. Therefore, an Account acts as an append-only log of transactions.

Create account

This request creates an Account for the specified currency. Please note that the balances for the Account will be displayed based on the asset value, which is the currency the Account is based on.

Permissions required: Perm_W_Addresses

query Parameters
currency
required
string
Example: currency=XBT

The currency code for the Account you want to create. Please see the Currency section for a detailed list of currencies supported by the Luno platform.

Users must be verified to trade currency in order to be able to create an Account. For more information on the verification process, please see How do I verify my identity?.

Users have a limit of 4 accounts per currency.

name
required
string
Example: name=Trading ACC

The label to use for this account

Responses

200

OK

post/api/1/accounts
https://api.luno.com/api/1/accounts

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "currency": "string",
  • "id": "string",
  • "name": "string",
  • "pending":
    [
    ],
  • "transactions":
    [
    ]
}

Update Account Name

Update the name of an account with a given ID.

Permissions required: Perm_W_Addresses

path Parameters
id
required
integer <int64>
Example: 12345

Account ID - the unique identifier for the specific Account.

query Parameters
name
required
string
Example: name=Trading ACC

The label to use for this account

Responses

200

OK

put/api/1/accounts/{id}/name
https://api.luno.com/api/1/accounts/{id}/name

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "success": true
}

List pending transactions

Return a list of all transactions that have not completed for the Account.

Pending transactions are not numbered, and may be reordered, deleted or updated at any time.

Permissions required: Perm_R_Transactions

path Parameters
id
required
integer <int64>
Example: 12345

Account ID

Responses

200

OK

get/api/1/accounts/{id}/pending
https://api.luno.com/api/1/accounts/{id}/pending

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "currency": "string",
  • "id": "string",
  • "name": "string",
  • "pending":
    [
    ],
  • "transactions":
    [
    ]
}

List transactions

Return a list of transaction entries from an account.

Transaction entry rows are numbered sequentially starting from 1, where 1 is the oldest entry. The range of rows to return are specified with the min_row (inclusive) and max_row (exclusive) parameters. At most 1000 rows can be requested per call.

If min_row or max_row is non-positive, the range wraps around the most recent row. For example, to fetch the 100 most recent rows, use min_row=-100 and max_row=0.

Permissions required: Perm_R_Transactions

path Parameters
id
required
integer <int64>
Example: 12345

Account ID - the unique identifier for the specific Account.

query Parameters
min_row
required
integer <int64>
Example: min_row=1

Minimum of the row range to return (inclusive)

max_row
required
integer <int64>
Example: max_row=1000

Maximum of the row range to return (exclusive)

Responses

200

OK

get/api/1/accounts/{id}/transactions
https://api.luno.com/api/1/accounts/{id}/transactions

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "currency": "string",
  • "id": "string",
  • "name": "string",
  • "pending":
    [
    ],
  • "transactions":
    [
    ]
}

List balances

The list of all Accounts and their respective balances for the requesting user.

Permissions required: Perm_R_Balance

query Parameters
assets
Array of strings
Example: assets=XBT,ETH

Only return balances for wallets with these currencies (if not provided, all balances will be returned)

Responses

200

OK

get/api/1/balance
https://api.luno.com/api/1/balance

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "balance":
    [
    ]
}

Beneficiaries

Users are able to access information about their beneficiaries - banks or other financial institutions that are able to receive assets.

List beneficiaries

Returns a list of bank beneficiaries.

Permissions required: Perm_R_Beneficiaries

Responses

200

OK

get/api/1/beneficiaries
https://api.luno.com/api/1/beneficiaries

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "beneficiaries":
    [
    ]
}

Market

Market data API calls can be accessed by anyone without authentication. The data returned may be cached for up to 1 second. The Streaming API (see below) can be used if lower latency market data is needed.

Get full order book

This request returns a list of all bids and asks for the currency pair specified in the Order Book.

Ask orders are sorted by price ascending.

Bid orders are sorted by price descending.

Multiple orders at the same price are not aggregated.

Warning: This may return a large amount of data. Users are recommended to use the top 100 bids and asks or the Streaming API.

query Parameters
pair
required
string <pair>
Example: pair=XBTZAR

Currency pair of the Orders to retrieve

Responses