Get Address Book
curl --request GET \
--url https://api.prime.coinbase.com/v1/portfolios/{portfolio_id}/address_bookimport requests
url = "https://api.prime.coinbase.com/v1/portfolios/{portfolio_id}/address_book"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.prime.coinbase.com/v1/portfolios/{portfolio_id}/address_book', 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.prime.coinbase.com/v1/portfolios/{portfolio_id}/address_book",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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.prime.coinbase.com/v1/portfolios/{portfolio_id}/address_book"
req, _ := http.NewRequest("GET", url, nil)
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.prime.coinbase.com/v1/portfolios/{portfolio_id}/address_book")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.prime.coinbase.com/v1/portfolios/{portfolio_id}/address_book")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"addresses": [
{
"id": "<string>",
"name": "<string>",
"state": "<string>",
"added_by": {
"id": "<string>",
"name": "<string>",
"avatar_url": "<string>"
},
"currency_symbol": "<string>",
"address": "<string>",
"account_identifier": "<string>",
"account_identifier_name": "<string>",
"explorer_link": "<string>",
"last_used_at": "2023-11-07T05:31:56Z",
"added_at": "2023-11-07T05:31:56Z",
"type": "ADDRESS_BOOK_TYPE_UNSPECIFIED",
"counterparty_id": "<string>"
}
],
"pagination": {
"next_cursor": "<string>",
"sort_direction": "DESC",
"has_next": true
}
}Address Book
Get Address Book
Gets a list of address book addresses.
GET
/
v1
/
portfolios
/
{portfolio_id}
/
address_book
Get Address Book
curl --request GET \
--url https://api.prime.coinbase.com/v1/portfolios/{portfolio_id}/address_bookimport requests
url = "https://api.prime.coinbase.com/v1/portfolios/{portfolio_id}/address_book"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.prime.coinbase.com/v1/portfolios/{portfolio_id}/address_book', 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.prime.coinbase.com/v1/portfolios/{portfolio_id}/address_book",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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.prime.coinbase.com/v1/portfolios/{portfolio_id}/address_book"
req, _ := http.NewRequest("GET", url, nil)
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.prime.coinbase.com/v1/portfolios/{portfolio_id}/address_book")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.prime.coinbase.com/v1/portfolios/{portfolio_id}/address_book")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"addresses": [
{
"id": "<string>",
"name": "<string>",
"state": "<string>",
"added_by": {
"id": "<string>",
"name": "<string>",
"avatar_url": "<string>"
},
"currency_symbol": "<string>",
"address": "<string>",
"account_identifier": "<string>",
"account_identifier_name": "<string>",
"explorer_link": "<string>",
"last_used_at": "2023-11-07T05:31:56Z",
"added_at": "2023-11-07T05:31:56Z",
"type": "ADDRESS_BOOK_TYPE_UNSPECIFIED",
"counterparty_id": "<string>"
}
],
"pagination": {
"next_cursor": "<string>",
"sort_direction": "DESC",
"has_next": true
}
}Use the Prime SDK or CLI to test this endpoint by following the quickstart guide and running with the following examples
For more information, please visit the Prime Java SDK.For more information, please visit the Prime .NET SDK.For more information, please visit the Prime Go SDK.For more information, please visit the Prime Python SDK.For more information, please visit the Prime CLI.For more information, please visit the Prime TS SDK.
- Java
- .NET
- Go
- Python
- CLI
- TS/JS
AddressBookService addressBookService = PrimeServiceFactory.createAddressBookService(client);
GetPortfolioAddressBookRequest request = new GetPortfolioAddressBookRequest.Builder("portfolio_id").build();
GetPortfolioAddressBookResponse response = addressBookService.getAddressBook(request);
var addressBookService = new AddressBookService(client);
var request = new GetPortfolioAddressBookRequest("portfolio_id");
var response = addressBookService.GetPortfolioAddressBook(request);
addressBookService := addressbook.NewAddressBookService(client)
request := &addressbook.GetAddressBookRequest{
PortfolioId: "portfolio-id",
}
response, err := addressBookService.GetAddressBook(context.Background(), request)
prime_client = PrimeClient(credentials)
request = GetAddressBookRequest(
portfolio_id="portfolio_id",
)
response = prime_client.get_address_book(request)
primectl get-address-book --help
const addressBooksService = new AddressBooksService(client);
addressBooksService.listAddressBooks({
portfolioId: 'PORTFOLIO_ID_HERE'
}).then(async (response) => {
console.log('Address Book: ', response);
})
Query Parameters
Was this page helpful?