Skip to content

Commit 9b77ed9

Browse files
committed
Add documentation for Core and Plus bundles and resproxy
1 parent 60d6124 commit 9b77ed9

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed

README.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,61 @@ console.log(ipinfo.country)
123123
// United States
124124
```
125125
126+
### Core API
127+
128+
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.
129+
130+
```typescript
131+
import { IPinfoCoreWrapper } from "node-ipinfo";
132+
133+
const ipinfoWrapper = new IPinfoCoreWrapper("MY_TOKEN");
134+
const ipinfo = await ipinfoWrapper.lookupIp("8.8.8.8");
135+
console.log(ipinfo.ip);
136+
// 8.8.8.8
137+
console.log(ipinfo.geo);
138+
// { city: 'Mountain View', region: 'California', regionCode: 'CA', country: 'United States', countryCode: 'US', ... }
139+
console.log(ipinfo.as);
140+
// { asn: 'AS15169', name: 'Google LLC', domain: 'google.com', type: 'hosting', ... }
141+
```
142+
143+
### Plus API
144+
145+
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.
146+
147+
```typescript
148+
import { IPinfoPlusWrapper } from "node-ipinfo";
149+
150+
const ipinfoWrapper = new IPinfoPlusWrapper("MY_TOKEN");
151+
const ipinfo = await ipinfoWrapper.lookupIp("8.8.8.8");
152+
console.log(ipinfo.ip);
153+
// 8.8.8.8
154+
console.log(ipinfo.geo);
155+
// { city: 'Mountain View', region: 'California', regionCode: 'CA', country: 'United States', countryCode: 'US', ... }
156+
console.log(ipinfo.mobile);
157+
// { carrier: ..., mcc: ..., mnc: ... }
158+
console.log(ipinfo.anonymous);
159+
// { isProxy: false, isRelay: false, isTor: false, ... }
160+
```
161+
162+
### Residential Proxy API
163+
164+
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.
165+
166+
```typescript
167+
import { IPinfoWrapper } from "node-ipinfo";
168+
169+
const ipinfoWrapper = new IPinfoWrapper("MY_TOKEN");
170+
const resproxy = await ipinfoWrapper.lookupResproxy("175.107.211.204");
171+
console.log(resproxy.ip);
172+
// 175.107.211.204
173+
console.log(resproxy.lastSeen);
174+
// 2025-01-20
175+
console.log(resproxy.percentDaysSeen);
176+
// 0.85
177+
console.log(resproxy.service);
178+
// Bright Data
179+
```
180+
126181
### Caching
127182
128183
This library uses an LRU cache (deletes the least-recently-used items).

0 commit comments

Comments
 (0)