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:
The Luno API brings the world of Bitcoin and Ethereum to your doorstep.
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.
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 |
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
).
The following currencies are supported through the Luno market platform. For complete details, please see Fees & features:
The following are examples of currency pairs that are supported through the Luno market platform. For complete details, please see Fees & Features:
The following methods are available for Funds Withdrawal based on the type of currency or currency pair being withdrawn.
Currency:
Withdrawal methods:
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.
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.
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.
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.
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
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 |
{- "currency": "string",
- "id": "string",
- "name": "string",
- "pending": [
- {
- "account_id": "string",
- "available": "string",
- "available_delta": "string",
- "balance": "string",
- "balance_delta": "string",
- "currency": "string",
- "description": "string",
- "detail_fields": {
- "crypto_details": {
- "address": "string",
- "txid": "string"
}, - "trade_details": {
- "pair": "string",
- "price": "string",
- "sequence": 0,
- "volume": "string"
}
}, - "details": {
- "property1": "string",
- "property2": "string"
}, - "kind": "FEE",
- "row_index": 0,
- "timestamp": "string"
}
], - "transactions": [
- {
- "account_id": "string",
- "available": "string",
- "available_delta": "string",
- "balance": "string",
- "balance_delta": "string",
- "currency": "string",
- "description": "string",
- "detail_fields": {
- "crypto_details": {
- "address": "string",
- "txid": "string"
}, - "trade_details": {
- "pair": "string",
- "price": "string",
- "sequence": 0,
- "volume": "string"
}
}, - "details": {
- "property1": "string",
- "property2": "string"
}, - "kind": "FEE",
- "row_index": 0,
- "timestamp": "string"
}
]
}
Update the name of an account with a given ID.
Permissions required: Perm_W_Addresses
id required | integer <int64> Example: 12345 Account ID - the unique identifier for the specific Account. |
name required | string Example: name=Trading ACC The label to use for this account |
{- "success": true
}
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
id required | integer <int64> Example: 12345 Account ID |
{- "currency": "string",
- "id": "string",
- "name": "string",
- "pending": [
- {
- "account_id": "string",
- "available": "string",
- "available_delta": "string",
- "balance": "string",
- "balance_delta": "string",
- "currency": "string",
- "description": "string",
- "detail_fields": {
- "crypto_details": {
- "address": "string",
- "txid": "string"
}, - "trade_details": {
- "pair": "string",
- "price": "string",
- "sequence": 0,
- "volume": "string"
}
}, - "details": {
- "property1": "string",
- "property2": "string"
}, - "kind": "FEE",
- "row_index": 0,
- "timestamp": "string"
}
], - "transactions": [
- {
- "account_id": "string",
- "available": "string",
- "available_delta": "string",
- "balance": "string",
- "balance_delta": "string",
- "currency": "string",
- "description": "string",
- "detail_fields": {
- "crypto_details": {
- "address": "string",
- "txid": "string"
}, - "trade_details": {
- "pair": "string",
- "price": "string",
- "sequence": 0,
- "volume": "string"
}
}, - "details": {
- "property1": "string",
- "property2": "string"
}, - "kind": "FEE",
- "row_index": 0,
- "timestamp": "string"
}
]
}
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
id required | integer <int64> Example: 12345 Account ID - the unique identifier for the specific Account. |
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) |
{- "currency": "string",
- "id": "string",
- "name": "string",
- "pending": [
- {
- "account_id": "string",
- "available": "string",
- "available_delta": "string",
- "balance": "string",
- "balance_delta": "string",
- "currency": "string",
- "description": "string",
- "detail_fields": {
- "crypto_details": {
- "address": "string",
- "txid": "string"
}, - "trade_details": {
- "pair": "string",
- "price": "string",
- "sequence": 0,
- "volume": "string"
}
},