pip install NeuroNexus
Make an AWS account and create a new IAM user with the permission of AmazonAPIGatewayAdministrator
. Then, to find your access key ID and secret access key, follow the official AWS tutorial.
Set up your AWS credentials in your .env
file or with awscli by running aws configure
.
PROXY_POOL_AWS_ACCESS_KEY_ID=your_access_key_id
PROXY_POOL_AWS_SECRET_ACCESS_KEY=your_secret_access_key
Example usage:
import os
import asyncio
from dotenv import load_dotenv
from neuronexus import IPProxyPool
load_dotenv()
AWS_ACCESS_KEY_ID = os.getenv("PROXY_POOL_AWS_ACCESS_KEY_ID")
AWS_SECRET_ACCESS_KEY = os.getenv("PROXY_POOL_AWS_SECRET_ACCESS_KEY")
async def main():
session = IPProxyPool(
"https://api.ipify.org",
key_id=AWS_ACCESS_KEY_ID,
key_secret=AWS_SECRET_ACCESS_KEY,
regions=["us-east-1"],
verbose=True,
)
await session.start()
for _ in range(5):
response = await session.get("https://api.ipify.org")
print(f"Your ip: {await response.text()}")
await session.close()
if __name__ == "__main__":
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
loop.run_until_complete(main())
import os
import asyncio
from dotenv import load_dotenv
from neuronexus import IPProxyPool
load_dotenv()
AWS_ACCESS_KEY_ID = os.getenv("PROXY_POOL_AWS_ACCESS_KEY_ID")
AWS_SECRET_ACCESS_KEY = os.getenv("PROXY_POOL_AWS_SECRET_ACCESS_KEY")
async def main():
async with IPProxyPool(
"https://api.ipify.org",
key_id=AWS_ACCESS_KEY_ID,
key_secret=AWS_SECRET_ACCESS_KEY,
regions=["us-east-1"],
verbose=True,
) as session:
for _ in range(5):
response = await session.get("https://api.ipify.org")
print(f"Your ip: {await response.text()}")
if __name__ == "__main__":
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
loop.run_until_complete(main())
shutdown()
method via method #1, you may incur charges.
📌 Output:
>> Starting IP Rotating APIs in 1 regions
>> Created API with id "vg3uqmsxk8"
>> API launched in 1 regions out of 1
Your ip: 242.95.100.230
Your ip: 195.203.105.186
Your ip: 93.48.255.192
Your ip: 132.216.102.184
Your ip: 177.139.104.241
>> Deleted rest API with id "vg3uqmsxk8"
>> All created APIs for ip rotating have been deleted
Name | Description | Required | Default |
---|---|---|---|
site | The site (without path) requests will be sent to. | True | |
regions | An array of AWS regions to setup gateways in. | False | DEFAULT_REGIONS |
key_id | AWS Access Key ID (will override env variables). | False | Relies on env variables. |
key_secret | AWS Access Key Secret (will override env variables). | False | Relies on env variables. |
verbose | Include status and error messages. | False | False |
📌 Example:
from neuronexus import IPProxyPool, EXTRA_REGIONS, ALL_REGIONS
# Gateway to outbound HTTP IP and port for only two regions
gateway_1 = IPProxyPool("http://1.1.1.1:8080", regions=["eu-west-1", "eu-west-2"])
# Gateway to HTTPS google for the extra regions pack, with specified access key pair
gateway_2 = IPProxyPool("https://www.google.com", regions=EXTRA_REGIONS, key_id="ID", key_secret="SECRET")
-
🍴 Fork the repo!
-
🔧 Make your changes.
-
📦 Push your changes to a new branch and create a Pull Request.
Every contribution is welcome! 💖
This project is licensed under the MIT License. For more details, see LICENSE.