Many modern web APIs allow Domain Resource Sharing (CORS). CORS is a website method that voluntarily makes its pages available for cross-domain scripts. Access-Control-Allow-Origin HTTP header from the server signals to your web browser that you can allow the script to access the page using Ajax, even if the script runs on a different origin. If the server does not serve CORS headers, your browser will force SOP, as usual.
Most APIs prefer to host their pages in cross-domain scripts because they know that almost all of their users will want to access the API through Ajax from their own domains.
source share