Hatchfi API Endpoints
Our endpoints allow you to quickly & securely fetch the following data from Hatchfi API:
-
Account data
-
Balance data
-
Transaction data
In our examples below, we provide some examples in Bash, Node, Python, Javascript, and our JS SDK.
Our endpoints are easily accessible with our Hatchfi JS SDK, directly through the API, or a headless setup (without the Link UI). These are all authenticated endpoints and require a clientId
, apiKey
, and secretKey
with each call to ensure the safety of your data.
GET all accounts for a specified user endpoint
This function returns all of the specified user's accounts. Make sure to replace theACCOUNT_ID
, API_KEY_FROM_DASHBOARD
, SECRET_KEY_FROM_DASHBOARD
, and USER_ID
.
curl --request GET \
--url https://api.hatchfi.co/v1/accounts/ \
--header 'X-Hatchfi-Api: API_KEY_FROM_DASHBOARD' \
--header 'X-Hatchfi-Secret: SECRET_KEY_FROM_DASHBOARD' \
--header 'X-Hatchfi-User-Id: USER_ID'
var axios = require("axios").default;
var options = {
method: 'GET',
url: 'https://api.hatchfi.co/v1/accounts/',
headers: {
"X-Hatchfi-Api": API_KEY_FROM_DASHBOARD,
"X-Hatchfi-Secret": API_KEY_FROM_DASHBOARD,
"X-Hatchfi-User-Id": USER_ID,
}
};
axios.request(options).then(function (response) {
console.log(response.data);
}).catch(function (error) {
console.error(error);
});
import requests;
url = 'https://api.hatchfi.co/v1/accounts/'
payload = ""
headers = {
"X-Hatchfi-Api": API_KEY_FROM_DASHBOARD,
"X-Hatchfi-Secret": API_KEY_FROM_DASHBOARD,
"X-Hatchfi-User-Id": USER-ID,
}
response = requests.request("GET", url, data=payload, headers=headers)
print(response.text);
import axios from "axios";
const options = {
method: 'GET',
url: 'https://api.hatchfi.co/v1/accounts/',
headers: {
'X-Hatchfi-Api': API_KEY_FROM_DASHBOARD,
'X-Hatchfi-Secret': SECRET_KEY_FROM_DASHBOARD,
'X-Hatchfi-User-Id': USER_ID
}
};
axios.request(options).then(function (response) {
console.log(response.data);
}).catch(function (error) {
console.error(error);
});
const accounts = await hatchfi.accounts.getAll();
This method will return an array of all the specified users Account
objects.
If you use our SDK, Hatchfi automatically knows who the "authenticated" user is so that that method will be called without any arguments.
If you do not use the SDK, you can query all accounts by inserting the headerx-hatchfi-user-id
. This will allow you, the project owner, to query all of your users' accounts within your application.
[
{
"provider": [
{
"inputs": [],
"notes": null,
"resourceType": "provider",
"id": "62284a5e7f596a3b09e8a5da",
"name": "bsc",
"displayName": "Binance Smart Chain",
"authType": "read_only"
}
],
"balances": [
{
"ticker": "BNB",
"providerTicker": "BNB",
"name": "Binance Coin",
"fiat_ticker": "USD",
"misc": [],
"id": "62284a5e7f596a3b09e8a5db",
"assetType": "BEP20",
"amount": "495997767937420876",
"decimals": 8
}
],
"blockchain": "bsc",
"resourceType": "account",
"wallets": [
{
"address": "0xfb216f3F67065d9274d04a057fBC837f4226c864",
"ticker": "BNB",
"id": "4e52d3b5-0eef-443f-898e-73c35b6d4951"
}
],
"id": "a5fba948-71de-41a4-b2b7-1a2d291b76c1"
},
...
]
GET specific account for a specified user Endpoint
This method returns the specified crypto account of the selected user of your app. Make sure to replace theACCOUNT_ID
, API_KEY_FROM_DASHBOARD
, SECRET_KEY_FROM_DASHBOARD
, and USER_ID
.
curl --request GET \
--url https://api.hatchfi.co/v1/accounts/ACCOUNT_ID \
--header 'X-Hatchfi-Api: API_KEY_FROM_DASHBOARD' \
--header 'X-Hatchfi-Secret: SECRET_KEY_FROM_DASHBOARD' \
--header 'X-Hatchfi-User-Id: USER_ID'
const axios = require("axios").default;
const options = {
method: 'GET',
url: 'https://api.hatchfi.co/v1/accounts/ACCOUNT_ID',
headers: {
'X-Hatchfi-Api': API_KEY_FROM_DASHBOARD,
'X-Hatchfi-Secret': SECRET_KEY_FROM_DASHBOARD,
'X-Hatchfi-User-Id': USER_ID
}
};
axios.request(options).then(function (response) {
console.log(response.data);
}).catch(function (error) {
console.error(error);
});
import requests;
url = 'https://api.hatchfi.co/v1/accounts/ACCOUNT_ID'
payload = ""
headers = {
"X-Hatchfi-Api": API_KEY_FROM_DASHBOARD,
"X-Hatchfi-Secret": SECRET_KEY_FROM_DASHBOARD,
"X-Hatchfi-User-Id": USER_ID,
}
response = requests.request("GET", url, data=payload, headers=headers)
print(response.text);
import axios from "axios";
const options = {
method: 'GET',
url: 'https://api.hatchfi.co/v1/accounts/ACCOUNT_ID',
headers: {
'X-Hatchfi-Api': API_KEY_FROM_DASHBOARD,
'X-Hatchfi-Secret': SECRET_KEY_FROM_DASHBOARD,
'X-Hatchfi-User-Id': USER_ID
}
};
axios.request(options).then(function (response) {
console.log(response.data);
}).catch(function (error) {
console.error(error);
});
const accounts = await hatchfi.accounts.getOne(accountId);
This method will return a specific account Account
object for that specific user, like in the example below:
{
"provider": [
{
"inputs": [],
"notes": null,
"resourceType": "provider",
"id": "62284a5e7f596a3b09e8a5da",
"name": "bsc",
"displayName": "Binance Smart Chain",
"authType": "read_only"
}
],
"balances": [
{
"ticker": "BNB",
"providerTicker": "BNB",
"name": "Binance Coin",
"fiat_ticker": "USD",
"misc": [],
"id": "62284a5e7f596a3b09e8a5db",
"assetType": "BEP20",
"amount": "495997767937420876",
"decimals": 8
}
],
"blockchain": "bsc",
"resourceType": "account",
"wallets": [
{
"address": "0xfb216f3F67065d9274d04a057fBC837f4226c864",
"ticker": "BNB",
"id": "4e52d3b5-0eef-443f-898e-73c35b6d4951"
}
],
"id": "a5fba948-71de-41a4-b2b7-1a2d291b76c1"
}
GET audit data for a specified account
This method returns the specified crypto audit of the selected account. Make sure to replace theACCOUNT_ID
, API_KEY_FROM_DASHBOARD
, SECRET_KEY_FROM_DASHBOARD
, and USER_ID
.
curl --request GET \
--url https://api.hatchfi.co/v1/accounts/ACCOUNT_ID/audits \
--header 'X-Hatchfi-Api: API_KEY_FROM_DASHBOARD' \
--header 'X-Hatchfi-Secret: SECRET_KEY_FROM_DASHBOARD' \
--header 'X-Hatchfi-User-Id: USER_ID'
const axios = require("axios").default;
const options = {
method: 'GET',
url: 'https://api.hatchfi.co/v1/accounts/ACCOUNT_ID/audits',
headers: {
'X-Hatchfi-Api': API_KEY_FROM_DASHBOARD,
'X-Hatchfi-Secret': SECRET_KEY_FROM_DASHBOARD,
'X-Hatchfi-User-Id': USER_ID
}
};
axios.request(options).then(function (response) {
console.log(response.data);
}).catch(function (error) {
console.error(error);
});
import requests;
url = 'https://api.hatchfi.co/v1/accounts/ACCOUNT_ID/audits'
payload = ""
headers = {
"X-Hatchfi-Api": API_KEY_FROM_DASHBOARD,
"X-Hatchfi-Secret": SECRET_KEY_FROM_DASHBOARD,
"X-Hatchfi-User-Id": USER_ID,
}
response = requests.request("GET", url, data=payload, headers=headers)
print(response.text);
import axios from "axios";
const options = {
method: 'GET',
url: 'https://api.hatchfi.co/v1/accounts/ACCOUNT_ID/audits',
headers: {
'X-Hatchfi-Api': API_KEY_FROM_DASHBOARD,
'X-Hatchfi-Secret': SECRET_KEY_FROM_DASHBOARD,
'X-Hatchfi-User-Id': USER_ID
}
};
axios.request(options).then(function (response) {
console.log(response.data);
}).catch(function (error) {
console.error(error);
});
const audits = await hatchfi.audits.getAll(accountId);
The /audits
endpoint will return an array of data that looks like this:
[
{
"userId": "hatchfi-test-portfolio",
"clientId": "b2ffb6ac241641e1120f13a5ddf37ef238d0fcba58b72f2ffd623890b7a65408",
"accountId": "0a625bc3-8249-4a57-9a03-71ce06e7520d",
"provider": "polygon",
"dataType": "balance",
"data": {
"data": {
"address": "0x57571d366a00b3389b0adf30a114bc7da7a11580",
"updated_at": "2022-12-11T17:17:26.895577192Z",
"next_update_at": "2022-12-11T17:22:26.895577662Z",
"quote_currency": "USD",
"chain_id": 137,
"items": [
{
"contract_decimals": 18,
"contract_name": "Matic Token",
"contract_ticker_symbol": "MATIC",
"contract_address": "0x0000000000000000000000000000000000001010",
"supports_erc": [
"erc20"
],
"logo_url": null,
"last_transferred_at": null,
"native_token": true,
"type": "cryptocurrency",
"balance": "2567074973142486455847965",
"balance_24h": "2567074973142486455847965",
"quote_rate": 0.9112473,
"quote_rate_24h": 0.9120353,
"quote": 2339240.2,
"quote_24h": 2341263,
"nft_data": null
},
...
],
"pagination": null
},
"error": false,
"error_message": null,
"error_code": null
},
"summary": {
"numOfCalls": 1
},
"createdAt": "2022-12-11T17:17:26.955Z"
},
...
]
DELETE all accounts for a specified user endpoint
This method removes all of the accounts of the selected user. This comes in handy when a user requests to remove all of their connections from your platform and the Hatchfi database. Make sure to replace the API_KEY_FROM_DASHBOARD
, SECRET_KEY_FROM_DASHBOARD
, and USER_ID
.
curl --request DELETE \
--url https://api.hatchfi.co/v1/accounts/delete \
--header 'X-Hatchfi-Api: API_KEY_FROM_DASHBOARD' \
--header 'X-Hatchfi-Secret: SECRET_KEY_FROM_DASHBOARD' \
--header 'X-Hatchfi-User-Id: USER_ID'
const axios = require("axios").default;
const options = {
method: 'DELETE',
url: 'https://api.hatchfi.co/v1/accounts/delete',
headers: {
'X-Hatchfi-Api': API_KEY_FROM_DASHBOARD,
'X-Hatchfi-Secret': SECRET_KEY_FROM_DASHBOARD,
'X-Hatchfi-User-Id': USER_ID
}
};
axios.request(options).then(function (response) {
console.log(response.data);
}).catch(function (error) {
console.error(error);
});
import requests
url = "https://api.hatchfi.co/v1/accounts/delete"
payload = ""
headers = {
"X-Hatchfi-Api": API_KEY_FROM_DASHBOARD,
"X-Hatchfi-Secret": SECRET_KEY_FROM_DASHBOARD,
"X-Hatchfi-User-Id": USER_ID
}
response = requests.request("DELETE", url, data=payload, headers=headers)
print(response.text)
import axios from "axios";
const options = {
method: 'DELETE',
url: 'https://api.hatchfi.co/v1/accounts/delete',
headers: {
'X-Hatchfi-Api': API_KEY_FROM_DASHBOARD,
'X-Hatchfi-Secret': SECRET_KEY_FROM_DASHBOARD,
'X-Hatchfi-User-Id': USER_ID
}
};
axios.request(options).then(function (response) {
console.log(response.data);
}).catch(function (error) {
console.error(error);
});
await hatchfi.accounts.deleteAll();
DELETE a specific account for a specified user endpoint
This method removes the specified account from the selected user. This is handy when a user wants to remove a single connection from your platform and the Hatchfi database. Make sure to replace theACCOUNT_ID
, API_KEY_FROM_DASHBOARD
, SECRET_KEY_FROM_DASHBOARD
, and USER_ID
.
curl --request DELETE \
--url https://api.hatchfi.co/v1/accounts/:accountId \
--header 'X-Hatchfi-Api: API_KEY_FROM_DASHBOARD' \
--header 'X-Hatchfi-Secret: SECRET_KEY_FROM_DASHBOARD' \
--header 'X-Hatchfi-User-Id: USER_ID'
const axios = require("axios").default;
const options = {
method: 'DELETE',
url: 'https://api.hatchfi.co/v1/accounts/ACCOUNT_ID',
headers: {
'X-Hatchfi-Api': API_KEY_FROM_DASHBOARD,
'X-Hatchfi-Secret': SECRET_KEY_FROM_DASHBOARD,
'X-Hatchfi-User-Id': USER_ID
}
};
axios.request(options).then(function (response) {
console.log(response.data);
}).catch(function (error) {
console.error(error);
});
import requests
url = "https://api.hatchfi.co/v1/accounts/ACCOUNT_ID"
payload = ""
headers = {
"X-Hatchfi-Api": API_KEY_FROM_DASHBOARD,
"X-Hatchfi-Secret": SECRET_KEY_FROM_DASHBOARD,
"X-Hatchfi-User-Id": USER_ID
}
response = requests.request("DELETE", url, data=payload, headers=headers)
print(response.text)
import axios from "axios";
const options = {
method: 'DELETE',
url: 'https://api.hatchfi.co/v1/accounts/ACCOUNT_ID',
headers: {
'X-Hatchfi-Api': API_KEY_FROM_DASHBOARD,
'X-Hatchfi-Secret': SECRET_KEY_FROM_DASHBOARD,
'X-Hatchfi-User-Id': USER_ID
}
};
axios.request(options).then(function (response) {
console.log(response.data);
}).catch(function (error) {
console.error(error);
});
await hatchfi.accounts.deleteOne(ACCOUNT_ID);
GET all transactions from a specified user's account endpoint
This function returns all of the selected account's transactions. Make sure to replace theACCOUNT_ID
, API_KEY_FROM_DASHBOARD
, SECRET_KEY_FROM_DASHBOARD
, and USER_ID
.
curl --request GET \
--url https://api.hatchfi.co/v1/accounts/ACCOUNT_ID/transactions \
--header 'X-Hatchfi-Api: API_KEY_FROM_DASHBOARD' \
--header 'X-Hatchfi-Secret: SECRET_KEY_FROM_DASHBOARD' \
--header 'X-Hatchfi-User-Id: USER_ID'
const axios = require("axios").default;
const options = {
method: 'GET',
url: `https://api.hatchfi.co/v1/accounts/ACCOUNT_ID/transactions`,
headers: {
'X-Hatchfi-Api': API_KEY_FROM_DASHBOARD,
'X-Hatchfi-Secret': SECRET_KEY_FROM_DASHBOARD,
'X-Hatchfi-User-Id': USER_ID
}
};
axios.request(options).then(function (response) {
console.log(response.data);
}).catch(function (error) {
console.error(error);
});
import requests;
url = 'https://api.hatchfi.co/v1/accounts/ACCOUNT_ID/transactions'
payload = ""
headers = {
"X-Hatchfi-Api": API_KEY_FROM_DASHBOARD,
"X-Hatchfi-Secret": SECRET_KEY_FROM_DASHBOARD,
"X-Hatchfi-User-Id": SECRET_KEY_FROM_DASHBOARD,
}
response = requests.request("GET", url, data=payload, headers=headers)
print(response.text);
import axios from "axios";
const options = {
method: 'GET',
url: 'https://api.hatchfi.co/v1/accounts/ACCOUNT_ID/transactions',
headers: {
'X-Hatchfi-Api': API_KEY_FROM_DASHBOARD,
'X-Hatchfi-Secret': SECRET_KEY_FROM_DASHBOARD,
'X-Hatchfi-User-Id': USER_ID,
'Content-Type': 'application/json'
}
};
axios.request(options).then(function (response) {
console.log(response.data);
}).catch(function (error) {
console.error(error);
});
const transactions = await hatchfi.transactions.getAll(ACCOUNT_ID);
This method will return an array of Transaction
objects from a particular user account, like in the example below:
[
{
"parts": [
{
"direction": "sent",
"ticker": "ETH",
"providerTicker": "ETH",
"amount": "0",
"fiat_value": null,
"otherParties": [
"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"
],
"resourceType": "part",
"id": "621bdfd1ab834d12b48fa02e"
}
],
"fees": [
{
"asset_is_verified": false,
"fiat_value": null,
"id": "621bdfd1ab834d12b48fa02f",
"type": "network",
"ticker": "eth",
"providerTicker": "eth",
"amount": "7152665"
}
],
"id": "621bdfd1ab834d12b48fa030",
"txId": "0x9b6d9c82cc58f374516924d186fba56ad0bafe880e1bc474ee2a0c3183c62507",
"accountId": "a2f736ae-46c0-4b96-8cf6-234e29059141",
"local_id": "0001", // selected users unique identifier
"status": "1",
"transactionType": "other",
"initiatedAt": 1645993835,
"confirmedAt": 1645993835
},
...
]
GET a single transaction from a specified user's account endpoint
This method returns the specified transaction of the selected user based on the transaction's id. Make sure to replace theACCOUNT_ID
, TRANSACTION_ID
,API_KEY_FROM_DASHBOARD
, SECRET_KEY_FROM_DASHBOARD
, and USER_ID
.
curl --request GET \
--url https://api.hatchfi.co/v1/accounts/:accountId/transactions/:transactionId \
--header 'X-Hatchfi-Api: API_KEY_FROM_DASHBOARD' \
--header 'X-Hatchfi-Secret: SECRET_KEY_FROM_DASHBOARD' \
--header 'X-Hatchfi-User-Id: USER_ID'
const axios = require("axios").default;
const options = {
method: 'GET',
url: 'https://api.hatchfi.co/v1/accounts/ACCOUNT_ID/transactions/ACCOUNT_ID',
headers: {
'X-Hatchfi-Api': API_KEY_FROM_DASHBOARD,
'X-Hatchfi-Secret': SECRET_KEY_FROM_DASHBOARD,
'X-Hatchfi-User-Id': USER_ID
}
};
axios.request(options).then(function (response) {
console.log(response.data);
}).catch(function (error) {
console.error(error);
});
import requests
url = 'https://api.hatchfi.co/v1/accounts/ACCOUNT_ID/transactions/TRANSACTION_ID'
payload = ""
headers = {
"X-Hatchfi-Api": API_KEY_FROM_DASHBOARD,
"X-Hatchfi-Secret": SECRET_KEY_FROM_DASHBOARD,
"X-Hatchfi-User-Id": USER_ID
}
response = requests.request("GET", url, data=payload, headers=headers)
print(response.text)
import axios from "axios";
const options = {
method: 'GET',
url: 'https://api.hatchfi.co/v1/accounts/ACCOUNT_ID/transactions/ACCOUNT_ID',
headers: {
'X-Hatchfi-Api': API_KEY_FROM_DASHBOARD,
'X-Hatchfi-Secret': SECRET_KEY_FROM_DASHBOARD,
'X-Hatchfi-User-Id': USER_ID
}
};
axios.request(options).then(function (response) {
console.log(response.data);
}).catch(function (error) {
console.error(error);
});
const accounts = await hatchfi.accounts.getOne(ACCOUNT_ID);
This function will return a single Transaction
object from a specified user, like in the example below:
{
"parts": [
{
"direction": "sent",
"ticker": "ETH",
"providerTicker": "ETH",
"amount": "1.23",
"fiat_value": 3244.22,
"otherParties": ["0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"],
"resourceType": "part",
"id": "621bdfd1ab834d12b48fa02e"
}
],
"fees": [
{
"asset_is_verified": false,
"fiat_value": 23.22,
"id": "621bdfd1ab834d12b48fa02f",
"type": "network",
"ticker": "eth",
"providerTicker": "eth",
"amount": "7152665"
}
],
"id": "621bdfd1ab834d12b48fa030",
"txId": "0x9b6d9c82cc58f374516924d186fba56ad0bafe880e1bc474ee2a0c3183c62507",
"accountId": "a2f736ae-46c0-4b96-8cf6-234e29059141",
"userId": "0001", // selected users unique identifier
"status": "1",
"transactionType": "other",
"initiatedAt": 1645993835,
"confirmedAt": 1645993835
}
GET all historical balances across all accounts from a specified user endpoint
This function returns the specified user's balance history across all accounts they have connected. Make sure to replace the API_KEY_FROM_DASHBOARD
, SECRET_KEY_FROM_DASHBOARD
, and USER_ID
.
ℹ️ Balance history begins when the account connection is made by the end user.
curl --request GET \
--url https://api.hatchfi.co/v1/history \
--header 'X-Hatchfi-Api: API_KEY_FROM_DASHBOARD' \
--header 'X-Hatchfi-Secret: SECRET_KEY_FROM_DASHBOARD' \
--header 'X-Hatchfi-User-Id: USER_ID'
const axios = require("axios").default;
const options = {
method: 'GET',
url: 'https://api.hatchfi.co/v1/history',
headers: {
'X-Hatchfi-Api': API_KEY_FROM_DASHBOARD,
'X-Hatchfi-Secret': SECRET_KEY_FROM_DASHBOARD,
'X-Hatchfi-User-Id': USER_ID
}
};
axios.request(options).then(function (response) {
console.log(response.data);
}).catch(function (error) {
console.error(error);
});
import requests
url = "https://api.hatchfi.co/v1/history"
payload = ""
headers = {
"X-Hatchfi-Api": API_KEY_FROM_DASHBOARD,
"X-Hatchfi-Secret": SECRET_KEY_FROM_DASHBOARD,
"X-Hatchfi-User-Id": USER_ID
}
response = requests.request("GET", url, data=payload, headers=headers)
print(response.text)
import axios from "axios";
const options = {
method: 'GET',
url: 'https://api.hatchfi.co/v1/history',
headers: {
'X-Hatchfi-Api': API_KEY_FROM_DASHBOARD,
'X-Hatchfi-Secret': SECRET_KEY_FROM_DASHBOARD,
'X-Hatchfi-User-Id': USER_ID
}
};
axios.request(options).then(function (response) {
console.log(response.data);
}).catch(function (error) {
console.error(error);
});
const history = await hatchfi.history.getHistory(ACCOUNT_ID);
This function will return an array of accounts with balances from a specified user, like in the example below:
{
"accounts": [
{
"provider": "bitcoin",
"balances": [
{
"ticker": "BTC",
"providerTicker": "BTC",
"name": "Bitcoin",
"fiatTicker": null,
"fiatValue": null,
"logo": null,
"resourceType": "balance",
"misc": [],
"_id": "625ce2750f4269001679be08",
"assetType": "account",
"amount": "2831760",
"decimals": 18
}
],
"blockchain": "bitcoin",
"resourceType": "account",
"address": "3GSJVCftwwUJ3AJKj3zKvARAPfSpT4689L",
"ticker": "BTC",
"_id": "625ce2750f4269001679be09",
"id": "1e740350-2763-4712-b602-3c7ec0f899a0"
},
{
"provider": "cardano",
"balances": [
{
"ticker": "ADA",
"providerTicker": "ADA",
"name": "Cardano",
"fiatTicker": "USD",
"fiatValue": null,
"logo": null,
"resourceType": null,
"misc": [],
"_id": "625ce5510f4269001679be65",
"assetType": "UTXO",
"amount": "3688154353",
"decimals": 6
}
],
"blockchain": "cardano",
"resourceType": "account",
"address": "addr1wxr2a8htmzuhj39y2gq7ftkpxv98y2g67tg8zezthgq4jkg0a4ul4",
"ticker": "ADA",
"_id": "625ce5510f4269001679be66",
"id": "175cae17-da41-40e9-b1d5-c53bc9740074"
},
GET NFTs for a specified account (BETA)
This endpoint is currently being improved, as of now, we support NFTs from Ethereum, Polygon, Arbitrum, and Optimism.
NFT data is automatically pulled down when a user makes a connection to one of those chains.
This method is responsible for querying NFT data from supported providers from the Hatchfi database. Make sure to replace the ACCOUNT_ID
, API_KEY_FROM_DASHBOARD
, SECRET_KEY_FROM_DASHBOARD
, and USER_ID
.
curl --request GET \
--url https://api.hatchfi.co/v1/accounts/ACCOUNT_ID/nfts \
--header 'X-Hatchfi-Api: API_KEY_FROM_DASHBOARD' \
--header 'X-Hatchfi-Secret: SECRET_KEY_FROM_DASHBOARD' \
--header 'X-Hatchfi-User-Id: USER_ID'
const axios = require("axios").default;
const options = {
method: 'GET',
url: 'https://api.hatchfi.co/v1/accounts/ACCOUNT_ID/nfts',
headers: {
'X-Hatchfi-Api': API_KEY_FROM_DASHBOARD,
'X-Hatchfi-Secret': SECRET_KEY_FROM_DASHBOARD,
'X-Hatchfi-User-Id': USER_ID
}
};
axios.request(options).then(function (response) {
console.log(response.data);
}).catch(function (error) {
console.error(error);
});
import requests
url = "https://api.hatchfi.co/v1/accounts/ACCOUNT_ID/nfts"
payload = ""
headers = {
"X-Hatchfi-Api": API_KEY_FROM_DASHBOARD,
"X-Hatchfi-Secret": SECRET_KEY_FROM_DASHBOARD,
"X-Hatchfi-User-Id": USER_ID
}
response = requests.request("GET", url, data=payload, headers=headers)
print(response.text)
import axios from "axios";
const options = {
method: 'GET',
url: 'https://api.hatchfi.co/v1/accounts/ACCOUNT_ID/nfts',
headers: {
'X-Hatchfi-Api': API_KEY_FROM_DASHBOARD,
'X-Hatchfi-Secret': SECRET_KEY_FROM_DASHBOARD,
'X-Hatchfi-User-Id': USER_ID
}
};
axios.request(options).then(function (response) {
console.log(response.data);
}).catch(function (error) {
console.error(error);
});
const nfts = await hatchfi.nfts.getAll("account-id");
Example NFT Data:
{
"_id": {
"$oid": "63604a3c441d608485c1a473"
},
"contractAddress": "0x01e093f04ed10ce76336f211da72829d182c633a",
"amount": "1",
"tokenId": "0x000000000000000000000000000000000000000000000000000000000000022f",
"imageUrl": "https://ipfs.io/ipfs/Qmc22wprhsFFNKDVCKhaYYmTAMRjJTuatFUCNVVwB14KeQ/thumbnail.jpg",
"attributes": [],
"name": "1959 ARCHIPELAGO CRUISEMASTER - #559",
"description": "When the Cruisemaster first rolled off the production line in 1959, it was the world's fastest automobile. One of only 1000 ever made. A staple in any serious car enthusiasts collection.",
"resourceType": "NFT",
"assetType": "ERC721",
"provider": "ethereum",
"accountId": "e6d28bbc-e3b9-4634-82bc-8f45c8510ef2"
}
GET sync an account endpoint
This method syncs end-users account data to retrieve the latest balance and transaction from the previous sync. Make sure to replace the ACCOUNT_ID
, API_KEY_FROM_DASHBOARD
, SECRET_KEY_FROM_DASHBOARD
, and USER_ID
.
curl --request GET \
--url https://api.hatchfi.co/v1/accounts/ACCOUNT_ID/sync \
--header 'X-Hatchfi-Api: API_KEY_FROM_DASHBOARD' \
--header 'X-Hatchfi-Secret: SECRET_KEY_FROM_DASHBOARD' \
--header 'X-Hatchfi-User-Id: USER_ID'
const axios = require("axios").default;
const options = {
method: 'GET',
url: 'https://api.hatchfi.co/v1/accounts/ACCOUNT_ID/sync',
headers: {
'X-Hatchfi-Api': API_KEY_FROM_DASHBOARD,
'X-Hatchfi-Secret': SECRET_KEY_FROM_DASHBOARD,
'X-Hatchfi-User-Id': USER_ID
}
};
axios.request(options).then(function (response) {
console.log(response.data);
}).catch(function (error) {
console.error(error);
});
import requests
url = "https://api.hatchfi.co/v1/accounts/ACCOUNT_ID/sync"
payload = ""
headers = {
"X-Hatchfi-Api": API_KEY_FROM_DASHBOARD,
"X-Hatchfi-Secret": SECRET_KEY_FROM_DASHBOARD,
"X-Hatchfi-User-Id": USER_ID
}
response = requests.request("GET", url, data=payload, headers=headers)
print(response.text)
import axios from "axios";
const options = {
method: 'GET',
url: 'https://api.hatchfi.co/v1/accounts/ACCOUNT_ID/sync',
headers: {
'X-Hatchfi-Api': API_KEY_FROM_DASHBOARD,
'X-Hatchfi-Secret': SECRET_KEY_FROM_DASHBOARD,
'X-Hatchfi-User-Id': USER_ID
}
};
axios.request(options).then(function (response) {
console.log(response.data);
}).catch(function (error) {
console.error(error);
});
await hatchfi.accounts.sync("account-id");
GET refresh a specific account endpoint
This method "refreshes," I.E., replaces all balances and transactions from a specific account, and replaces them with fresh balances and transactions. This is useful when there might be malformed or missing data within an end user's already synced account, and you'd like to completely replace the data with fresh account data.
curl --request GET \
--url https://api.hatchfi.co/v1/accounts/ACCOUNT_ID/refresh \
--header 'X-Hatchfi-Api: API_KEY_FROM_DASHBOARD' \
--header 'X-Hatchfi-Secret: SECRET_KEY_FROM_DASHBOARD' \
--header 'X-Hatchfi-User-Id: USER_ID'
const axios = require("axios").default;
const options = {
method: 'GET',
url: 'https://api.hatchfi.co/v1/accounts/ACCOUNT_ID/refresh',
headers: {
'X-Hatchfi-Api': API_KEY_FROM_DASHBOARD,
'X-Hatchfi-Secret': SECRET_KEY_FROM_DASHBOARD,
'X-Hatchfi-User-Id': USER_ID
}
};
axios.request(options).then(function (response) {
console.log(response.data);
}).catch(function (error) {
console.error(error);
});
import requests
url = "https://api.hatchfi.co/v1/accounts/ACCOUNT_ID/refresh"
payload = ""
headers = {
"X-Hatchfi-Api": API_KEY_FROM_DASHBOARD,
"X-Hatchfi-Secret": SECRET_KEY_FROM_DASHBOARD,
"X-Hatchfi-User-Id": USER_ID
}
response = requests.request("GET", url, data=payload, headers=headers)
print(response.text)
import axios from "axios";
const options = {
method: 'GET',
url: 'https://api.hatchfi.co/v1/accounts/ACCOUNT_ID/refresh',
headers: {
'X-Hatchfi-Api': API_KEY_FROM_DASHBOARD,
'X-Hatchfi-Secret': SECRET_KEY_FROM_DASHBOARD,
'X-Hatchfi-User-Id': USER_ID
}
};
axios.request(options).then(function (response) {
console.log(response.data);
}).catch(function (error) {
console.error(error);
});
await hatchfi.accounts.refresh("account-id");
A successful response will result in a status of 200
with an object with statuses. If we're unable to find data, but the request went through, we'll return a 204
📣 Do you need an endpoint that we don't have? Suggest it on our Roadmap
Updated 3 months ago