Proxifly is a service to get free HTTPS proxies and check your public IP
npm install proxifly
Site | NPM Module | GitHub Repo
proxifly is the official npm module of Proxifly, a free service to get SOCKS, HTTP, & HTTPS proxies as well as to check your public IP!
extended=true to see country, city, zip code, and latitude/longitude for the IP as well.proxifly for free, but if you want to do some advanced stuff, you'll need an API key. You can get one by signing up for a Proxifly account.proxifly in a Node project or in the browser.shell
npm install proxifly
`
If you plan to use proxifly in a browser environment, you will probably need to use Webpack, Browserify, or a similar service to compile it.`js
const proxifly = new (require('proxifly'))({
// Not required, but having one removes limits (get your key at https://proxifly.dev).
apiKey: 'api_test_key'
});
`$3
Install with CDN if you plan to use Proxifly only in a browser environment.
`html
`$3
You can use proxifly in a variety of ways that require no installation, such as curl in terminal/shell. See the Use without installation section below.⚡️ Using Proxifly
After you have followed the install step, you can start using proxifly to get proxy lists and check your public IP!
$3
Retrieves a fully filterable list of proxies in either json or plain text.
`js
var options = {
protocol: 'http', // http | socks4 | socks5
anonymity: 'elite', // transparent | anonymous | elite
country: 'US', // https://www.nationsonline.org/oneworld/country_code_list.htm
https: true, // true | false
speed: 10000, // 0 - 60000
format: 'json', // json | text
quantity: 1, // 1 - 20
};proxifly.getProxy(options)
.then(proxy => {
console.log('getProxy:', proxy);
// If you specify a quantity greater than 1, the response will be an array!
// In this case, you can access by calling response[0].ipPort, response[1].ipPort, etc...
})
.catch(e => {
console.error(e);
})
`$3
The options for getProxy(options) are as follows.
* protocol string, array (optional): Filter by the protocol
* Values: http, socks4, socks5
* Default: http
* anonymity string, array (optional): Filter by anonymity level.
* Values: transparent, anonymous, elite (elite is the most anonymous)
* Default: null (no filter, any anonymity)
* country string, array (optional): Filter by country.
* Values: US, CA, RU... (see full list at https://www.nationsonline.org/oneworld/country_code_list.htm)
* Default: null (no filter, any country)
* https boolean (optional): Filter by https/SSL.
* Values: true, false
* Default: null (no filter, any level of https)
* speed number (optional): Filter by speed, value is in _milliseconds_ taken to connect.
* Values: 0 - 60000
* Default: null (no filter, any speed)
* Note: Specifying a very low number (less than ~400) will return significantly fewer results
* format string (optional): The response type.
* Values: json, text
* Default: json
* quantity number (optional): The number of proxies to be returned. Any number greater than 1 will be returned in an array.
* Values: 1 - 20
* Default: 1
* Note: Without an API key, you cannot return more than 1 result.For most options like
protocol, anonymity, and country, you can provide an array where each element in the array will act as OR logic.
For example:
`js
var options = {
protocol: ['http', 'socks4'],
anonymity: ['anonymous', 'elite'],
country: ['US', 'GB', 'RU'],
}
`
This filter will call the API for any proxies that are either of protocol (http OR socks4) AND of anonymity (anonymous OR elite) AND from (US OR GB OR RU)!$3
Here is a sample response for the .getProxy() method. This is the output you will see when extended=true:
`js
{
proxy: 'socks4://103.99.110.222:5678',
protocol: 'socks4',
ip: '103.99.110.222',
port: 5678,
https: false,
anonymity: 'transparent',
score: 1,
geolocation: { country: 'IN', city: 'Unknown' }
}
`$3
Get your public IP with a simple api call.
`js
var options = {
mode: 'IPv4', // IPv4 | IPv6
format: 'json', // json | text
};proxifly.getPublicIp(options)
.then(proxy => {
console.log('getPublicIp:', response);
console.log('My IP is:', response.ip);
console.log('My country is:', response.country);
})
.catch(e => {
console.error(e);
})
`
$3
The options for getProxy(options) are as follows.
* mode string (optional): IPv4 IP or IPv6 IP?
* Values: IPv4, IPv6
* Default: IPv4
* format string (optional): The response type.
* Values: json, text
* Default: json
$3
Here is a sample response for the .getPublicIp() method. This is the output you will see when extended=true:
`js
{
ip: '104.173.192.180',
geolocation: {
country: 'US',
city: 'Los Angeles',
latitude: 34.0544,
longitude: -118.2441
}
}
`For a more in-depth documentation of this library and the Proxifly service, please visit the official Proxifly website.
🔧 Use without installation
$3
`shell
Get public IP
Standard
curl -X POST https://api.proxifly.dev/ip
With options
curl -d "format=text&mode=ipv4" -X POST https://api.proxifly.dev/ip
With options (alternative)
curl -d '{"format": "text", "mode": "ipv4"}' -H 'Content-Type: application/json' https://api.proxifly.dev/ipGet a proxy
Standard
curl -X POST https://api.proxifly.dev/proxy
With options
curl -d "format=text&protocol=http&quantity=3" -X POST https://api.proxifly.dev/proxy
With options (alternative)
curl -d '{"format": "text", "protocol": ["http", "socks4"], "quantity": 3}' -H 'Content-Type: application/json' https://api.proxifly.dev/proxy``Ask us to have your project listed! :)