AxiosError: getaddrinfo ENOTFOUND openapi.debank.com

94 views Asked by At

I have installed debank-open-api with the ninth command and while running this code in the index.js file I am getting this error.

I have installed debank-open-api with the ninth command-

npm install debank-open-api --save

and while running this code -

var DeBankOpenApi = require('debank-open-api');
var api = new DeBankOpenApi.ChainApi()
api.getChainList().then(function(response) {
    console.log('API called successfully. Returned data: ' + 
    response.data);
    function(error) {
    console.error(error);
      });

In the index.js file I am getting this error.

error -     
node index.js                     
AxiosError:** getaddrinfo ENOTFOUND openapi.debank.com**  
at GetAddrInfoReqWrap.onlookupall [as oncomplete] (node:dns:118:26) {
hostname: 'openapi.debank.com',
syscall: 'getaddrinfo',
code: 'ENOTFOUND',
errno: -3007,
config: {
transitional: {
silentJSONParsing: true,
forcedJSONParsing: true,
clarifyTimeoutError: false
    },
adapter: [Function: httpAdapter],
transformRequest: [ [Function: transformRequest] ],
transformResponse: [ [Function: transformResponse] ],
timeout: 0,
xsrfCookieName: 'XSRF-TOKEN',
xsrfHeaderName: 'X-XSRF-TOKEN',
maxContentLength: -1,
maxBodyLength: -1,
env: { FormData: [Function] },
validateStatus: [Function: validateStatus],
headers: {
Accept: 'application/json, text/plain, */*',
      'User-Agent': 'axios/0.27.2'
    },
method: 'get',
url: 'https://openapi.debank.com/v1/chain/list',
data: undefined
  },
  }
}    
1

There are 1 answers

2
AKX On

That error means the domain name openapi.debank.com doesn't resolve.

It doesn't resolve for me either, so presumably it's wrong.

The documentation refers to a https://pro-openapi.debank.com/ URL, which does resolve, so I'd wager the debank-open-api project you're trying to use is out of date.