Getting addresses from 1inch API

I can’t get addresses from top 10 coins from 1Inch API?
I can’t recognize what is wrong?

API_URL = ''
API_URL1 = ''
    let response = await fetch(API_URL);
    let data = await response.json();
    let listItems = data.filter(token => token.rank <= 10 && token.rank >= 1).map(token => token.symbol);

async function getAddresses(tickerList){
    let response1 = await fetch(API_URL1)
    let tokens = await response1.json()
    let addrs = Object.values(tokens.tokens)
    //let top10 = tokens.filter(token => token.address  ).map(token => token.symbol);
    //console.log("addrs", addrs)
    return addrs.filter(token => tickerList.includes(token.symbol))


Got this error:

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'includes')
    at Coinpaprika.js:34:45
    at Array.filter (<anonymous>)
    at getAddresses (Coinpaprika.js:34:18)

It would be easier if you can create a github repo for your project, that way i can replicate your issue easily :nerd_face:

Carlos Z

Here is my github repo:

1 Like

Your code works perfectly from my side.

You can also check it here, i just copy/paste your code.

Carlos Z