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?