From 9b77ed9ee8f44d2f7a84326a01ac554ef2cb92b8 Mon Sep 17 00:00:00 2001 From: Silvano Cerza Date: Fri, 23 Jan 2026 17:35:45 +0100 Subject: [PATCH] Add documentation for Core and Plus bundles and resproxy --- README.md | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/README.md b/README.md index ec76537..4dddcfd 100644 --- a/README.md +++ b/README.md @@ -123,6 +123,61 @@ console.log(ipinfo.country) // United States ``` +### Core API + +The library also supports the [Core API](https://ipinfo.io/developers/data-types#core-data), which provides city-level geolocation with nested geo and AS objects. Authentication with your token is required. + +```typescript +import { IPinfoCoreWrapper } from "node-ipinfo"; + +const ipinfoWrapper = new IPinfoCoreWrapper("MY_TOKEN"); +const ipinfo = await ipinfoWrapper.lookupIp("8.8.8.8"); +console.log(ipinfo.ip); +// 8.8.8.8 +console.log(ipinfo.geo); +// { city: 'Mountain View', region: 'California', regionCode: 'CA', country: 'United States', countryCode: 'US', ... } +console.log(ipinfo.as); +// { asn: 'AS15169', name: 'Google LLC', domain: 'google.com', type: 'hosting', ... } +``` + +### Plus API + +The library also supports the [Plus API](https://ipinfo.io/developers/data-types#plus-data), which provides enhanced data including mobile carrier info and privacy detection. Authentication with your token is required. + +```typescript +import { IPinfoPlusWrapper } from "node-ipinfo"; + +const ipinfoWrapper = new IPinfoPlusWrapper("MY_TOKEN"); +const ipinfo = await ipinfoWrapper.lookupIp("8.8.8.8"); +console.log(ipinfo.ip); +// 8.8.8.8 +console.log(ipinfo.geo); +// { city: 'Mountain View', region: 'California', regionCode: 'CA', country: 'United States', countryCode: 'US', ... } +console.log(ipinfo.mobile); +// { carrier: ..., mcc: ..., mnc: ... } +console.log(ipinfo.anonymous); +// { isProxy: false, isRelay: false, isTor: false, ... } +``` + +### Residential Proxy API + +The library also supports the [Residential Proxy API](https://ipinfo.io/developers/residential-proxy-api), which allows you to check if an IP address is a residential proxy. Authentication with your token is required. + +```typescript +import { IPinfoWrapper } from "node-ipinfo"; + +const ipinfoWrapper = new IPinfoWrapper("MY_TOKEN"); +const resproxy = await ipinfoWrapper.lookupResproxy("175.107.211.204"); +console.log(resproxy.ip); +// 175.107.211.204 +console.log(resproxy.lastSeen); +// 2025-01-20 +console.log(resproxy.percentDaysSeen); +// 0.85 +console.log(resproxy.service); +// Bright Data +``` + ### Caching This library uses an LRU cache (deletes the least-recently-used items).