Get lending overview XM
curl --request GET \
--url https://api.exchange.coinbase.com/loans/lending-overview-xm \
--header 'cb-access-key: <api-key>' \
--header 'cb-access-passphrase: <api-key>' \
--header 'cb-access-sign: <api-key>' \
--header 'cb-access-timestamp: <api-key>'import requests
url = "https://api.exchange.coinbase.com/loans/lending-overview-xm"
headers = {
"cb-access-key": "<api-key>",
"cb-access-passphrase": "<api-key>",
"cb-access-sign": "<api-key>",
"cb-access-timestamp": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {
'cb-access-key': '<api-key>',
'cb-access-passphrase': '<api-key>',
'cb-access-sign': '<api-key>',
'cb-access-timestamp': '<api-key>'
}
};
fetch('https://api.exchange.coinbase.com/loans/lending-overview-xm', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.exchange.coinbase.com/loans/lending-overview-xm",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"cb-access-key: <api-key>",
"cb-access-passphrase: <api-key>",
"cb-access-sign: <api-key>",
"cb-access-timestamp: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.exchange.coinbase.com/loans/lending-overview-xm"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("cb-access-key", "<api-key>")
req.Header.Add("cb-access-passphrase", "<api-key>")
req.Header.Add("cb-access-sign", "<api-key>")
req.Header.Add("cb-access-timestamp", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.exchange.coinbase.com/loans/lending-overview-xm")
.header("cb-access-key", "<api-key>")
.header("cb-access-passphrase", "<api-key>")
.header("cb-access-sign", "<api-key>")
.header("cb-access-timestamp", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.exchange.coinbase.com/loans/lending-overview-xm")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["cb-access-key"] = '<api-key>'
request["cb-access-passphrase"] = '<api-key>'
request["cb-access-sign"] = '<api-key>'
request["cb-access-timestamp"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"body": {
"overview": {
"open_loan_value": "<string>",
"available_to_borrow": "<string>",
"withdrawal_restricted": true,
"credit_limit_value": "<string>",
"available_credit_value": "<string>",
"pending_loan_value": "<string>",
"margin_requirement": "<string>",
"account_equity": "<string>",
"margin_excess_shortfall": "<string>",
"consumed_credit": "<string>"
},
"loans": [
{
"id": "<string>",
"currency": "<string>",
"principal_amount": "<string>",
"outstanding_principal_amount": "<string>",
"interest_rate": "<string>",
"interest_currency": "<string>",
"status": "loan_pending",
"effective_at": "2023-11-07T05:31:56Z",
"closed_at": "2023-11-07T05:31:56Z",
"term_start_date": "2023-11-07T05:31:56Z",
"term_end_date": "2023-11-07T05:31:56Z"
}
]
}
}{
"message": "<string>"
}{
"message": "<string>"
}Loan
Get lending overview XM
Get lending overview for a cross margin user with margin requirements and account equity information.
GET
/
loans
/
lending-overview-xm
Get lending overview XM
curl --request GET \
--url https://api.exchange.coinbase.com/loans/lending-overview-xm \
--header 'cb-access-key: <api-key>' \
--header 'cb-access-passphrase: <api-key>' \
--header 'cb-access-sign: <api-key>' \
--header 'cb-access-timestamp: <api-key>'import requests
url = "https://api.exchange.coinbase.com/loans/lending-overview-xm"
headers = {
"cb-access-key": "<api-key>",
"cb-access-passphrase": "<api-key>",
"cb-access-sign": "<api-key>",
"cb-access-timestamp": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {
'cb-access-key': '<api-key>',
'cb-access-passphrase': '<api-key>',
'cb-access-sign': '<api-key>',
'cb-access-timestamp': '<api-key>'
}
};
fetch('https://api.exchange.coinbase.com/loans/lending-overview-xm', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.exchange.coinbase.com/loans/lending-overview-xm",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"cb-access-key: <api-key>",
"cb-access-passphrase: <api-key>",
"cb-access-sign: <api-key>",
"cb-access-timestamp: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.exchange.coinbase.com/loans/lending-overview-xm"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("cb-access-key", "<api-key>")
req.Header.Add("cb-access-passphrase", "<api-key>")
req.Header.Add("cb-access-sign", "<api-key>")
req.Header.Add("cb-access-timestamp", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.exchange.coinbase.com/loans/lending-overview-xm")
.header("cb-access-key", "<api-key>")
.header("cb-access-passphrase", "<api-key>")
.header("cb-access-sign", "<api-key>")
.header("cb-access-timestamp", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.exchange.coinbase.com/loans/lending-overview-xm")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["cb-access-key"] = '<api-key>'
request["cb-access-passphrase"] = '<api-key>'
request["cb-access-sign"] = '<api-key>'
request["cb-access-timestamp"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"body": {
"overview": {
"open_loan_value": "<string>",
"available_to_borrow": "<string>",
"withdrawal_restricted": true,
"credit_limit_value": "<string>",
"available_credit_value": "<string>",
"pending_loan_value": "<string>",
"margin_requirement": "<string>",
"account_equity": "<string>",
"margin_excess_shortfall": "<string>",
"consumed_credit": "<string>"
},
"loans": [
{
"id": "<string>",
"currency": "<string>",
"principal_amount": "<string>",
"outstanding_principal_amount": "<string>",
"interest_rate": "<string>",
"interest_currency": "<string>",
"status": "loan_pending",
"effective_at": "2023-11-07T05:31:56Z",
"closed_at": "2023-11-07T05:31:56Z",
"term_start_date": "2023-11-07T05:31:56Z",
"term_end_date": "2023-11-07T05:31:56Z"
}
]
}
}{
"message": "<string>"
}{
"message": "<string>"
}Get lending overview for a cross margin user with margin requirements and account equity information. Returns all amounts in USD notional values.
Lending Overview for Cross Margin (XM) UsersThis endpoint provides lending information specifically for cross margin users, including margin requirements, account equity, and margin excess/shortfall calculations.
CautionThe lending rate limit is 10 RPS per profile.
Was this page helpful?
⌘I