Yes you can. Just add the
rest_route query parameter.
https://wordpress.org/wp-json/wp/v2/ would become
https://wordpress.org/?rest_route=/wp/v2 to give you a more complete example.
So you're wondering how to decide which one to use? Worry no more, there's a function for that:
Another option is the fact that by default there is a
<link> in the header that gives you the API root.
<link rel='https://api.w.org/' href='https://wordpress.org/wp-json/' />
So in case you need to figure that out from client side JS just use something along the lines of
So basically you shouldn't take the
wp-json part as given (and hardcode it) but always build it dynamically either using
get_rest_url() or the JS approach mentioned above.