Skip to content
InternetData

Use an SDK

Install an InternetData client library, look up an address, an AS and a domain from your own code, then pass a key from an environment variable.

Each official library wraps the same API, retries a 429, caches answers and types every field. Install one:

Node.js
npm install @internetdata/internetdata

Java's Maven and Gradle coordinates are on its page.

Look an address up

No key is needed to start:

Node.js
import { InternetData } from '@internetdata/internetdata';

const client = new InternetData();

const result = await client.lookup('8.8.8.8');
console.log(result.location.country);   // US
console.log(result.company.name);       // Google LLC

An AS and a domain have their own calls:

Node.js
const asn = await client.lookupAsn(15169);
console.log(asn.name);              // Google LLC

const domain = await client.lookupDomain('example.com');
console.log(domain.isRegistered);   // true

Pass a key

A key widens the answer. Read it from the environment so it never lands in your repository:

bash
export INTERNETDATA_API_KEY="YOUR_API_KEY"
Node.js
const client = new InternetData({ apiKey: process.env.INTERNETDATA_API_KEY });

Each library's page has its own way to pass one, and the rest of what it does: batches, your plan and usage, the databases and errors.