Just do not put API Key to your .env file. Use it main file it will work.
in fectFromAPI.js file
'X-RapidAPI-Key': 'PasteYourAPIKey',
Thank you man you have solved my problem
from javascript mastery youtube 2.0 the channel data is not showing only videos are fetched from the api
Thank You man! Youre issued my problem
i have done it in single quotes yet getting an 404 error import axios from “axios”; const BASE_URL = "https://youtube-v31.p.rapidapi.com/search" const options = { method: ‘GET’,
params: { maxResults: '50' }, headers: { 'X-RapidAPI-Key':' ', 'X-RapidAPI-Host': 'youtube-v31.p.rapidapi.com' }
} export const fetchFromAPI = async(url)=>{ const {data}= await axios.get(${BASE_URL}/${url},options); return data }
${BASE_URL}/${url}
still not working, kindly help with any other solution
Thank you for your inputs.
加入讨论 - 在下面添加评论:
Thank you man you have solved my problem
from javascript mastery youtube 2.0 the channel data is not showing only videos are fetched from the api
Thank You man! Youre issued my problem
i have done it in single quotes yet getting an 404 error
import axios from “axios”;
const BASE_URL = "https://youtube-v31.p.rapidapi.com/search"
const options = {
method: ‘GET’,
}
export const fetchFromAPI = async(url)=>{
const {data}= await axios.get(
${BASE_URL}/${url}
,options);return data
}
still not working, kindly help with any other solution
Thank you for your inputs.