JSONP / CORS

JSONP is deprecated since years. You should no longer rely on this method to make cross-domain requests. Ipregistry supports Cross-Origin Resource Sharing (CORS), a modern alternative that is widely supported by browsers, saner and cleaner.

By default, the Ipregistry API allows all origins for CORS.

Filtering Origins by API key

You can filter origins, and control what API key is allowed to call the Ipregistry API, directly from the Ipregistry dashboard:

  1. Open your dashboard.
  2. Click on "API Keys" in the left menu.
  3. Click on "Edit" for the key you want to filter origins.
  4. In the "Origins" section, select "Filter by origins" for the dropdown option.
  5. Enter the URL prefix of the origins that are allowed:

    Filtering Origins by API key

  6. Save your changes.
CORS and origin filtering is made to protect your API keys from undesired usages. It should be used when you expose your API key publicly and perform requests to the Ipregistry API from the client-side (e.g. a Web app). If you make requests from the server-side, then your API key is secret. In that case, origin filtering must NOT be enabled or requests will fail with a Forbidden status.
The Ipregistry API also supports restricting usage of API keys by IP addresses. Follow the same as above in the "IP Addresses" section on your dashboard. Read more.

CORS support with IE8/IE9

Fetching data asynchronously with JavaScript from another domain in IE8 and 9 is only possible with XDomainRequest. You should also note that XDomainRequest will not let you make a request to our HTTPS API from a HTTP page: your origin page must use HTTPS.