Get Recent Spreads
curl --request GET \
--url https://api.kraken.com/0/public/Spreadimport requests
url = "https://api.kraken.com/0/public/Spread"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.kraken.com/0/public/Spread', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.kraken.com/0/public/Spread"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"error": [],
"result": {
"XXBTZUSD": [
[
1688671834,
"30292.10000",
"30297.50000"
],
[
1688671834,
"30292.10000",
"30296.70000"
],
[
1688671834,
"30292.70000",
"30296.70000"
]
],
"last": 1688672106
}
}Market Data
Get Recent Spreads
Returns the last ~200 top-of-book spreads for a given pair
GET
/
public
/
Spread
Get Recent Spreads
curl --request GET \
--url https://api.kraken.com/0/public/Spreadimport requests
url = "https://api.kraken.com/0/public/Spread"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.kraken.com/0/public/Spread', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.kraken.com/0/public/Spread"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"error": [],
"result": {
"XXBTZUSD": [
[
1688671834,
"30292.10000",
"30297.50000"
],
[
1688671834,
"30292.10000",
"30296.70000"
],
[
1688671834,
"30292.70000",
"30296.70000"
]
],
"last": 1688672106
}
}Query Parameters
Asset pair to get data for
Controls whether response keys and asset identifier fields use Kraken's internal names or display names.
- Omitted (default): internal names are used. Asset keys use legacy
X/Z-prefixed format (XXBT,ZUSD). Pair keys use the internal format (XXBTZUSD). Asset identifier fields (base,quote,fee_volume_currency) also use internal names. assetVersion=1: display names are used. Asset keys become their canonical display names (BTC,USD). Pair keys become the slash-separated display format (BTC/USD). On/public/AssetPairs, thebase,quote, andfee_volume_currencyfields also switch to display names.
Only assetVersion=1 is currently supported. The altname and wsname fields are not affected by this parameter.
Available options:
1 Returns spread data since given timestamp. Optional, intended for incremental updates within available dataset (does not contain all historical spreads).
This parameter is required on requests for non-crypto pairs, i.e. use tokenized_asset for xStocks.
Available options:
tokenized_asset Was this page helpful?