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

smartproxy-sdk

v1.0.16-alpha

Published

`

Downloads

24

Readme

`

SP

Smartproxy SDK Documentation

👋 Welcome

Welcome to the Smartproxy SDK documentation! This SDK provides developers with tools to easily integrate proxy functionality into their applications.

Table of Contents

Installation

You can install the Smartproxy SDK via npm:

npm install smartproxy-sdk --save

Or via Yarn:

yarn add smartproxy-sdk

Usage

To use the smartproxy SDK in your project, import it into your code:

const { SmartproxyClient } = require("smartproxy-sdk");

Then, login to the SDK with your dashboard authentication credentials:

const client = SmartproxyClient().getInstance();

client.login("username", "password");

Now you're ready to use the SDK to perform various proxy and scraping operations in your application!

Client API Reference

client.login(username, password)

Authenticates a user with the proxy service using their dashboard username and password.

  • username (string): The user's username.
  • password (string): The user's password.

client.getProxyUsers(proxyType)

Fetches an array of proxy users.

  • proxyType (string): The proxy product type.

client.getRtcUser(scraperType)

Sends an HTTP request via the proxy.

  • scraperType (string): The scraper product type.

Examples

Authenticate a User

client
  .login("[email protected]", "password")
  .then(() => {
    console.log("User authenticated successfully");
  })
  .catch((error) => {
    console.error("Authentication failed:", error);
  });

Retrieve Mobile Proxy Users List

client
  .getProxyUsers("mobile")
  .then((proxyUsers) => {
    console.log("Proxy users:", proxyUsers);
  })
  .catch((error) => {
    console.error("Failed to retrieve proxy users:", error);
  });

Retrieve RTC Scraper User

client
  .getRtcUser("rtc")
  .then((user) => {
    console.log("User:", user);
  })
  .catch((error) => {
    console.error("Failed to retrieve rtc user:", error);
  });

Spcraping API Reference

proxy({proxy, target})

Sends a request via the proxy.

  • proxy (object): Proxy configuration.
  • target (string): Target URL.

EndpointBuilder(proxy)

Generate proxy endpoint URL.

  • proxy (object): Proxy configuration.

UsernameBuilder

Gernerate proxy username.

  • proxy (object): Proxy configuration.

Scraping API Reference

serpScraper(parameters)

Sends a request via SERP API to Google.

  • parameters (object): Scraping parameters for SERP scraper.

webScrape(parameters)

Sends a request via WEB Scraping API.

  • parameters (object): Scraping parameters Google hotels.

Examples

Make Google Scraping Request

const parameters = {
    target: 'google',
    url: 'www.example.com',
    geo: 'Congo',
    device_type: 'Mobile',
    session_id: '1',
    parse: false,
};

serpScraper(parameters)
  .then((response) => {
    console.log("SERP API response:", response);
  })
  .catch((error) => {
    console.error("SERP API request failed:", error);
  });

Make Google Search Scraping Request

const parameters = {
    target: 'google_search',
    query: 'pizza',
    domain: 'www.pizza.com',
    page_from: '1',
    num_pages: '2',
    locale: 'en-us',
    geo: 'Congo',
    device_type: 'Mobile',
    google_results_language: 'en-us',
    google_tbm: 'yes',
    google_tbs: 'yes',
    google_safe_search: 'no',
    session_id: '1',
    parse: false,
};

serpScraper(parameters)
  .then((response) => {
    console.log("SERP API response:", response);
  })
  .catch((error) => {
    console.error("SERP API request failed:", error);
  });

Make Web Scraping Request

const parameters = {
    url:"https://ip.smartproxy.com/json",
    parse:false
};

webScrape(parameters)
  .then((response) => {
    console.log("WEB Scraping API response:", response);
  })
  .catch((error) => {
    console.error("WEB Scraping API request failed:", error);
  });

Proxy API Reference

proxy({proxy, target})

Sends a request via the proxy.

  • proxy (object): Proxy configuration.
  • target (string): Target URL.

EndpointBuilder(proxy)

Generate proxy endpoint URL.

  • proxy (object): Proxy configuration.

UsernameBuilder

Gernerate proxy username.

  • proxy (object): Proxy configuration.

Examples

Make HTTP Proxy Request

const proxyConfig = {
  output: "https",
  username: "username",
  password: "password",
  adress: "gate.smartproxy.com",
  port: "7000",
};

const target = "ip.smartproxy.com/json";

proxy({ proxy: proxyConfig, target })
  .then((response) => {
    console.log("Target response:", response);
  })
  .catch((error) => {
    console.error("Proxy request failed:", error);
  });

License

This project is licensed under the MIT License - see the LICENSE file for details. `