Token Balance History

What is this request?

After synchronizing the wallet address, it returns the account balance values according to the given period. It also specifies the transaction analysis related to the desired period as an extra.

What can I do with this service?

You can use this service to see the dollar value of the wallet and to create analysis about it. The image below is a simple example of what you can do with this service.

Tutorial

var axios = require('axios');

axios.get('https://api.getdefy.co/v1/o/wallet/balancehistory', {
    params: {
      address: '0x787970ad122d5947579e613c2464d9540081b46f',
      language: 'en',
      period: '1w',
      key: 'API_KEY',
    },
  })
  .then(function (response) {
    console.log(JSON.stringify(response.data));
  })
  .catch(function (error) {
    console.log(error);
  });

After synchronized wallet you want to use you can test it like this.

Options

  • address (required): A user address (i.e. 0x1a2b3x...). If specified, the user attached to the query is ignored and the address will be used instead.

  • key (required): API key for requests.

  • language (optional): Service language. Default value is en. Can be en or tr.

  • period (optional): Data period. Default value is 24h. Can be: "24h", "1w", "1mo"

Request Example

GET https://api.getdefy.co/v1/o/wallet/balanchehistory

Query Parameters

{
  "result": {
    "message": "OK",
    "code": 0
  },
  "data": {
    "items": [
      {
        "time": "2022-12-24T13:00:00.398Z",
        "total": 2.1121193621891585
      },
      {
        "time": "2022-12-24T14:00:00.721Z",
        "total": 2.110011182174752
      },
      {
        "time": "2022-12-24T15:00:00.033Z",
        "total": 2.1121193621891585
      }
    ],
    "analyze": {
      "profit": -0.0000018239983456957987,
      "percent": -0.000086358677371589,
      "txCount": 0,
      "total_buy": 0,
      "total_sell": 0
    }
  }
}

Last updated