Skip to content

Commit af04eeb

Browse files
committed
Update documentation to mention support of CPN and EPN in PX11+
1 parent 84215eb commit af04eeb

File tree

3 files changed

+8
-187
lines changed

3 files changed

+8
-187
lines changed

README.md

Lines changed: 5 additions & 184 deletions
Original file line numberDiff line numberDiff line change
@@ -3,195 +3,14 @@
33

44
# IP2Proxy Node.js Module
55

6-
This module allows user to query an IP address if it was being used as VPN anonymizer, open proxies, web proxies, Tor exits, data center, web hosting (DCH) range, search engine robots (SES) and residential (RES). It lookup the proxy IP address from **IP2Proxy BIN Data** file. This data file can be downloaded at
6+
This module allows user to query an IP address if it was being used as VPN anonymizer, open proxies, web proxies, Tor exits, data center, web hosting (DCH) range, search engine robots (SES), residential proxies (RES), consumer privacy networks (CPN), and enterprise private networks (EPN). It lookup the proxy IP address from **IP2Proxy BIN Data** file. This data file can be downloaded at
77

88
* Free IP2Proxy BIN Data: https://lite.ip2location.com
99
* Commercial IP2Proxy BIN Data: https://www.ip2location.com/database/ip2proxy
1010

11-
As an alternative, this module can also call the IP2Proxy Web Service. This requires an API key. If you don't have an existing API key, you can subscribe for one at the below:
11+
# Developer Documentation
12+
To learn more about installation, usage, and code examples, please visit the developer documentation at [https://ip2proxy-nodejs.readthedocs.io/en/latest/index.html.](https://ip2proxy-nodejs.readthedocs.io/en/latest/index.html)
1213

13-
https://www.ip2location.com/web-service/ip2proxy
14-
15-
## Installation
16-
17-
To install this module type the following:
18-
19-
```bash
20-
21-
npm install ip2proxy-nodejs
22-
23-
```
24-
25-
## QUERY USING THE BIN FILE
26-
27-
## Methods
28-
Below are the methods supported in this class.
29-
30-
|Method Name|Description|
31-
|---|---|
32-
|open|Open the IP2Proxy BIN data for lookup.|
33-
|openAsync|Open the IP2Proxy BIN data for lookup asynchronously.|
34-
|close|Close and clean up the file pointer.|
35-
|getPackageVersion|Get the package version (1 to 11 for PX1 to PX11 respectively).|
36-
|getModuleVersion|Get the module version.|
37-
|getDatabaseVersion|Get the database version.|
38-
|isProxy|Check whether if an IP address was a proxy. Returned value:<ul><li>-1 : errors</li><li>0 : not a proxy</li><li>1 : a proxy</li><li>2 : a data center IP address or search engine robot</li></ul>|
39-
|isProxyAsync|Check whether if an IP address was a proxy asynchronously. Returned value:<ul><li>-1 : errors</li><li>0 : not a proxy</li><li>1 : a proxy</li><li>2 : a data center IP address or search engine robot</li></ul>|
40-
|getAll|Return the proxy information in an object.|
41-
|getAllAsync|Return the proxy information in an object asynchronously.|
42-
|getProxyType|Return the proxy type. Please visit <a href="https://www.ip2location.com/database/px10-ip-proxytype-country-region-city-isp-domain-usagetype-asn-lastseen-threat-residential" target="_blank">IP2Location</a> for the list of proxy types supported|
43-
|getProxyTypeAsync|Return the proxy type asynchronously. Please visit <a href="https://www.ip2location.com/database/px10-ip-proxytype-country-region-city-isp-domain-usagetype-asn-lastseen-threat-residential" target="_blank">IP2Location</a> for the list of proxy types supported|
44-
|getCountryShort|Return the ISO3166-1 country code (2-digits) of the proxy.|
45-
|getCountryShortAsync|Return the ISO3166-1 country code (2-digits) of the proxy asynchronously.|
46-
|getCountryLong|Return the ISO3166-1 country name of the proxy.|
47-
|getCountryLongAsync|Return the ISO3166-1 country name of the proxy asynchronously.|
48-
|getRegion|Return the ISO3166-2 region name of the proxy. Please visit <a href="https://www.ip2location.com/free/iso3166-2" target="_blank">ISO3166-2 Subdivision Code</a> for the information of ISO3166-2 supported|
49-
|getRegionAsync|Return the ISO3166-2 region name of the proxy asynchronously. Please visit <a href="https://www.ip2location.com/free/iso3166-2" target="_blank">ISO3166-2 Subdivision Code</a> for the information of ISO3166-2 supported|
50-
|getCity|Return the city name of the proxy.|
51-
|getCityAsync|Return the city name of the proxy asynchronously.|
52-
|getISP|Return the ISP name of the proxy.|
53-
|getISPAsync|Return the ISP name of the proxy asynchronously.|
54-
|getDomain|Return the domain name of the proxy.|
55-
|getDomainAsync|Return the domain name of the proxy asynchronously.|
56-
|getUsageType|Return the usage type classification of the proxy. Please visit <a href="https://www.ip2location.com/database/px10-ip-proxytype-country-region-city-isp-domain-usagetype-asn-lastseen-threat-residential" target="_blank">IP2Location</a> for the list of usage types supported.|
57-
|getUsageTypeAsync|Return the usage type classification of the proxy asynchronously. Please visit <a href="https://www.ip2location.com/database/px10-ip-proxytype-country-region-city-isp-domain-usagetype-asn-lastseen-threat-residential" target="_blank">IP2Location</a> for the list of usage types supported.|
58-
|getASN|Return the autonomous system number of the proxy.|
59-
|getASNAsync|Return the autonomous system number of the proxy asynchronously.|
60-
|getAS|Return the autonomous system name of the proxy.|
61-
|getASAsync|Return the autonomous system name of the proxy asynchronously.|
62-
|getLastSeen|Return the number of days that the proxy was last seen.|
63-
|getLastSeenAsync|Return the number of days that the proxy was last seen asynchronously.|
64-
|getThreat|Return the threat type of the proxy.|
65-
|getThreatAsync|Return the threat type of the proxy asynchronously.|
66-
|getProvider|Return the provider of the proxy.|
67-
|getProviderAsync|Return the provider of the proxy asynchronously.|
68-
69-
## Usage
70-
71-
```javascript
72-
const {IP2Proxy} = require("ip2proxy-nodejs");
73-
74-
let ip2proxy = new IP2Proxy();
75-
76-
if (ip2proxy.open("./IP2PROXY-IP-PROXYTYPE-COUNTRY-REGION-CITY-ISP-DOMAIN-USAGETYPE-ASN-LASTSEEN-THREAT-RESIDENTIAL-PROVIDER.BIN") == 0) {
77-
ip = '199.83.103.79';
78-
79-
console.log("GetModuleVersion: " + ip2proxy.getModuleVersion());
80-
console.log("GetPackageVersion: " + ip2proxy.getPackageVersion());
81-
console.log("GetDatabaseVersion: " + ip2proxy.getDatabaseVersion());
82-
83-
// functions for individual fields
84-
console.log("isProxy: " + ip2proxy.isProxy(ip));
85-
console.log("ProxyType: " + ip2proxy.getProxyType(ip));
86-
console.log("CountryShort: " + ip2proxy.getCountryShort(ip));
87-
console.log("CountryLong: " + ip2proxy.getCountryLong(ip));
88-
console.log("Region: " + ip2proxy.getRegion(ip));
89-
console.log("City: " + ip2proxy.getCity(ip));
90-
console.log("ISP: " + ip2proxy.getISP(ip));
91-
console.log("Domain: " + ip2proxy.getDomain(ip));
92-
console.log("UsageType: " + ip2proxy.getUsageType(ip));
93-
console.log("ASN: " + ip2proxy.getASN(ip));
94-
console.log("AS: " + ip2proxy.getAS(ip));
95-
console.log("LastSeen: " + ip2proxy.getLastSeen(ip));
96-
console.log("Threat: " + ip2proxy.getThreat(ip));
97-
console.log("Provider: " + ip2proxy.getProvider(ip));
98-
99-
// function for all fields
100-
let all = ip2proxy.getAll(ip);
101-
console.log("isProxy: " + all.isProxy);
102-
console.log("proxyType: " + all.proxyType);
103-
console.log("countryShort: " + all.countryShort);
104-
console.log("countryLong: " + all.countryLong);
105-
console.log("region: " + all.region);
106-
console.log("city: " + all.city);
107-
console.log("isp: " + all.isp);
108-
console.log("domain: " + all.domain);
109-
console.log("usagetype: " + all.usageType);
110-
console.log("asn: " + all.asn);
111-
console.log("as: " + all.as);
112-
console.log("lastSeen: " + all.lastSeen);
113-
console.log("threat: " + all.threat);
114-
console.log("provider: " + all.provider);
115-
}
116-
else {
117-
console.log("Error reading BIN file.");
118-
}
119-
ip2proxy.close();
120-
121-
```
122-
123-
## Asynchronous Usage
124-
125-
```javascript
126-
const {IP2Proxy} = require("ip2proxy-nodejs");
127-
128-
let ip2proxy = new IP2Proxy();
129-
130-
ip2proxy.openAsync("./IP2PROXY-IP-PROXYTYPE-COUNTRY-REGION-CITY-ISP-DOMAIN-USAGETYPE-ASN-LASTSEEN-THREAT-RESIDENTIAL-PROVIDER.BIN").then((status) => {
131-
if (status == 0) {
132-
ip = '199.83.103.79';
133-
ip2proxy.getAllAsync(ip).then(all => {
134-
console.log("isProxy: " + all.isProxy);
135-
console.log("proxyType: " + all.proxyType);
136-
console.log("countryShort: " + all.countryShort);
137-
console.log("countryLong: " + all.countryLong);
138-
console.log("region: " + all.region);
139-
console.log("city: " + all.city);
140-
console.log("isp: " + all.isp);
141-
console.log("domain: " + all.domain);
142-
console.log("usagetype: " + all.usageType);
143-
console.log("asn: " + all.asn);
144-
console.log("as: " + all.as);
145-
console.log("lastSeen: " + all.lastSeen);
146-
console.log("threat: " + all.threat);
147-
console.log("provider: " + all.provider);
148-
});
149-
}
150-
else {
151-
console.log("Error reading BIN.");
152-
}
153-
});
154-
155-
```
156-
157-
## QUERY USING THE IP2PROXY PROXY DETECTION WEB SERVICE
158-
159-
## Methods
160-
Below are the methods supported in this class.
161-
162-
|Method Name|Description|
163-
|---|---|
164-
|open(apiKey, apiPackage, useSSL = true)| Expects 2 or 3 input parameters:<ol><li>IP2Proxy API Key.</li><li>Package (PX1 - PX11)</li></li><li>Use HTTPS or HTTP</li></ol> |
165-
|lookup(myIP, callback)|Query IP address. This method returns an object containing the proxy info. <ul><li>countryCode</li><li>countryName</li><li>regionName</li><li>cityName</li><li>isp</li><li>domain</li><li>usageType</li><li>asn</li><li>as</li><li>lastSeen</li><li>threat</li><li>proxyType</li><li>isProxy</li><li>provider</li><ul>|
166-
|getCredit(callback)|This method returns the web service credit balance in an object.|
167-
168-
## Usage
169-
170-
```javascript
171-
const {IP2ProxyWebService} = require("ip2proxy-nodejs");
172-
173-
let ws = new IP2ProxyWebService();
174-
175-
let ip = "8.8.8.8";
176-
let apiKey = "YOUR_API_KEY";
177-
let apiPackage = "PX11";
178-
let useSSL = true;
179-
180-
ws.open(apiKey, apiPackage, useSSL);
181-
182-
ws.lookup(ip, (err, data) => {
183-
if (!err) {
184-
console.log(data);
185-
186-
ws.getCredit((err, data) => {
187-
if (!err) {
188-
console.log(data);
189-
}
190-
});
191-
}
192-
});
193-
194-
```
19514

19615
### Proxy Type
19716

@@ -204,6 +23,8 @@ ws.lookup(ip, (err, data) => {
20423
|DCH|Hosting Providers/Data Center|
20524
|SES|Search Engine Robots|
20625
|RES|Residential Proxies [PX10+]|
26+
|CPN|Consumer Privacy Networks. [PX11+]|
27+
|EPN|Enterprise Private Networks. [PX11+]|
20728

20829
### Usage Type
20930

docs/source/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
# -- Project information
55

6-
project = 'IP2Proxy PHP'
7-
copyright = '2023, IP2Location'
6+
project = 'IP2Proxy NodeJS'
7+
copyright = '2024, IP2Location'
88
author = 'IP2Location'
99

1010
release = '0.1.0'

docs/source/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
# IP2Proxy Node.js Module
55

6-
This module allows user to query an IP address if it was being used as VPN anonymizer, open proxies, web proxies, Tor exits, data center, web hosting (DCH) range, search engine robots (SES) and residential (RES). It lookup the proxy IP address from **IP2Proxy BIN Data** file. This data file can be downloaded at
6+
This module allows user to query an IP address if it was being used as VPN anonymizer, open proxies, web proxies, Tor exits, data center, web hosting (DCH) range, search engine robots (SES), residential proxies (RES), consumer privacy networks (CPN), and enterprise private networks (EPN). It lookup the proxy IP address from **IP2Proxy BIN Data** file. This data file can be downloaded at
77

88
* Free IP2Proxy BIN Data: https://lite.ip2location.com
99
* Commercial IP2Proxy BIN Data: https://www.ip2location.com/database/ip2proxy

0 commit comments

Comments
 (0)