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

223
Views
Obteniendo datos en next.js devolviendo indefinido

Estoy tratando de obtener datos de esta API https://rapidapi.com/apidojo/api/shazam usando next.js pero no estoy definido y no sé cuál es el problema, aquí hay un fragmento de la código, estaría muy contento si alguien pudiera ayudarme a entender lo que estoy haciendo mal.

 export async function getServerSideProps(context) { const res = await fetch( 'https://shazam.p.rapidapi.com/charts/track?locale=en-US&pageSize=20&startFrom=0', { method: 'GET', headers: { 'x-rapidapi-host': 'shazam.p.rapidapi.com', 'x-rapidapi-key': 'my_key', }, }, ); const data = await res.json(); if (!data) { return { notFound: true, }; } return { props: { data: data, }, }; }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Pruebe este fragmento de código. Le proporcionará una mejor perspectiva y arrojará algunos errores, si los hay.

 fetch("https://shazam.p.rapidapi.com/charts/track?locale=en-US&pageSize=20&startFrom=0", { "method": "GET", "headers": { "x-rapidapi-host": "shazam.p.rapidapi.com", "x-rapidapi-key": "*****" } }) .then(response => { console.log(response); }) .catch(err => { console.error(err); });
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!