npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

onlineproxy-js-api

v1.0.7

Published

Library for OnlineProxy Api

Downloads

463

Readme

OnlineProxy JS API

npm version

Wrapper for automatic reception for managing proxies from onlineproxy.io for Node.js and Vanilla JS.

🌟 Features

  • 🌐 Proxy Management: Manage and use proxies from onlineproxy.io for enhanced privacy and security.
  • 🔒 Full Typescript Support: Enjoy full Typescript support for type-safe development.
  • 🛠️ Easy Integration: Seamlessly integrate with your Node.js or Vanilla JS projects.
  • 📚 Comprehensive Documentation: Detailed documentation and examples to help you get started quickly.
  • 🐞 Bug Reporting: Easily report and track bugs through GitHub Issues.

✨ Introduction

onlineproxy JS API is a powerful and easy-to-use wrapper designed to simplify the process of integrating SMS and proxy services into your Node.js or Vanilla JS projects. With full Typescript support, you can enjoy type-safe development and efficient coding.

⚙️ Quick Setup

Install the package in your project with:

Using npm:

npm install onlineproxy-js-api

Using pnpm:

pnpm install onlineproxy-js-api

Using yarn:

yarn add onlineproxy-js-api

Then, integrate it into your project:

import OnlineProxyDriver from "onlineproxy-js-api";

const apikey = 'your_apikey_here';
const driver = new OnlineProxyDriver(apikey);

// Example usage for proxy management
driver.getProxyList().then((result) => {
  console.log(result);
});

🗂 Documentation

For detailed documentation and examples, please visit the Documentation.

🐞 Bugs

If you encounter any issues or have suggestions for improvements, please create an issue here.

🌐 OnlineProxy.io Integration

The onlineproxy JS API also includes support for managing proxies from onlineproxy.io. This allows you to enhance your privacy and security by using high-quality proxies for your applications.

Example Usage

import OnlineProxyDriver from "onlineproxy-js-api";

const apikey = 'your_apikey_here';
const driver = new OnlineProxyDriver(apikey);

// Example usage for proxy management
driver.getProxyList().then((result) => {
  console.log(result);
});

🛠️ Methods

🌍 getProxy

  • Type: (id: string) => Promise<Proxy>
  • Description: Retrieves the proxy with the specified ID.
  • docs: [ru] [de] [en].
  • Parameters:
    • id: string — The ID of the proxy.
  • Example:
const driver = new OnlineProxyAPI('APIKEY', 'en', 123);

driver.getProxy('proxy_id').then((result) => {
  console.log(result);
  // Output: { id: 'proxy_id', ip: '127.0.0.1', port: 8080, type: 'HTTP', country: 'USA', city: 'New York', anonymity: 'High', speed: 100, uptime: 99, lastChecked: '2023-01-01', createdAt: '2023-01-01', updatedAt: '2023-01-01', comment: 'Proxy comment' }
});

📜 getProxyList

  • Type: () => Promise<ProxyList>
  • Description: Retrieves the list of all available proxies.
  • docs: [ru] [de] [en].
  • Example:
const driver = new OnlineProxyAPI('APIKEY', 'en', 123);

driver.getProxyList().then((result) => {
  console.log(result);
  // Output: { proxies: [{ id: 'proxy_id', ip: '127.0.0.1', port: 8080, type: 'HTTP', country: 'USA', city: 'New York', anonymity: 'High', speed: 100, uptime: 99, lastChecked: '2023-01-01', createdAt: '2023-01-01', updatedAt: '2023-01-01', comment: 'Proxy comment' }] }
});

🔄 rotateProxy

  • Type: () => Promise<RotateResult>
  • Description: Rotates the IP address of the proxy.
  • docs: [ru] [de] [en].
  • Example:
const driver = new OnlineProxyAPI('APIKEY', 'en', 123);

driver.rotateProxy().then((result) => {
  console.log(result);
  // Output: { success: true, newIp: '127.0.0.2' }
});

💬 createOrUpdateProxyComment

  • Type: (id: string, comment: string) => Promise<CommentResult>
  • Description: Creates or updates the comment for a specific proxy.
  • docs: [ru] [de] [en].
  • Parameters:
    • id: string — The ID of the proxy.
    • comment: string — The comment to create or update.
  • Example:
const driver = new OnlineProxyAPI('APIKEY', 'en', 123);

driver.createOrUpdateProxyComment('proxy_id', 'New comment').then((result) => {
  console.log(result);
  // Output: { success: true, message: 'Comment updated' }
});

📋 getAvailableProxiesForOrder

  • Type: () => Promise<AvailableProxies>
  • Description: Retrieves the list of proxies available for order, matching the input filtering criteria.
  • docs: [ru] [de] [en].
  • Example:
const driver = new OnlineProxyAPI('APIKEY', 'en', 123);

driver.getAvailableProxiesForOrder().then((result) => {
  console.log(result);
  // Output: { proxies: [{ id: 'proxy_id', ip: '127.0.0.1', port: 8080, type: 'HTTP', country: 'USA', city: 'New York', anonymity: 'High', speed: 100, uptime: 99, lastChecked: '2023-01-01', createdAt: '2023-01-01', updatedAt: '2023-01-01', comment: 'Proxy comment' }] }
});

🛒 orderProxy

  • Type: (orderData: any) => Promise<OrderResult>
  • Description: Orders a proxy.
  • docs: [ru] [de] [en].
  • Parameters:
    • orderData: any — The data required to place an order.
  • Example:
const driver = new OnlineProxyAPI('APIKEY', 'en', 123);

const orderData = { proxyId: 'proxy_id', quantity: 1 };
driver.orderProxy(orderData).then((result) => {
  console.log(result);
  // Output: { success: true, orderId: 'order123' }
});

📊 getProxyTariffs

  • Type: () => Promise<Tariffs>
  • docs: [ru] [de] [en].
  • Description: Retrieves the available periods and the minimum order price of proxies, matching the input filtering criteria.
  • Example:
const driver = new OnlineProxyAPI('APIKEY', 'en', 123);

driver.getProxyTariffs().then((result) => {
  console.log(result);
  // Output: { tariffs: [{ period: '1 month', price: 10 }] }
});

💰 getUserBalance

  • Type: () => Promise<UserBalance>
  • Description: Retrieves the user balance.
  • docs: [ru] [de] [en].
  • Example:
const driver = new OnlineProxyAPI('APIKEY', 'en', 123);

driver.getUserBalance().then((result) => {
  console.log(result);
  // Output: { balance: 100 }
});

Example

const driver = new OnlineProxyAPI('APIKEY', 'en', 123);

driver.getProxy('proxy_id').then((proxy) => {
  console.log('Proxy:', proxy);
});

driver.getUserBalance().then((balance) => {
  console.log('Balance:', balance);
});

📚 Additional Resources

onlineproxy-js-api