> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cloud.coinbase.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Address Book

> Gets a list of address book addresses.

Use the Prime SDK or CLI to test this endpoint by following the [quickstart](/prime/introduction/quickstart) guide and running with the following examples

<Tabs>
  <Tab title="Java">
    ```java theme={null}
    AddressBookService addressBookService = PrimeServiceFactory.createAddressBookService(client);

    GetPortfolioAddressBookRequest request = new GetPortfolioAddressBookRequest.Builder("portfolio_id").build();

    GetPortfolioAddressBookResponse response = addressBookService.getAddressBook(request);
    ```

    For more information, please visit the [Prime Java SDK](https://github.com/coinbase-samples/prime-sdk-java).
  </Tab>

  <Tab title=".NET">
    ```csharp wrap theme={null}
    var addressBookService = new AddressBookService(client);

    var request = new GetPortfolioAddressBookRequest("portfolio_id");

    var response = addressBookService.GetPortfolioAddressBook(request);
    ```

    For more information, please visit the [Prime .NET SDK](https://github.com/coinbase-samples/prime-sdk-dotnet).
  </Tab>

  <Tab title="Go">
    ```go wrap theme={null}
    addressBookService := addressbook.NewAddressBookService(client)

    request := &addressbook.GetAddressBookRequest{
        PortfolioId: "portfolio-id",
    }

    response, err := addressBookService.GetAddressBook(context.Background(), request)
    ```

    For more information, please visit the [Prime Go SDK](https://github.com/coinbase-samples/prime-sdk-go).
  </Tab>

  <Tab title="Python">
    ```python wrap theme={null}
    prime_client = PrimeClient(credentials)

    request = GetAddressBookRequest(
            portfolio_id="portfolio_id",
    )

    response = prime_client.get_address_book(request)
    ```

    For more information, please visit the [Prime Python SDK](https://github.com/coinbase-samples/prime-sdk-py).
  </Tab>

  <Tab title="CLI">
    ```bash wrap theme={null}
    primectl get-address-book --help
    ```

    For more information, please visit the [Prime CLI](https://github.com/coinbase-samples/prime-cli).
  </Tab>

  <Tab title="TS/JS">
    ```typescript wrap theme={null}
    const addressBooksService = new AddressBooksService(client);

    addressBooksService.listAddressBooks({
        portfolioId: 'PORTFOLIO_ID_HERE'
    }).then(async (response) => {
        console.log('Address Book: ', response);
    })
    ```

    For more information, please visit the [Prime TS SDK](https://github.com/coinbase-samples/prime-sdk-ts).
  </Tab>
</Tabs>


## OpenAPI

````yaml GET /v1/portfolios/{portfolio_id}/address_book
openapi: 3.0.1
info:
  title: REST API
  description: >-
    The Coinbase Prime REST API provides programmatic access to trading,
    custody, staking, market data, and account management functionality.
  version: '0.1'
servers:
  - url: https://api.prime.coinbase.com/
security: []
tags:
  - name: PrimeRESTAPI
paths:
  /v1/portfolios/{portfolio_id}/address_book:
    get:
      tags:
        - Address Book
      summary: Get Address Book
      description: Gets a list of address book addresses.
      operationId: PrimeRESTAPI_GetPortfolioAddressBook
      parameters:
        - name: portfolio_id
          in: path
          description: Portfolio ID
          required: true
          schema:
            type: string
        - name: currency_symbol
          in: query
          description: >-
            Cryptocurrency symbol -- if nothing is passed, all addresses are
            returned
          schema:
            type: string
        - name: search
          in: query
          description: Query string that matches the address name
          schema:
            type: string
        - name: cursor
          in: query
          description: >-
            ID marking the point after which additional results should be
            retrieved
          schema:
            type: string
        - name: limit
          in: query
          description: Number of addresses to retrieve
          schema:
            type: integer
            format: int32
        - name: sort_direction
          in: query
          description: Sorting order
          schema:
            type: string
            default: DESC
            enum:
              - DESC
              - ASC
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/coinbase.public_rest_api.GetPortfolioAddressBookResponse
components:
  schemas:
    coinbase.public_rest_api.GetPortfolioAddressBookResponse:
      required:
        - addresses
        - pagination
      type: object
      properties:
        addresses:
          type: array
          description: List of addresses added to Address Book
          items:
            $ref: '#/components/schemas/coinbase.custody.api.AddressBookEntry'
        pagination:
          $ref: '#/components/schemas/coinbase.public_rest_api.PaginatedResponse'
    coinbase.custody.api.AddressBookEntry:
      required:
        - added_by
        - id
        - name
        - state
      type: object
      properties:
        id:
          type: string
          description: UUID identifying this address book entry
        currency_symbol:
          type: string
          description: Currency symbol
        name:
          type: string
          description: Name for this address book entry
        address:
          type: string
          description: Cryptocurrency address
        account_identifier:
          type: string
          description: Memo or destination tag for currencies which support them
        account_identifier_name:
          type: string
          description: Name of the account identifier. For instance Destination Tag
        state:
          type: string
          description: State of this address book entry
        explorer_link:
          type: string
          description: Link to a blockchain explorer
        last_used_at:
          type: string
          description: When this entry was last used for a transaction
          format: date-time
        added_at:
          type: string
          description: When this entry was added to the address book
          format: date-time
        added_by:
          $ref: '#/components/schemas/coinbase.custody.api.DisplayUser'
        type:
          $ref: '#/components/schemas/coinbase.custody.api.AddressBookType'
        counterparty_id:
          type: string
          description: counterparty id
    coinbase.public_rest_api.PaginatedResponse:
      required:
        - has_next
        - next_cursor
        - sort_direction
      type: object
      properties:
        next_cursor:
          type: string
          description: Cursor to navigate to next page
        sort_direction:
          $ref: '#/components/schemas/coinbase.public_rest_api.SortDirection'
        has_next:
          type: boolean
          description: >-
            A boolean value indicating whether there are more items to paginate
            through
    coinbase.custody.api.DisplayUser:
      required:
        - avatar_url
        - id
        - name
      type: object
      properties:
        id:
          type: string
          description: User UUID
        name:
          type: string
          description: User full name
        avatar_url:
          type: string
          description: User avatar URL
    coinbase.custody.api.AddressBookType:
      type: string
      default: ADDRESS_BOOK_TYPE_UNSPECIFIED
      enum:
        - ADDRESS_BOOK_TYPE_UNSPECIFIED
        - ADDRESS_BOOK_TYPE_ADDRESS
        - ADDRESS_BOOK_TYPE_COUNTERPARTY_ID
    coinbase.public_rest_api.SortDirection:
      type: string
      default: DESC
      enum:
        - DESC
        - ASC

````