IPASK
Articles · technical

Building a batch verification client against the IPASK API

A practical walkthrough: authentication, batching, concurrency, retries and quota accounting with real code.

2026-10-28 technical #api#nodejs#batch
Building a batch verification client against the IPASK API

The basics

POST /api/v1/verify
Authorization: Bearer <key>
content-type: application/json

{ "ips": ["45.32.11.8", "73.162.0.1"] }

Response: { count, results[], quota: { used, limit, remaining } }. Each result has ip, location, network, security.

Batch size is capped by plan (10 free, 50 Pro, 100 Studio). Duplicates are removed server-side, so dedupe locally only for vanity.

A minimal Node client

const KEY = process.env.IPASK_KEY;
const BATCH = 50;

async function verify(ips) {
  const out = [];
  for (let i = 0; i < ips.length; i += BATCH) {
    const slice = ips.slice(i, i + BATCH);
    const res = await fetch('https://ipask.net/api/v1/verify', {
      method: 'POST',
      headers: { 'content-type': 'application/json', authorization: 'Bearer ' + KEY },
      body: JSON.stringify({ ips: slice }),
    });
    if (res.status === 429) break;          // quota exhausted — stop, do not retry
    if (!res.ok) throw new Error('HTTP ' + res.status);
    const body = await res.json();
    out.push(...body.results);
  }
  return out;
}

Rules that save you pain

  1. Do not parallelise hard. Two or three concurrent batches are plenty; the server counts every address against the same daily quota anyway.
  2. Treat 429 as terminal for the day, not as a retry signal.
  3. Check /api/v1/quota before a large run, so you can stop halfway cleanly.
  4. Store first_seen from each result — it is your own signal that an address changed hands.
  5. Send a spread sample first: 20 addresses tell you whether a pool is worth verifying in full.

When to use a report instead

If the output is for a human — a supplier, a boss — create a report:POST /api/report/create returns a read-only link with a summary and a printable table. Cheaper for them to read than your JSON.

Check a batch before you buy? Check a batch →