Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

60
Vistas
Handling non JSON API in Javascript

So I am trying to get a circulating supply number of a token and use the API to do a further calculation with it.

All I could find was people handling JSON outputs but this is just a plain output: https://avascan.info/api/v1/supply?q=circulatingSupply

Anyone that can help me how I can fetch this amount and use it to further do calculations with?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You can use the fetch API, which have a text method on it's response, for example:

const BASE_URL = 'https://avascan.info/api/v1/supply?q=circulatingSupply';

async function getCirculatingSupply() {
  const response = await fetch(BASE_URL);
  const data = await response.text();
  return Number(data);
}

getCirculatingSupply().then(console.log);

Keep in mind that maybe you will have problems with CORS, as I had testing this API, so maybe you will need to use a proxy server like cors-anywhere to bypass this problem.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda