Skip to main content

Proxy6 API wrapper

Project description

Proxy6 API wrapper

Unofficial API wrapper for proxy6.net using pydantic

Installation

pip install proxy6net-api

Basic usage

Get your API token here

Create API wrapper instance

from proxy6net_api import Proxy6API

api = Proxy6API(auth_token='your_token')

Get balance

balance = api.get_balance()
f'{balance.balance=}, {balance.currency=}'

# balance.balance = 518.20, balance.currency='RUB'

Buy proxies

purchase = api.buy_proxies(count=3, days=5, country_code='ru', ipv='IPV6', protocol='http')
len(purchase.proxies)

# 3

Use proxy

import requests

proxy = api.get_proxies(state='active')[0]
response = requests.get('https://api64.ipify.org?format=json', proxies={'http': str(proxy), 'https': proxy.url})

assert response.json()['ip'] == proxy.ip

Other methods

help(Proxy6API)

Error handling

from proxy6net_api import Proxy6Exception

try:
    proxies = Proxy6API(auth_token='invalid token').get_proxies()
except Proxy6Exception as err:
    print(f'Error description: {err.description}. Error code: {err.code}')
    
    # Error description: Authorization error, wrong key. Error code: 100

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

proxy6net-api-1.0.0.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

proxy6net_api-1.0.0-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file proxy6net-api-1.0.0.tar.gz.

File metadata

  • Download URL: proxy6net-api-1.0.0.tar.gz
  • Upload date:
  • Size: 9.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for proxy6net-api-1.0.0.tar.gz
Algorithm Hash digest
SHA256 fcb396ec77cf33b8bf58e943aaf16612eb0421e9e0bc7a242c08fb81ee04c7e6
MD5 ce55ae9d1cc834e73f82d5befa4f7b9b
BLAKE2b-256 000a75a0527bc8d6f249d13af555c4b54136ae89b6f3bfcce42549e09f03f654

See more details on using hashes here.

File details

Details for the file proxy6net_api-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for proxy6net_api-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9318de3b6ad416753b43cde8cf73b0568e7ba72f9d09b3fa0e7c9b8d38b38b1a
MD5 5559570b5308f0a704a4a3f0fe7340a1
BLAKE2b-256 eeaaf64bf65f8bef823280a5109a0d1406fce4fd5785f13302a68914d55c1f07

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page