Hello everyone, I am writing to you because I am having problems putting an API created with wix on RAPID API into production.
I explain quickly:
- I created the "http-function.js" file
- I wrote my api :
export async function get_emotion(request) {
const response = {
"headers": {"Content-Type": "application/json"
}
};
try {
const prompt = request.query["text"];
//make the magic with AI
response.body = prompt;
return ok(response);
} catch (err) {
response.body = {
"error": err. message
};
return badRequest(response);
}
}
- I published the site
- And wow my API WORKS WONDERFUL
If you want to try it and play it to test that it works without problems: https://intelligenzaartificialeitalia .net/_functions/emotion?text=i%20love%20you
the endpoint :
https://intelligenzaartificialeitalia .net/_functions/emotion
add ?text= your text to analyze emotion sentiment of text
Now comes my problem. I had decided (since about 30 of these AI model Inference based APIs) to monetize my APIs on RAPIDAPI.
I configure the endpoint correctly and here's the bad news, it seems that the wix servers don't like calls from RapidApi and in most of the times I don't know which of the two servers returns 503 error.
If you try to click this link: ( https://rapidapi .com/IntelligenzaArtificiale/api/ai-text-emotion-detection ) and try the endpoint you will see that sometimes it works and sometimes it doesn't but it seems impossible to understand why.
https://rapidapi .com/IntelligenzaArtificiale/api/ai-text-emotion-detection
If anyone is interested in trying, even using FREE wix that allows it, refer to these guides:
- https://www.wix .com/velo/reference/getting-started/expose-an-api
- https://www.wix .com/velo/reference/getting-started/give&get-example---exposing-an-api
I hope you can help me, also because it would be very interesting to offer wix users another way to monetize their sites. If we figure out what's wrong, anyone can easily monetize their APIs using wix as hosting. PLEASE HELP ME!
RapidAPI also supports API key rotation for security purposes. You can also use API key rotation to reset a compromised or inadvertently exposed API key without. DNA HRBlock Login
I tried to simulate your situation on my site for free, exposing a "hello word" api on rapid api. Actually you are right in the test environment from error 429 and in production about 70% of the time this error 503.
It would be interesting to understand if that error 503 is from the RapidAPI server or the WIX servers. Anyway I didn't know rapidpi looks great for monetizing your own wix site apis.
Hello and thank you for sharing your problem. A few months ago I also tried to upload my APIs created with your same method on RAPIDAPI and I too had the same problem as you. Let's hope there is a solution.
In any case, congratulations for the API it is very interesting and I managed to make it work very well both on the browser and on PostMan but I remember that my APIs also worked very well, the problem is when you connect them to RAPIDAPI it gives strange errors.