CORS / JSONP

The Ipregistry API supports Cross-Origin Resource Sharing (CORS) and allows every origin by default, so a page of any website can call it from the browser. JSONP is not offered: it is deprecated and carries security risks.

Restrict a key to your websites

A key used in a browser is visible to your visitors. Restrict it to the origins of your websites, so that nobody else can spend your credits with it.

  1. Open the key In the dashboard, click API keys in the left menu, then the name of the key.
  2. List your origins Under Origins, pick Only these and enter each origin, such as https://example.com. A wildcard covers subdomains: https://*.example.com.
  3. Save Click Save changes.
The restrictions of an API key in the dashboard, with the origins https://example.com and https://*.example.com as the only ones allowed.

Do not restrict by origin a key you use from your servers. A server sends no Origin header, so its requests are refused with the HTTP status 403.

  • To block origins and allow all the others, pick All except these.
  • A key can also be restricted to IP addresses, under IP addresses. With both set, a request goes through when either its IP address or its origin is allowed.