Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

254
Visualizações
CORS header 'Access-Control-Allow-Origin' missing Error

I am currently building a dashboard for chrome. I am trying to display coin prices on the dashboard by getting the information through coin gecko’s API. I get this error when I run my code "Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://api.coingecko.com/api/v3/coins/dogecoin. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).", and get the same error when I try to execute on the coin gecko API V3 site.

This is my code:

fetch("https://api.coingecko.com/api/v3/coins/dogecoin") .then(response => response.json()) .then(data =>console.log(data)) .catch(err => console.log(err))

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

For such requests to work in JavaScript, the server on their end needs to allow them.

This is done by their server sending special CORS headers, the most basic one being the "Access-Control-Allow-Origin" header.

I guess the API provider has not foreseen or planned for this API to be used from a frontend (e.g. JavaScript in the browser), so you would have to work around this.

One way is to set up your own server and have the JavaScript code make a request to your server and your server then making a request to the API, as server side code is not bound to CORS headers set Header('Access-Control-Allow-Origin','*')

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda