adrianhajdin / project_ai_summarizer

https://jsmastery.pro
512 stars 141 forks source link

How to fix GET request 403 #6

Open XinleiSherry opened 1 year ago

XinleiSherry commented 1 year ago

Anyone can tell me why this happens? My API key is correct, limits are not used up.

image
ga0m1ng74 commented 1 year ago

you need to check the file article.js, make sure rapidApiKey is correct.

const rapidApiKey = import.meta.env.VITE_RAPID_API_ARTICLE_KEY

prepareHeaders:(headers)=>{ headers.set('X-RapidAPI-Key',rapidApiKey); headers.set('X-RapidAPI-Host','article-extractor-and-summarizer.p.rapidapi.com'); return headers; }

XinleiSherry commented 1 year ago

Thanks, @ga0m1ng74 ! I double-checked my article.js, but still got the same 403 error. Can you take a look at my GitHub to see whether the code is correct? Thanks a lot!

image
GuyTdev commented 1 year ago

make sure that your .env file is found at the package.json directory level (not inside the src folder)

parth2181 commented 1 year ago

Anyone can tell me why this happens? My API key is correct, limits are not used up. image

Getting Same Error But problem solved as .env file was not in proper Directory

ArtHalimi7 commented 1 year ago

Hello, which directory did you put the .env file, because I am having the same issue, even though the .env file is located in the root of the project. My API key and everything is all correct.

parth2181 commented 1 year ago

My problem was fixed when i put .env in root directory, try to delete it and again do all the process and import .env file properly

ArtHalimi7 commented 1 year ago

I tried that too but no luck :D Thanks for your time

ArtHalimi7 commented 1 year ago

Did you also change anything when you wrote VITE_RAPID_API_ARTICLE_KEY= like brackets or ; or anything really, because when I add them the page doesn't work at all

Ankitkr2021 commented 1 year ago

The API is not currently operational. It's possible that the service itself is down. You can try accessing the URL in a web browser to see if it returns a response.

kapilsinghnegi commented 1 year ago

put .env file in the root directory

Gunawardhane commented 9 months ago

make sure that your .env file is found at the package.json directory level (not inside the src folder)

get the data fetching error and this is the solution after 1 hour searching. <3