API Documentation Menu

AVALANCHE API

Block API V1

Block API allows you to interact with the Avalanche network, retrieve blockchain data, and perform various operations programmatically. Whether you're developing decentralized applications (dApps), conducting blockchain research, or integrating Avalanche functionalities into your projects, our API makes it simple and efficient.

To get started with our Avalanche Blockchain API, you'll need an API key, which you can obtain by signing up on our platform. Once you have your API key, you can start making API calls to access Avalanche blockchain data and functionalities. Our Avalanche Blockchain API simplifies the process of interacting with the Avalanche network, enabling you to build powerful and innovative blockchain applications. We are excited to see what you create with our API and look forward to supporting your Avalanche-powered projects.

Registering

Register for a free account on Block API to use this Blockchain API.

Once you've created an account, you may generate an API key for use with our API in the Account section.

API Key Create

Create an API key to access API for your project and you can create it via this link. To set up access follow given instructions.

When you create an API, you’ll get two pieces of information which are very important to remember.

Please remember below information after creation:

API Key: API key represents the account’s identity.

Secret Key: It is used to keep the data secure and secret.

The Access key and Secret key will be generated randomly which is provided by Block API and it gives API access security.

General API Information

These following base endpoints are accessible.

https://blockapi.biz/api

Every endpoint returns a JSON object or array

The following API endpoints can be accessed using the basic endpoint at https://blockapi.biz/api vision:

Endpoints Configurations

We offer REST APIs which support withdrawal, transaction history, balance status and new address.

REST API

REST stands for Representational State Transfer which is the most popular internet software architecture today. It has a clear structure, is simple to understand, and is easy to expand. As a result, more and more businesses are incorporating structures into their websites. It has the following benefits:

1. Each URL represents a resource in RESTful architecture

2. Certain presentation layers of resources passed among the clients and the server.

3. Four HTTP commands are used by the clients to operate on the server-side resources for achieving “State transition of the presentation layer”

We suggest that REST API for trading and/or Asset operation (like, deposit & withdrawal) are appropriate for users.

Authorization

Your personal API Key can be found on the settings page. We make use of it to determine who is accessing the API as well as to keep track of the number of requests made by a specific account. It can be utilized in one of two ways, according to your requirements:

Add it in the HTTP header as:

Note: If you want to keep your data secure, don’t share your API key/secret key with anyone.

Generate Address

POST :/v1/avalanche/generateAddress

Create a new address

HEADERS

apiKey :nmaqluksug********************mdsl4mtymu

secretKey :6zci5bdeziumnaj1********************************zmv4zpsbozx6t7sp

Accept :application/json

RESPONSE :

{

"status": true,

"msg": "Address generated successfully.",

"info": {

"address": "0xbB757B525255Bb5919d4f2E1F2491Ba80110eeDa",

"privateKey": "0x7ddfd1d59dc0e7beb933b1b4ef41921a1fee630de42cce63bc9857286fd967d7"

}

}

Get Balance

POST :/v1/avalanche/getBalance

You can check your balance using your address

HEADERS

apiKey :nmaqluksug********************mdsl4mtymu

secretKey :6zci5bdeziumnaj1********************************zmv4zpsbozx6t7sp

Accept :application/json

Body :raw (json)

{

"address": "0xbB757B525255Bb5919d4f2E1F2491Ba80110eeDa",

"coinName": "avax"

}

RESPONSE :

{

"status": true,

"msg": "Success",

"info": "0.00125000"

}

Validate Address

POST :/v1/avalanche/validateAddress

Validate an address

HEADERS

apiKey :nmaqluksug********************mdsl4mtymu

secretKey :6zci5bdeziumnaj1********************************zmv4zpsbozx6t7sp

Accept :application/json

Body :raw (json)

{

"address":"0xbB757B525255Bb5919d4f2E1F2491Ba80110eeDa",

"coinName":"avax"

}

RESPONSE :

{

"status": true,

"msg": "Address valid."

}

Transaction History

POST :/v1/avalanche/transactionHistory

Check your transaction history by using your address

HEADERS

apiKey :nmaqluksug********************mdsl4mtymu

secretKey :6zci5bdeziumnaj1********************************zmv4zpsbozx6t7sp

Accept :application/json

Body :raw (json)

{

"address": "0x97cfb6eba09dd7ac15a4fba3b3b7cf6c536259b2",

"coinName": "avax"

}

RESPONSE :

{

"status": true,

"msg": "Success",

"info": [

{

"timestamp": "1687759780",

"hash": "0x5e4671d752176862f3db1f1c983382096ce4cf60357fedbd6e7f2ca22c843471",

"from": "0x97cfb6eba09dd7ac15a4fba3b3b7cf6c536259b2",

"to": "0x4151648a338608b9ac2a2c94d86cc0fb6d5bd06b",

"value": "0.05103928",

"status": "confirmed"

},

{

"timestamp": "1685706293",

"hash": "0xb2b5a15d100d9106b35f72cafb8f63d80ec5a5c4908bd3e95fb3e26b7d7fb34a",

"from": "0x97cfb6eba09dd7ac15a4fba3b3b7cf6c536259b2",

"to": "0x7a250d5630b4cf539739df2c5dacb4c659f2488d",

"value": "0.00535174",

"status": "confirmed"

}

]

}

Send Transaction

POST :/v1/avalanche/sendTransaction

Send transaction API from one address to another address

HEADERS

apiKey :nmaqluksug********************mdsl4mtymu

secretKey :6zci5bdeziumnaj1********************************zmv4zpsbozx6t7sp

Accept :application/json

Body :raw (json)

{

"privateKey": "0x7ddfd1d59dc0e7beb933b1b4ef41921a1fee630de42cce63bc9857286fd967d7",

"from": "0xbB757B525255Bb5919d4f2E1F2491Ba80110eeDa",

"to": "0x4151648a338608b9ac2a2c94d86cc0fb6d5bd06b",

"coinName": "avax",

"amount": "0.001"

}

RESPONSE

{

"status": true,

"msg": "Success",

"info": "0x5e4671d752176862f3db1f1c983382096ce4cf60357fedbd6e7f2ca22c843471"

}

Check Transaction Status

POST :/v1/avalanche/checkTransactionStatus

Check the transaction status by using the hash

HEADERS

apiKey :nmaqluksug********************mdsl4mtymu

secretKey :6zci5bdeziumnaj1********************************zmv4zpsbozx6t7sp

Accept :application/json

Body :raw (json)

{

"hash": "0x5e4671d752176862f3db1f1c983382096ce4cf60357fedbd6e7f2ca22c843471"

}

RESPONSE :

{

"status": true,

"msg": "Success",

"info": {

"status": "confirmed",

"fees": "0.000277173871779"

}

}

Block Transaction History

POST :/v1/avalanche/blockTransactionHistory

Get the transaction history by using the block number

HEADERS

apiKey :nmaqluksug********************mdsl4mtymu

secretKey :6zci5bdeziumnaj1********************************zmv4zpsbozx6t7sp

Accept :application/json

Body :raw (json)

{

"blockNumber": "20088861"

}

RESPONSE :

{

"status": true,

"msg": "Success",

"info": []