[solved] Token Price API NOT WORKING

Why i cant fetch any prices anymore ??? third time an issue using moralis this week with the price api. Is this something that will continue, or whats going on??? CANT RUN MY APP WITH THIS ISSUE CONTINOUSLY ARISING.

import Moralis from 'moralis';

try {
  await Moralis.start({
    apiKey: "YOUR_API_KEY"
  });

  const response = await Moralis.EvmApi.token.getTokenPrice({
    "exchange": "uniswap-v2",
    "address": "0xfe8546f4ac4180638edbc9ef9a5820450788e2ea"
  });

  console.log(response.raw);
} catch (e) {
  console.error(e);
}

{
“message”: “Cannot read properties of null (reading ‘toString’)”
}

You still have issues now?

yes, now its not picking up the tokens it used to on uniswap V2, some are starting to be picked up on uniswap-V3, is this an update happening, migration, or how should i deal with this?

we did some updates in the recent day, if you see issues you can write here

can you give examples of requests that don’t work as expected?

we are checking now this particular case that you posted in the original thread

import Moralis from 'moralis';

try {
  await Moralis.start({
    apiKey: "YOUR_API_KEY"
  });

  const response = await Moralis.EvmApi.token.getTokenPrice({
    "exchange": "uniswap-v2",
    "address": "0x64d5ea3e86ac6e82d15d796d18d7cc33a50ec5a4"
  });

  console.log(response.raw);
} catch (e) {
  console.error(e);
}
{
  "message": "Cannot read properties of null (reading 'toString')"
}

can you check if this works for uniswapv2 ?

but before this token and the one before were working on uniswap-v2, not sure what happened, but today no prices are being picked up for me, neither on uniswapv2 nor uniswap-v2

we will check, we should have a fix soon for this issue

it should be fixed now, if you still have issues you can post here

1 Like

you are amazing, thank you so much

2 Likes