Skip to main content

Authentication

To authenticate with the IPLocate API, you need to provide an API key.

The API key is a unique identifier that allows you to make requests to the IPLocate API. You can obtain an API key by signing up for a free account. API keys are sometimes called tokens.

Your API key should be provided with each API request. You can provide your API key in the apikey query parameter, or in the X-API-Key header.

Providing your API key as a query parameter

Provide your API key in the apikey query parameter (case-sensitive).

curl "https://iplocate.io/api/lookup/8.8.8.8?apikey=YOUR_API_KEY"

Providing your API key as a header

Provide your API key in the X-API-Key header. Headers are not case-sensitive.

curl "https://iplocate.io/api/lookup/8.8.8.8" -H "X-API-Key: YOUR_API_KEY"

Using a header is generally more secure than using a query parameter, as it is not visible in the URL, and it may not appear in server logs.

With our client libraries

All of our client libraries support passing an API key, usually as part of the constructor.

For example, with our Javascript library:

import IPLocate from 'node-iplocate';

const client = new IPLocate('YOUR_API_KEY');

const result = await client.lookup('8.8.8.8');

// ...

See our client libraries documentation for more information.