Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

175
Views
How to fetch data from multiple API's at the same time - that require a different seaarch prase

I'm making an app that fetches data from 2 different APIs at the same time based on the user's search.

The app is supposed to fetch current crypto prices and historical data. But the APIs use 2 different formats for the symbol, like so:

1.

  • BTC-USD (yahoo.com/BTC-USD)
  • BITCOIN (coingecko.com/api/BITCOIN)

if someone looks up 'BITCOIN' it's only going to pull up data from 1 API, because the other 1 requires 'BTC-USD'

2.

  • ETH-USD (yahoo.com/ETH-USD)
  • ETHEREUM coingecko.com/api/ETHEREUM

Is it possible to somehow fetch data from both APIs at the same time-based?

I guess I could see some solutions (hardcoding the data, or switching APIs so they use the same format), altho this path seems pretty work-intensive.

Any ideas on how this can be done?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Use Promise.all if you want fetch data from 2 different API's at the sane time:

const fetchData = async (yahoo_API_URL, coingecko_API_URL) => {
    const fetchYahoo = fetch(yahoo_API_URL, /* config */)
    const fetchCoingecko = fetch(coingecko_API_URL, /* config */)
    const [fetchYahooRes, fetchCoingeckoRes] = await Promise.all([fetchYahoo, fetchCoingecko])
    const [cryptoPriceFromYahoo, cryptoPriceFromCoingecko] = await Promise.all([fetchYahooRes.json(), fetchCoingeckoRes.json()])
    ...
  }

  fetchData('yahoo.com/BTC-USD', 'coingecko.com/api/BITCOIN')
  fetchData('yahoo.com/ETH-USD', 'coingecko.com/api/ETHEREUM')
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!