Clash Royale API with Axios
Hello everyone, I tried using the ClashRoyaleAPI with node.js but it doesn’t work cause there’s and error 403 forbidden. I know that it means that I don’t have permission to access the data, but it should be because my token is correct. So am I missing something in my code?
Hey! So I was a bit confused as to why this wasn't working when I saw it. I checked the Clash Royale API and got a key, and I believe the issue is that it requires you to register a static IP address for the key. I did some searching and found there is a 3rd party service that can and will serve as a proxy for your requests.
The proxy URL is proxy.royaleapi.dev - and the static IP you should use when you get a key is 22.214.171.124
Should work on Replit if you use this method!
Edit for clarification: Your code is correct, as it is making the request- the reason you need to use the proxy url is because Repls will occasionally shift between machines, meaning the whole static IP requirement becomes an issue. I tested this method before posting this, and it worked perfectly :)