Official iplookupapi SDKs

Updated

Short answer

iplookupapi has official SDKs for JavaScript (npm), Python (PyPI), PHP (Packagist), Ruby (RubyGems), C# (NuGet), Rust (crates.io) and R (CRAN). Each wraps the same REST API: look up one IP or the caller’s own IP and check your quota, with your API key from an environment variable. For batches of up to 1,000 IPs, the language guides show the plain HTTP request.

Every SDK calls the same API with the same parameters, so the API documentation applies to all of them. Pick your language for install steps, examples and framework recipes:

All SDKs

LanguagePackageInstall
JavaScript / TypeScript@everapi/iplookupapi-jsnpm install @everapi/iplookupapi-js
Pythoniplookupapipip install iplookupapi
PHPeverapi/iplookupapi-phpcomposer require everapi/iplookupapi-php
Rubyiplookupapigem install iplookupapi
C# / .NETiplookupapidotnet add package iplookupapi
Rustiplookupapi-rscargo add iplookupapi-rs
Riplookupapiinstall.packages("iplookupapi")

Version 1.0.0 of the npm package stops on import with ReferenceError: Iplookupapi is not defined, so the JavaScript guide uses a small fetch client instead.

Before you start

  1. Create a free account and copy your API key from the dashboard.
  2. Store it as an environment variable, for example export IPLOOKUPAPI_KEY=..., and read it from there in your code.
  3. Make the call from your server. If your app runs behind a proxy or CDN, read how to get the real client IP first, or you will look up the proxy’s address.

Any language without an SDK can use the REST API directly:

Shell
curl "https://api.iplookupapi.com/v1/info?ip=8.8.8.8" \
  -H "apikey: $IPLOOKUPAPI_KEY"

Frequently asked questions

Do I need an SDK to use iplookupapi?

No. The API is plain HTTPS and JSON, so any HTTP client works: send GET https://api.iplookupapi.com/v1/info?ip=<address> with your key in the apikey header. The SDKs save you the request code, add types where the language has them and keep the calls consistent.

Where do I put the API key?

In an environment variable on your server, for example IPLOOKUPAPI_KEY, and read it from there. Never put the key into browser or mobile app code, where anyone can read it.

Do the SDKs support batch lookups?

Not yet: the SDKs wrap the single lookup and the status endpoint. The batch endpoint takes 1 to 1,000 addresses in one POST request, and the language guides below show that request with a plain HTTP client. See also the batch IP lookup API.

Is there a free plan for testing the SDKs?

Yes. The free plan includes 150 requests a month at up to 10 requests a minute, enough to try every SDK. Paid plans start at $9.99 a month; see pricing.