Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

pyproxy-api

yonpm202513MIT1.0.4TypeScript support: included

API wrapper for PyProxy Reseller API

proxy, pyproxy, api, reseller

readme

PyProxy API

A TypeScript wrapper for the PyProxy Reseller API.

Installation

npm install pyproxy-api

Usage

import { PyProxy } from 'pyproxy-api';

// Initialize with your API token
const pyproxy = new PyProxy('your-py-account', 'your-api-key');

// Examples

// Get user information
async function getUserInfo() {
  try {
    const userInfo = await pyproxy.user_info({ id: '12345' });
    console.log(userInfo);
  } catch (error) {
    console.error('Error fetching user info:', error);
  }
}

// Create a new user
async function createUser() {
  try {
    const newUser = await pyproxy.create_user({
      username: 'testuser',
      email: 'test@example.com',
      password: 'password123',
      status: 1
    });
    console.log(newUser);
  } catch (error) {
    console.error('Error creating user:', error);
  }
}

// Get country list
async function getCountries() {
  try {
    const countries = await pyproxy.get_country_list();
    console.log(countries);
  } catch (error) {
    console.error('Error fetching countries:', error);
  }
}

API Reference

Initialization

const pyproxy = new PyProxy('your-api-token');

Methods

  • user_info(options) - Get user information
  • create_user(options) - Create a new user
  • create_proxy_account(options) - Create a proxy account
  • get_proxy_account_list(options) - Get list of proxy accounts
  • delete_proxy_account(options) - Delete a proxy account
  • distribute_flow(options) - Distribute flow
  • flow_order_list(options) - Get flow order list
  • add_white_ip(options) - Add a white IP
  • del_white_ip(options) - Delete a white IP
  • get_white_ip_list(options) - Get list of white IPs
  • get_user_traffic_usage_log(options) - Get user traffic usage log
  • get_country_list() - Get list of countries

License

MIT