Transaction info

Page about how to get transaction(s)

API documentation can be found for Bitcoin-like and Ethereum cryptocurrency on blockhairs website.

Bitcoin-like cryptocurrency

GetTransaction

GetTransaction fetches a Bitcoin-like transaction. The cryptocurrency supported, per 2021 September, are bitcoin, bitcoin-cash, litecoin, bitcoin-sv, dogecoin, dash, groestlcoin, zcash, ecash, bitcoin/testnet. Followed by the transaction hash (regex: /^[0-9a-f]{64}$/i), also known as txid.

Example usage of GetTransaction

package main

import (
	"fmt"
	"log"
	"os"

	"github.com/DiFronzo/blockchair"
)

var clientID string

func init() {
	clientID = os.Getenv("API_KEY")
}

func main() {
	c := blockchair.New()
	c.APIKey = clientID // If you don't have an API key remove the lines about "clientID".
	resp, err := c.GetTransaction("bitcoin", "f4184fc596403b9d638783cf57adfe4c75c605f6356fbc91338530e9831e9e16")
	if err != nil {
		log.Fatalln(err)
	}
	
	fmt.Println(resp)

}

Request cost is 1.

GetTransactionAdv

GetTransactionAdv fetches a Bitcoin-like transaction and allowing options. The cryptocurrency supported, per 2021 September, are bitcoin, bitcoin-cash, litecoin, bitcoin-sv, dogecoin, dash, groestlcoin, zcash, ecash, bitcoin/testnet. Followed by the transaction hash (regex: /^[0-9a-f]{64}$/i), also known as txid. Lastly the wanted options in a map (for valid options see API doc. linked on top of the page).

Example usage of GetTransactionAdv

package main

import (
	"fmt"
	"log"
	"os"

	"github.com/DiFronzo/blockchair"
)

var clientID string

func init() {
	clientID = os.Getenv("API_KEY")
}

func main() {
	c := blockchair.New()
	c.APIKey = clientID
	resp, err := c.GetTransactionAdv("bitcoin", "f4184fc596403b9d638783cf57adfe4c75c605f6356fbc91338530e9831e9e16", map[string]string{"omni": "true"})
	if err != nil {
		log.Fatalln(err)
	}
	
	fmt.Println(resp)

}

Request cost is 1.

GetTransactions

GetTransactions fetches mutliple Bitcoin-like transactions. The cryptocurrency supported, per 2021 September, are bitcoin, bitcoin-cash, litecoin, bitcoin-sv, dogecoin, dash, groestlcoin, zcash, ecash, bitcoin/testnet. Followed by the transaction hashes (regex: /^[0-9a-f]{64}$/i), also known as txid's.

package main

import (
	"fmt"
	"log"
	"os"

	"github.com/DiFronzo/blockchair"
)

var clientID string

func init() {
	clientID = os.Getenv("API_KEY")
}

func main() {
	c := blockchair.New()
	c.APIKey = clientID
	resp, err := c.GetTransactions("bitcoin", []string{"ed232ffd13184a8ff682364d20d25575492fbc9f8904343308e2b68d71feda21", "ef4e4240cdca472910ba4e6d77102320cb866d378964f3e663d69fc5fbfc0cd9"})
	if err != nil {
		log.Fatalln(err)
	}
	
	fmt.Println(resp)
}

GetTransactionsAdv

GetTransactionsAdv fetches mutliple Bitcoin-like transactions and allowing options. The cryptocurrency supported, per 2021 September, are bitcoin, bitcoin-cash, litecoin, bitcoin-sv, dogecoin, dash, groestlcoin, zcash, ecash, bitcoin/testnet. Followed by the transaction hashes (regex: /^[0-9a-f]{64}$/i), also known as txid's.

package main

import (
	"fmt"
	"log"
	"os"

	"github.com/DiFronzo/blockchair"
)

var clientID string

func init() {
	clientID = os.Getenv("API_KEY")
}

func main() {
	c := blockchair.New()
	c.APIKey = clientID
	resp, err := c.GetTransactionsAdv("bitcoin", []string{"ed232ffd13184a8ff682364d20d25575492fbc9f8904343308e2b68d71feda21", "ef4e4240cdca472910ba4e6d77102320cb866d378964f3e663d69fc5fbfc0cd9"}, map[string]string{"omni": "true"})
	if err != nil {
		log.Fatalln(err)
	}
	
	fmt.Println(resp)

}

Ethereum cryptocurrency

GetTransactionEth

GetTransactionEth fetches an Ethereum transaction. The cryptocurrency supported, per 2021 September, are ethereum, ethereum/testnet. Followed by the transaction hash (regex: /^0x[0-9a-f]{64}$/i), also known as txid. Request cost is 1.

Example usage of GetTransactionEth

package main

import (
	"fmt"
	"log"
	"os"

	"github.com/DiFronzo/blockchair"
)

var clientID string

func init() {
	clientID = os.Getenv("API_KEY")
}

func main() {
	c := blockchair.New()
	c.APIKey = clientID
	resp, err := c.GetTransactionEth("ethereum", "0xc132a422513e39038269e091847319a14029feb42c66bd1424c57dfc0e4f8d08")
	if err != nil {
		log.Fatalln(err)
	}

	fmt.Println(resp)
}

GetTransactionEthAdv

GetTransactionEthAdv fetches an Ethereum transaction and allowing options. The cryptocurrency supported, per 2021 September, are ethereum, ethereum/testnet. Followed by the transaction hash (regex: /^0x[0-9a-f]{64}$/i), also known as txid. Lastly the wanted options in a map (for valid options see API doc. linked on top of the page). Request cost is 1.

package main

import (
	"fmt"
	"log"
	"os"

	"github.com/DiFronzo/blockchair"
)

var clientID string

func init() {
	clientID = os.Getenv("API_KEY")
}

func main() {
	c := blockchair.New()
	c.APIKey = clientID
	resp, err := c.GetTransactionEthAdv("ethereum", "0xc132a422513e39038269e091847319a14029feb42c66bd1424c57dfc0e4f8d08", map[string]string{"erc_20": "true"})
	if err != nil {
		log.Fatalln(err)
	}
	
	fmt.Println(resp)

}

Last updated