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

105
Views
axios get request endpoint issue

I signed up for a API key, however, I can not figure out how to get it to work into the JS file with axios.. this is that the website gives me.


Code Snippets
Example Responses
Results
const axios = require("axios");

const options = {
  method: 'GET',
  url: 'https://car-data.p.rapidapi.com/cars/types',   <---------
  headers: {
    'X-RapidAPI-Key': '*******************************',
    'X-RapidAPI-Host': 'car-data.p.rapidapi.com'
  }
};
--------------------------------------------------------------

and this is what I put in... the JS file..

const car = document.querySelector('#search-input')
    const response = await axios.get(
  'https://cardata.p.rapidapi.com/cars/types${car.value}&api_key=${API_KEY}')

**API_KEY set to a variable and so is car.value

What am I doing wrong?

about 4 years ago · Juan Pablo Isaza
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!