, `chmod +x` as well if you want to run it without `php` command, or use it in your custom project.

Get Alexa Site Rank with JavaScript:

You can do this in the front-end as well, the only very first challenge you’ll meet is the SAMEORIGIN policy which will prevent you from making XHR requests to the Alexa API. You can get over this by using combining either Python or PHP solutions above to create a server-side API response from your domain and then have access to it, or just use CORS-anywhere project as a proxy.

Here’s the full JS code, which is in native JS which means it could be wrapped in jQuery or any other library: