LogoLogo
  • Kaiko Knowledge Hub
  • General
    • 👋Introduction
    • 🏎️Getting Started
      • API input
      • API output
        • "taker_side_sell" Explained
        • Market open and close
        • Timestamp
      • Authentication
      • Data versioning
      • Envelope
      • Error codes
      • Pagination
      • Rate limiting
  • Data Feeds
    • Introduction
    • Level 1 & Level 2 Data
      • Level 1 Aggregations
        • Trade Count, OHLCV, & VWAP
          • OHLCV only
          • VWAP only
      • Level 1 Tick-Level
        • All trades
        • Derivative liquidation events
        • Borrows, repayments, liquidations, and withdrawals
      • Level 2 Aggregations
        • Market depth (snapshot)
        • Market depth (aggregation)
        • Price slippage (snapshot)
        • Price slippage (aggregation)
        • Bid-ask spread (aggregation)
        • Tokens in a liquidity pool
          • Tokens in a liquidity pool (Uniswap v3)
        • Interest rates, borrowed and deposited amounts
        • Raw order book snapshot
          • Raw order book snapshot + market depth, bid/ask spread & price slippage
      • Level 2 Tick-Level
        • Mints and burns
    • Reference Data
      • Free tier
        • Asset codes
        • Exchange codes
        • Exchange trading pair codes (instruments)
        • Lending protocol codes
        • Blockchain codes
      • Advanced tier
        • Derivatives contract details
        • Derivatives price details
      • Premium tier
        • Market capitalization and circulating supply (BETA)
  • ANALYTICS Solutions
    • Introduction
    • Kaiko Fair Market Value
      • Kaiko Fair Market Value (Direct prices for high liquidity pairs)
      • Kaiko Fair Market Value (Synthetic prices for low liquidity pairs)
        • Convert with Oanda FX Rates
    • Kaiko Derivatives Risk Indicators
      • Exchange-provided metrics
      • Token-level liquidation volumes
      • Implied volatility calculation - smile
      • Implied volatility calculation - surface
    • Kaiko Portfolio Risk & Performance
      • Value at risk calculation
      • Custom valuation
  • Monitoring Solutions
    • Kaiko Market Explorer
      • Assets
      • Exchanges
    • Kaiko Blockchain Monitoring
      • Ethereum Wallets
        • Balances and transactions
      • Bitcoin Wallets
        • Balances
        • Transaction
      • Solana Wallets
        • Balances and transactions
      • Provenance Wallets
        • Balances and transactions
  • Misc & Legacy endpoints
    • CME
Powered by GitBook
On this page
  • What is this endpoint for?
  • Endpoint
  • Parameters
  • Fields
  • Request example
  • Response example

Was this helpful?

Export as PDF
  1. Monitoring Solutions
  2. Kaiko Blockchain Monitoring
  3. Bitcoin Wallets

Transaction

What is this endpoint for?

This endpoint offers in-depth insights into Bitcoin wallets at the transaction level over time.

Endpoint

https://us.market-api.kaiko.io/v2/data/wallet.v1/transactions

Parameters

Parameter
Required
Description
Example

blockchain

Always bitcoin.

bitcoin

sort

The sorting order for the results.

asc or desc

page_size

Number of results to return data for. (max: 5000).

100

start_block

Starting block height (inclusive).

600000

end_block

Ending block height (inclusive).

700000

start_time

Starting time in ISO 8601 (inclusive).

2022-05-01T00:00:00.000Z

end_time

Ending time in ISO 8601 (inclusive).

2022-05-01T00:00:00.000Z

transaction_hash

The specific transaction hash to query.

f6932e70e4c5483d7b1fa2ee7c56ad89207221bbf186ad0a15cd0cc4e18906f5

Fields

Field
Description
Example

chain

Blockchain name.

bitcoin

block_number

The height of the block.

395211

timestamp

The timestamp of the block.

1453853136

transaction_hash

Transaction hash.

94ad60ff0ef4cd0f31cab884adc6c39720273e9468ac0019a339911f0dd26e76

transaction_id

Transaction ID.

f6932e70e4c5483d7b1fa2ee7c56ad89207221bbf186ad0a15cd0cc4e18906f5

transaction_index

The index of the transaction.

0

sender_addresses

The addresses that sends the coin.

[1A8MMLhpGEyNqEsqzkReXtmBx9LBQgt8Mh]

receiver_addresses

The addresses that receives the coin.

[19Ntq9wC9i39284EZVVf4R7DbCz7gThxzs,12eKGe5hLdKBe8mQ7dv8NixEcX96XHBkoZ]

token_symbol

Symbol of the coin transfered

BTC

amount_out

Amount of asset transfered.

10.12592654

fees

Fees paid for the transaction.

0.0004

amount_out_usd

Amount of asset transferred in usd.

3965.771819253574

fees_usd

Fees paid for the transaction in usd.

0.15665813112855445

Request example

curl --compressed -H "Accept: application/json" -H "X-Api-Key: <client-api-key>" \
  "https://eu.market-api.kaiko.io/v2/data/wallet.v1/transactions?blockchain=bitcoin"
##### 1. Import dependencies #####
import requests
import pandas as pd

##### 2. Choose the value of the query's parameters #####
# ---- Required parameters ---- #
blockchain = "bitcoin" 

# ---- Optional parameters ---- #
start_block = 600000
end_block = 600001
start_time = None
end_time = None
page_size = 100
sort = "desc"
transaction_hash = None

# ---- API key configuration ---- #
api_key = "YOUR_API_KEY"

##### 3. Get the data #####
# ---- Function to run an API call ---- # 
# Get the data in a dataframe --------- # 

def get_kaiko_data(api_key: str, blockchain: str, start_block: int, end_block: int, start_time: str, end_time: str, page_size: int, sort: str, transaction_hash: str):
    headers = {'Accept': 'application/json', 'X-Api-Key': api_key}
    
    url = f'https://us.market-api.kaiko.io/v2/data/wallet.v1/transactions'
    params = {
        "blockchain": blockchain,
        "start_block": start_block,
        "end_block": end_block,
        "start_time": start_time,
        "end_time": end_time,
        "page_size": page_size,
        "sort": sort,
        "transaction_hash": transaction_hash
    }

    try:
        res = requests.get(url, headers=headers, params=params)
        res.raise_for_status() 
        data = res.json()
        if 'data' not in data:
            print("No data returned.")
            return pd.DataFrame() 
        df = pd.DataFrame(data['data'])

        # Handle pagination with continuation token
        while 'next_url' in data:
            next_url = data['next_url']
            if next_url is None:
                break
            res = requests.get(next_url, headers=headers)
            res.raise_for_status()
            data = res.json()
            if 'data' in data:
                df = pd.concat([df, pd.DataFrame(data['data'])], ignore_index=True)
        return df

    except requests.exceptions.RequestException as e:
        print(f"API request error: {e}")
        return pd.DataFrame() 

# ---- Get the data ---- #
df = get_kaiko_data(api_key=api_key, blockchain=blockchain, start_block=start_block, end_block=end_block, start_time=start_time, end_time=end_time, page_size=page_size, sort=sort, transaction_hash=transaction_hash)
print (df)

Response example

{
    "query":
    {
        "live": "False",
        "start_time": "2009-01-01T00:00:00.000Z",
        "end_time": "2009-01-01T00:00:00.000Z",
        "start_block": 0,
        "end_block": 0,
        "page_size": 1000,
        "sort": "ASCENDING",
        "data_version": "v1",
        "commodity": "wallet_data",
        "request_time": "2009-01-01T00:00:00.000Z"
    },
    "time": "2009-01-01T00:00:00.000Z",
    "timestamp": 1704069091000,
    "access":
    {
        "access_range":
        {
            "start_timestamp": 1073001600000,
            "end_timestamp": "None"
        },
        "data_range":
        {
            "start_timestamp": "None",
            "end_timestamp": "None"
        }
    },
    "data":
    [
        {
            "chain": "bitcoin",
            "block_number": 823787,
            "timestamp": 1704069091000000000,
            "transaction_hash": "e651241e9982332ea4cf59923d8cbc7468e1960bb5ab9f68d9e72984830c530c",
            "transaction_id": "e651241e9982332ea4cf59923d8cbc7468e1960bb5ab9f68d9e72984830c530c",
            "transaction_index": 15,
            "sender_addresses":
            [
                "1n8gms991ydy1e696e9sb9esyy5cksu7hz"
            ],
            "receiver_addresses":
            [
                "1n8gms991ydy1e696e9sb9esyy5cksu7hz",
                "3juadjkqtgzr9p9n59rtugv5pl2tohf6t9",
                "bc1q5g4w7sajpqvd0syvghsqvrxcf2ysxce0yxqjkx"
            ],
            "token_symbol": "BTC",
            "amount_out": 0.37257751,
            "fees": 0.0014,
            "amount_out_usd": 15729.55,
            "fees_usd": 59.1
        },
        /* ... */
    ],
    "continuation_token": "xxx",
    "next_url": "https://us.market-api.kaiko.io/v2/data/wallet.v1/transactions?continuation_token=xxx"
    }
}
PreviousBalancesNextSolana Wallets

Last updated 2 months ago

Was this helpful?

See

Pagination