Get Holder

Retrieve holder information, such as wallet address and token balances.


GETapi.metal.build/holder/:userId?publicKey=:publicKey

Get Holder

This endpoint returns the wallet address, token balances and other relevant information for a specific holder.

Your public API key can be found here.


Response attributes

  • Name
    id
    Type
    string
    Description

    The id of the holder. This is the same as userId which you made the request with.

  • Name
    address
    Type
    string
    Description

    The address of the holder.

  • Name
    totalValue
    Type
    number
    Description

    Total value of all token holdings in USD.

  • Name
    tokens
    Type
    array
    Description

    Array of token objects, each containing:

    [{
      "id": "string",
      "address": "string",
      "name": "string",
      "symbol": "string",
      "balance": "number",
      "value": "number",
    }]
    

Request

GET
api.metal.build/holder/:userId?publicKey=:publicKey
const response = await fetch(
  'https://api.metal.build/holder/holder_789?publicKey=YOUR_PUBLIC_API_KEY'
  )

const balances = await response.json()

Response

{
  "id": "holder_789",
  "address": "0xabcdef1234567890abcdef1234567890abcdef12",
  "totalValue": 226.12,
  "tokens": [
    {
      "id": "0x1234567890abcdef1234567890abcdef12345678",
      "address": "0x1234567890abcdef1234567890abcdef12345678",
      "name": "merchant Coin",
      "symbol": "COIN",
      "balance": 100.5,
      "value": 150.75
    },
    {
      "id": "0x2345678901abcdef2345678901abcdef23456789",
      "address": "0x2345678901abcdef2345678901abcdef23456789",
      "name": "Community Token",
      "symbol": "COMM",
      "balance": 50.25,
      "value": 75.37
    }
  ]
}

Get Single Token Balance

Retrieve detailed balance information for a specific token holder, including their balance and its current value in USD.


GETapi.metal.build/holder/:holderAddress/token/:tokenAddress

Get Single Token Balance

This endpoint returns the balance and value information for a specific token holder. To retrieve the user's holderAddress you can use Get Holder.


Response attributes

  • Name
    name
    Type
    string
    Description

    The name of the token.

  • Name
    symbol
    Type
    string
    Description

    The token's symbol.

  • Name
    id
    Type
    string
    Description

    The token's contract address.

  • Name
    address
    Type
    string
    Description

    The token's contract address (same as id).

  • Name
    balance
    Type
    number
    Description

    The holder's token balance.

  • Name
    value
    Type
    number
    Description

    The holder's token balance in USD.
    Will return null if no liquidity has been created for the token.

Request

GET
api.metal.build/holder/:holderAddress/token/:tokenAddress
const response = await fetch(
  'https://api.metal.build/holder/0x1234567890abcdef1234567890abcdef12345678/token/0xabcdef1234567890abcdef1234567890abcdef12',
  {
    headers: {
      'x-api-key': 'YOUR_SECRET_API_KEY',
    },
  }
)

const holder = await response.json()

Response

{
  name: "TestToken",
  symbol: "TT",
  id: "0xde522f429bde9776417985c6ebcdc9de872fd5c4",
  address: "0xde522f429bde9776417985c6ebcdc9de872fd5c4",
  balance: 2000000,
  value: 15.00
}

Was this page helpful?