### Node.js Quick Setup Source: https://floppydata.com/docs/authentication Install required Node.js packages, set up your .env file with credentials, and use the example code to establish proxy connections or interact with the FloppyData API. ```bash npm install dotenv axios ``` ```bash FLOPPY_USER=user_abc123xyz FLOPPY_PASS=your_password FLOPPY_API_KEY=floppy_live_1234567890abcdefghijklmnop ``` ```javascript require('dotenv').config(); const axios = require('axios'); // For Proxy const proxy = { host: 'geo.g-w.info', port: 10080, auth: { username: process.env.FLOPPY_USER, password: process.env.FLOPPY_PASS } }; axios.get('http://example.com', { proxy }) .then(response => console.log(response.data)); // For Web Unlocker / API const headers = { 'X-Api-Key': process.env.FLOPPY_API_KEY }; axios.post( 'https://api.floppydata.net/v1/webUnlocker', { url: 'https://example.com' }, { headers } ).then(response => console.log(response.data)); ``` -------------------------------- ### Python Quick Setup Source: https://floppydata.com/docs/authentication Install necessary Python libraries, configure your environment variables in a .env file, and use the provided code to connect via proxy or the FloppyData API. ```bash pip install python-dotenv requests ``` ```bash FLOPPY_USER=user_abc123xyz FLOPPY_PASS=your_password FLOPPY_API_KEY=floppy_live_1234567890abcdefghijklmnop ``` ```python import os import requests from dotenv import load_dotenv load_dotenv() # For Proxy proxy_url = f"http://{os.getenv('FLOPPY_USER')}:{os.getenv('FLOPPY_PASS')}@geo.g-w.info:10080" proxies = {'http': proxy_url, 'https': proxy_url} response = requests.get('http://example.com', proxies=proxies) # For Web Unlocker / API headers = {'X-Api-Key': os.getenv('FLOPPY_API_KEY')} response = requests.post( 'https://api.floppydata.net/v1/webUnlocker', headers=headers, json={'url': 'https://example.com'} ) ``` -------------------------------- ### Install aiohttp library Source: https://floppydata.com/docs/proxies/using-proxies Install the aiohttp library using pip. This is necessary for the aiohttp example. ```bash pip install aiohttp ``` -------------------------------- ### Install httpx library Source: https://floppydata.com/docs/proxies/using-proxies Install the httpx library using pip. This is required for the httpx examples. ```bash pip install httpx ``` -------------------------------- ### Install got Source: https://floppydata.com/docs/proxies/using-proxies Install the got library using npm. ```bash npm install got ``` -------------------------------- ### Smart Parameters Example Source: https://floppydata.com/docs/proxies/basics An example demonstrating how to specify proxy type, country, city, and session for routing. ```text user123-type-residential-country-US-city-New_York-session-abc123 ``` -------------------------------- ### Example Connection with Smart Parameters Source: https://floppydata.com/docs/proxies/basics This example demonstrates how to use Smart Parameters like type and country within the username for specific routing. ```text http://user123-type-residential-country-US:yourpassword@geo.g-w.info:10080 ``` -------------------------------- ### Install requests library Source: https://floppydata.com/docs/proxies/using-proxies Install the requests library using pip. This is a prerequisite for the Python examples. ```bash pip install requests ``` -------------------------------- ### Install axios Source: https://floppydata.com/docs/proxies/using-proxies Install the axios library using npm. ```bash npm install axios ``` -------------------------------- ### Proxy Connection String Example Source: https://floppydata.com/docs/authentication An example of a complete proxy connection string with a username and password. ```text http://user_abc123xyz:your_password@geo.g-w.info:10080 ``` -------------------------------- ### Install Puppeteer Source: https://floppydata.com/docs/proxies/using-proxies Install the Puppeteer library using npm. This is the first step before using Puppeteer in your project. ```bash npm install puppeteer ``` -------------------------------- ### Install node-fetch and https-proxy-agent Source: https://floppydata.com/docs/proxies/using-proxies Install the node-fetch and https-proxy-agent libraries using npm. ```bash npm install node-fetch https-proxy-agent ``` -------------------------------- ### Proxy Username Example with Smart Parameters Source: https://floppydata.com/docs/authentication An example of a username with smart parameters for a US Residential proxy with sticky sessions. ```text user_abc123xyz-type-residential-country-US-session-mysession01 ``` -------------------------------- ### Python Proxy Example Source: https://floppydata.com/docs/proxies/basics Demonstrates how to set up and use a residential proxy with sticky sessions in Python using the requests library. ```python import requests PROXY_USER = "user123" PROXY_PASS = "your_password" # Residential, US, sticky session proxy_username = f"{PROXY_USER}-type-residential-country-US-session-checkout01" proxy_url = f"http://{proxy_username}:{PROXY_PASS}@geo.g-w.info:10080" proxies = { 'http': proxy_url, 'https': proxy_url } response = requests.get('https://example.com', proxies=proxies) print(response.text) ``` -------------------------------- ### Example with jq for JSON Formatting Source: https://floppydata.com/docs/development An example demonstrating how to use `curl` with `jq` to fetch and format JSON responses from the API. ```APIDOC ## GET /v1/static/list ### Description Retrieves a list of static resources. This example shows how to pipe the output to `jq` for pretty-printing. ### Method GET ### Endpoint /v1/static/list ### Request Example ```bash curl --silent \ --url "$FLOPPY_BASE_URL/v1/static/list" \ --header "X-Api-Key: $FLOPPY_API_KEY" | jq ``` ``` -------------------------------- ### Basic Python requests setup Source: https://floppydata.com/docs/proxies/using-proxies Set up proxies for the requests library by constructing a proxy URL with smart parameters and passing it to the 'proxies' argument. ```python import requests # Your credentials PROXY_USER = "user123" PROXY_PASS = "your_password" # Build proxy URL with Smart Parameters proxy_username = f"{PROXY_USER}-type-residential-country-US-session-session01" proxy_url = f"http://{proxy_username}:{PROXY_PASS}@geo.g-w.info:10080" proxies = { 'http': proxy_url, 'https': proxy_url } # Make request response = requests.get('https://httpbin.org/ip', proxies=proxies) print(response.json()) ``` -------------------------------- ### Asynchronous httpx setup Source: https://floppydata.com/docs/proxies/using-proxies Set up proxies for asynchronous requests with httpx. The proxy URL is passed to httpx.AsyncClient, and requests are made using 'await'. ```python import httpx import asyncio async def fetch(): proxy_url = "http://user-type-residential-country-US:pass@geo.g-w.info:10080" async with httpx.AsyncClient(proxies=proxy_url) as client: response = await client.get('https://example.com') return response.text asyncio.run(fetch()) ``` -------------------------------- ### Install Playwright Source: https://floppydata.com/docs/proxies/using-proxies Install the Playwright library using npm. This is required for using Playwright in your Node.js projects. ```bash npm install playwright ``` -------------------------------- ### List Static Proxies and Format with jq Source: https://floppydata.com/docs/development This example shows how to list static proxies and pipe the output to jq for pretty-printing. It requires the FLOPPY_BASE_URL and FLOPPY_API_KEY environment variables. ```bash curl --silent \ --url "$FLOPPY_BASE_URL/v1/static/list" \ --header "X-Api-Key: $FLOPPY_API_KEY" | jq ``` -------------------------------- ### Synchronous httpx setup Source: https://floppydata.com/docs/proxies/using-proxies Configure proxies for synchronous requests using httpx. The proxy URL is passed directly to the httpx.Client. ```python import httpx proxy_url = "http://user-type-residential-country-US:pass@geo.g-w.info:10080" with httpx.Client(proxies=proxy_url) as client: response = client.get('https://example.com') print(response.text) ``` -------------------------------- ### Got Proxy Example Source: https://floppydata.com/docs/proxies/using-proxies Use the got library with a proxy by configuring an HttpsProxyAgent. The proxy URL includes authentication details. ```javascript const got = require('got'); const { HttpsProxyAgent } = require('https-proxy-agent'); const proxyUrl = 'http://user-type-residential-country-US:pass@geo.g-w.info:10080'; const agent = new HttpsProxyAgent(proxyUrl); got('https://example.com', { agent: { https: agent } }).then(response => { console.log(response.body); }); ``` -------------------------------- ### Node.js Proxy Example Source: https://floppydata.com/docs/proxies/basics Shows how to configure and use a mobile proxy with city targeting in Node.js using the axios library. ```javascript const axios = require('axios'); const PROXY_USER = 'user123'; const PROXY_PASS = 'your_password'; // Mobile, US, New York const proxyUsername = `${PROXY_USER}-type-mobile-country-US-city-New_York`; const proxy = { host: 'geo.g-w.info', port: 10080, auth: { username: proxyUsername, password: PROXY_PASS } }; axios.get('https://example.com', { proxy }) .then(res => console.log(res.data)); ``` -------------------------------- ### aiohttp asynchronous setup Source: https://floppydata.com/docs/proxies/using-proxies Configure proxies for asynchronous requests using aiohttp. The proxy URL is passed as an argument to the session.get method. ```python import aiohttp import asyncio async def fetch(): proxy_url = "http://user-type-residential-country-US:pass@geo.g-w.info:10080" async with aiohttp.ClientSession() as session: async with session.get( 'https://example.com', proxy=proxy_url ) as response: return await response.text() asyncio.run(fetch()) ``` -------------------------------- ### Example Datacenter Proxy Username Source: https://floppydata.com/docs/proxies/browser-and-extension-setup An example of a username format for a datacenter proxy, specifying type and country. Datacenter proxies are generally the fastest. ```text user123-type-datacenter-country-US ``` -------------------------------- ### Java HttpURLConnection Proxy Example Source: https://floppydata.com/docs/proxies/using-proxies Set up an HTTP proxy in Java using HttpURLConnection. Requires configuring an Authenticator for proxy credentials and creating a Proxy object. ```java import java.net.*; import java.io.*; public class ProxyExample { public static void main(String[] args) throws Exception { String proxyHost = "geo.g-w.info"; int proxyPort = 10080; String proxyUser = "user-type-residential-country-US"; String proxyPass = "your_password"; Authenticator.setDefault(new Authenticator() { protected PasswordAuthentication getPasswordAuthentication() { return new PasswordAuthentication(proxyUser, proxyPass.toCharArray()); } }); Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(proxyHost, proxyPort)); URL url = new URL("https://httpbin.org/ip"); HttpURLConnection conn = (HttpURLConnection) url.openConnection(proxy); BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream())); String line; while ((line = in.readLine()) != null) { System.out.println(line); } in.close(); } } ``` -------------------------------- ### Try Different Proxy Types Source: https://floppydata.com/docs/proxies/troubleshooting If one proxy type is not working, try switching to another. Examples include mobile or datacenter proxies. ```python # If residential fails, try mobile proxy_username = "user123-type-mobile-country-US" # Or datacenter proxy_username = "user123-type-datacenter-country-US" ``` -------------------------------- ### Configure Same Session Across Devices Source: https://floppydata.com/docs/proxies/troubleshooting Example of how to configure a proxy username to maintain the same session (and thus the same IP address) across different devices. ```python # Same session = same IP across devices proxy_username = "user123-type-residential-country-US-session-shared01" ``` -------------------------------- ### Node-fetch Proxy Example Source: https://floppydata.com/docs/proxies/using-proxies Use node-fetch with a proxy by configuring an HttpsProxyAgent. The proxy URL includes authentication details. ```javascript const fetch = require('node-fetch'); const { HttpsProxyAgent } = require('https-proxy-agent'); const proxyUrl = 'http://user-type-residential-country-US:pass@geo.g-w.info:10080'; const agent = new HttpsProxyAgent(proxyUrl); fetch('https://example.com', { agent }) .then(res => res.text()) .then(body => console.log(body)); ``` -------------------------------- ### Go HTTP Client Proxy Example Source: https://floppydata.com/docs/proxies/using-proxies Configure an HTTP client in Go to use a proxy. This involves creating a custom http.Transport with the Proxy field set. ```go package main import ( "fmt" "io" "net/http" "net/url" ) func main() { proxyURL, _ := url.Parse("http://user-type-residential-country-US:pass@geo.g-w.info:10080") client := &http.Client{ Transport: &http.Transport{ Proxy: http.ProxyURL(proxyURL), }, } resp, err := client.Get("https://httpbin.org/ip") if err != nil { panic(err) } defer resp.Body.Close() body, _ := io.ReadAll(resp.Body) fmt.Println(string(body)) } ``` -------------------------------- ### Proxy Parameter Combinations Source: https://floppydata.com/docs/proxies/basics These examples show various ways to format proxy parameters for different use cases, including residential, mobile, datacenter, session-based, and rotation settings. ```python "user123-type-residential-country-US" ``` ```python "user123-type-residential-country-US-session-login01" ``` ```python "user123-type-residential-country-US-city-Chicago-session-user1" ``` ```python "user123-type-mobile-country-US" ``` ```python "user123-type-residential-country-US-rotation--1" ``` ```python "user123-type-datacenter-country-US" ``` ```python "user123-type-residential-country-US-state-California-session-s01" ``` -------------------------------- ### Axios Proxy Setup with Environment Variables Source: https://floppydata.com/docs/proxies/using-proxies Configure axios to use a proxy with credentials loaded from environment variables. This is useful for managing sensitive information. ```javascript require('dotenv').config(); const axios = require('axios'); const PROXY_USER = process.env.FLOPPY_USER; const PROXY_PASS = process.env.FLOPPY_PASS; const proxyUsername = `${PROXY_USER}-type-residential-country-US`; const proxy = { host: 'geo.g-w.info', port: 10080, auth: { username: proxyUsername, password: PROXY_PASS } }; axios.get('https://example.com', { proxy }) .then(res => console.log(res.data)); ``` -------------------------------- ### Get Web Unlocker Balance (OpenAPI) Source: https://floppydata.com/docs/api-reference/endpoint/web-unlocker-balance Use this OpenAPI specification to understand the structure and parameters of the request to get the remaining web unlocker requests. The response includes the number of uses left. ```yaml GET /v1/webUnlocker/balance openapi: 3.1.0 info: title: FloppyData Client API description: >- API documentation for FloppyData Client API. You can manage your API keys in [account settings](https://app.floppydata.com/settings/account) version: 1.0.0 servers: - url: https://api.floppydata.net security: - apiKeyHeader: [] tags: - name: Rotating proxy description: Endpoints to gather data about rotating proxies - name: Static IPs description: Endpoints to manage static IPs - name: Web Unlocker description: |- Remove the need to develop and maintain the infrastructure. Simply extract high volume web data, and ensure scalability and reliability using web scraper API - name: Tools description: Utility endpoints for proxy-related tasks paths: /v1/webUnlocker/balance: get: tags: - Web Unlocker summary: Balance description: Remaining web unlocker requests operationId: getV1WebUnlockerBalance responses: '200': description: Successful response content: application/json: schema: type: object properties: usesLeft: type: integer minimum: 0 maximum: 9007199254740991 description: Remaining web unlocker requests required: - usesLeft description: Available web unlocker requests components: securitySchemes: apiKeyHeader: type: apiKey in: header name: X-Api-Key ``` -------------------------------- ### Extract First Connection Values Source: https://floppydata.com/docs/guides/static-ips An example demonstrating how to extract specific connection details (host, port, username, password) for the first static IP in the list using `jq`. ```APIDOC ## Extract First Connection Values ### Description This example shows how to use `curl` and `jq` to extract the host, port, username, and password of the first static IP from the `/v1/static/list` endpoint response. ### Request Example ```bash curl --silent \ --url "$FLOPPY_BASE_URL/v1/static/list" \ --header "X-Api-Key: $FLOPPY_API_KEY" | jq '.ip_list[0] | {host, port, username, password}' ``` ### Response Example ```json { "host": "example.com", "port": 8080, "username": "user123", "password": "pass456" } ``` ``` -------------------------------- ### Python requests setup with environment variables Source: https://floppydata.com/docs/proxies/using-proxies Configure proxies for the requests library using environment variables for credentials. Ensure you have a .env file or set these variables in your environment. ```python import os import requests from dotenv import load_dotenv load_dotenv() PROXY_USER = os.getenv('FLOPPY_USER') PROXY_PASS = os.getenv('FLOPPY_PASS') proxy_username = f"{PROXY_USER}-type-residential-country-US" proxy_url = f"http://{proxy_username}:{PROXY_PASS}@geo.g-w.info:10080" proxies = {'http': proxy_url, 'https': proxy_url} response = requests.get('https://example.com', proxies=proxies) ``` -------------------------------- ### Axios Basic Proxy Setup Source: https://floppydata.com/docs/proxies/using-proxies Configure axios to use a proxy with username and password authentication. The proxy username can include smart parameters for country and session. ```javascript const axios = require('axios'); const PROXY_USER = 'user123'; const PROXY_PASS = 'your_password'; // Configure proxy with Smart Parameters const proxyUsername = `${PROXY_USER}-type-residential-country-US-session-session01`; const proxy = { host: 'geo.g-w.info', port: 10080, auth: { username: proxyUsername, password: PROXY_PASS } }; // Make request axios.get('https://httpbin.org/ip', { proxy }) .then(response => console.log(response.data)) .catch(error => console.error(error)); ``` -------------------------------- ### C# HttpClient Proxy Example Source: https://floppydata.com/docs/proxies/using-proxies Configure an HttpClient in C# to use a proxy. This involves creating a WebProxy object with the proxy address and credentials, then setting it on HttpClientHandler. ```csharp using System; using System.Net; using System.Net.Http; class Program { static async Task Main() { var proxy = new WebProxy { Address = new Uri("http://geo.g-w.info:10080"), Credentials = new NetworkCredential("user-type-residential-country-US", "your_password") }; var handler = new HttpClientHandler { Proxy = proxy, UseProxy = true }; using var client = new HttpClient(handler); var response = await client.GetStringAsync("https://httpbin.org/ip"); Console.WriteLine(response); } } ``` -------------------------------- ### Ruby HTTParty Proxy Example Source: https://floppydata.com/docs/proxies/using-proxies Configure proxy settings with the HTTParty gem in Ruby. Pass proxy details as options to the HTTParty request method. ```ruby require 'httparty' response = HTTParty.get( 'https://example.com', http_proxyaddr: 'geo.g-w.info', http_proxyport: 10080, http_proxyuser: 'user-type-residential-country-US', http_proxypass: 'your_password' ) puts response.body ``` -------------------------------- ### Basic Puppeteer Proxy Setup Source: https://floppydata.com/docs/proxies/using-proxies Configure Puppeteer to use a proxy server for all browser requests. Ensure proxy details are correctly formatted. ```javascript const puppeteer = require('puppeteer'); (async () => { const PROXY_USER = 'user123-type-residential-country-US-session-pup01'; const PROXY_PASS = 'your_password'; const PROXY_SERVER = 'geo.g-w.info:10080'; const browser = await puppeteer.launch({ args: [`--proxy-server=${PROXY_SERVER}`] }); const page = await browser.newPage(); // Authenticate await page.authenticate({ username: PROXY_USER, password: PROXY_PASS }); // Navigate await page.goto('https://httpbin.org/ip'); const content = await page.content(); console.log(content); await browser.close(); })(); ``` -------------------------------- ### PHP Guzzle Proxy Example Source: https://floppydata.com/docs/proxies/using-proxies Integrate proxies into PHP applications using the Guzzle HTTP client. Requires the Guzzle library and setting the 'proxy' option in the client configuration. ```php 'http://user-type-residential-country-US:pass@geo.g-w.info:10080' ]); $response = $client->get('https://example.com'); echo $response->getBody(); ?> ``` -------------------------------- ### Check Account Balance via API Source: https://floppydata.com/docs/proxies/troubleshooting Retrieve your account balance by making a GET request to the FloppyData API endpoint for rotating proxies. ```bash curl -H "X-Api-Key: YOUR_KEY" \ https://api.floppydata.net/v1/rotating/balance ``` -------------------------------- ### Correct Proxy Credential Formatting Source: https://floppydata.com/docs/proxies/troubleshooting Ensure there are no extra spaces in your proxy username or password. This example shows the incorrect and correct way to format a proxy string. ```python # Wrong - extra space proxy = "http://user 123:pass@geo.g-w.info:10080" # Correct proxy = "http://user123:pass@geo.g-w.info:10080" ``` -------------------------------- ### Make a Quick Request with cURL Source: https://floppydata.com/docs Use this cURL command to make a GET request to the rotating proxy balance endpoint. Remember to replace 'YOUR_API_KEY' with your actual API key. ```curl curl --request GET \ --url 'https://api.floppydata.net/v1/rotating/balance' \ --header 'X-Api-Key: YOUR_API_KEY' ``` -------------------------------- ### Implement Connection Pooling with Requests Source: https://floppydata.com/docs/proxies/troubleshooting Implement connection pooling to reuse existing connections and improve performance. This example uses the `requests` library with `HTTPAdapter` and `Retry` for robust connection management. ```python import requests from requests.adapters import HTTPAdapter from urllib3.util.retry import Retry session = requests.Session() # Connection pooling adapter = HTTPAdapter( pool_connections=10, pool_maxsize=20, max_retries=Retry(total=3, backoff_factor=1) ) session.mount('http://', adapter) session.mount('https://', adapter) session.proxies = proxies # Reuse connection for url in urls: response = session.get(url) ``` -------------------------------- ### Web Unlocker Authentication Source: https://floppydata.com/docs/authentication This section shows how to authenticate with the Web Unlocker service by passing your API key in the `X-Api-Key` header. Examples are provided for Python, Node.js, and cURL. ```APIDOC ## POST /v1/webUnlocker ### Description Authenticates with the Web Unlocker service and processes a given URL. ### Method POST ### Endpoint https://api.floppydata.net/v1/webUnlocker ### Parameters #### Request Body - **url** (string) - Required - The URL to unlock. ### Headers - **X-Api-Key** (string) - Required - Your Floppydata API key. - **Content-Type** (string) - Required - Must be `application/json`. ### Request Example ```json { "url": "https://example.com" } ``` ### Response #### Success Response (200) (Response structure not detailed in source) #### Response Example (Response example not detailed in source) ``` -------------------------------- ### Python requests Session setup Source: https://floppydata.com/docs/proxies/using-proxies Utilize a requests Session object to apply proxy settings to all subsequent requests made within that session. ```python import requests session = requests.Session() # Set proxy for all requests in this session proxy_url = "http://user-type-residential-country-US:pass@geo.g-w.info:10080" session.proxies = {'http': proxy_url, 'https': proxy_url} # All requests use the proxy response1 = session.get('https://example.com') response2 = session.get('https://example.org') ``` -------------------------------- ### Fetch Available Locations via API Source: https://floppydata.com/docs/proxies/basics Retrieve a list of available countries and cities for geo-targeting by making a GET request to the Floppydata API. Replace 'YOUR_KEY' with your actual API key. ```bash curl -H "X-Api-Key: YOUR_KEY" \ https://api.floppydata.net/v1/rotating/locations ``` -------------------------------- ### Use Async Requests with aiohttp Source: https://floppydata.com/docs/proxies/troubleshooting Leverage asynchronous requests for concurrent fetching of multiple URLs, significantly improving performance. This example uses `aiohttp` to handle async operations. ```python import asyncio import aiohttp async def fetch(session, url, proxy): async with session.get(url, proxy=proxy) as response: return await response.text() async def main(urls, proxy): async with aiohttp.ClientSession() as session: tasks = [fetch(session, url, proxy) for url in urls] return await asyncio.gather(*tasks) asyncio.run(main(urls, proxy_url)) ``` -------------------------------- ### Manage Proxy Session Parameters Source: https://floppydata.com/docs/proxies/troubleshooting Examples demonstrate how to modify the proxy username string to manage session behavior. Removing the session parameter or changing the session ID can force an IP rotation. ```python # From this proxy_username = "user123-type-residential-country-US-session-s01" # To this proxy_username = "user123-type-residential-country-US" ``` ```python # Change session ID to get new IP proxy_username = "user123-type-residential-country-US-session-s02" # New IP ``` ```python proxy_username = "user123-type-residential-country-US-rotation--1" ``` -------------------------------- ### Use Datacenter Proxies for Speed Source: https://floppydata.com/docs/proxies/troubleshooting Use datacenter proxies for faster request speeds, though they may offer lower trust. This example shows how to format the proxy username for a datacenter proxy in the US. ```python # Faster but lower trust proxy_username = "user123-type-datacenter-country-US" ``` -------------------------------- ### Playwright Python Proxy Setup Source: https://floppydata.com/docs/proxies/using-proxies Configure Playwright in Python to use a proxy server with the Chromium browser. This example uses the synchronous API. ```python from playwright.sync_api import sync_playwright with sync_playwright() as p: browser = p.chromium.launch( proxy={ 'server': 'http://geo.g-w.info:10080', 'username': 'user123-type-residential-country-US', 'password': 'your_password' } ) page = browser.new_page() page.goto('https://httpbin.org/ip') print(page.content()) browser.close() ``` -------------------------------- ### Smart Parameters Builder OpenAPI Specification Source: https://floppydata.com/docs/api-reference/endpoint/rotating-smart-params-builder This OpenAPI specification defines the GET request for the /v1/rotating/smartParamsBuilder endpoint. It details the required and optional query parameters, including proxy type, country, city, rotation interval, session ID, and protocol, along with their expected data types and examples. The response schema outlines the structure of the returned data, which includes the generated username, password placeholder, host, port, and the full connection string. ```yaml openapi: 3.1.0 info: title: FloppyData Client API description: >- API documentation for FloppyData Client API. You can manage your API keys in [account settings](https://app.floppydata.com/settings/account) version: 1.0.0 servers: - url: https://api.floppydata.net security: - apiKeyHeader: [] tags: - name: Rotating proxy description: Endpoints to gather data about rotating proxies - name: Static IPs description: Endpoints to manage static IPs - name: Web Unlocker description: |- Remove the need to develop and maintain the infrastructure. Simply extract high volume web data, and ensure scalability and reliability using web scraper API - name: Tools description: Utility endpoints for proxy-related tasks paths: /v1/rotating/smartParamsBuilder: get: tags: - Rotating proxy summary: Smart parameters builder description: >- Builds a proxy username and connection string using provided parameters. This endpoint is just a helper, you can modify the connection string in your code without calling it. UI available at [configurator](https://app.floppydata.com/proxies/credentials). operationId: getV1RotatingSmartParamsBuilder parameters: - in: query name: type schema: type: string enum: - residential - mobile - datacenter example: residential required: true description: Proxy type - in: query name: country schema: type: string minLength: 2 maxLength: 2 example: US required: true description: 2-letter country code (CCA2) - in: query name: city schema: example: New_York type: string description: City name, use underscores for spaces - in: query name: rotation schema: default: 0 example: 15 type: integer minimum: -1 maximum: 60 description: >- Rotation interval in minutes. Use -1 for a new IP on every request, 0 to keep the same IP within a session, or 1-60 to rotate after that many minutes. - in: query name: session schema: example: my_session_1 type: string maxLength: 128 description: >- A unique identifier used to create and maintain a session, enabling consistent control over IP address usage. - in: query name: protocol schema: type: string enum: - http - https - socks5 - '' example: http required: true description: Proxy protocol responses: '200': description: Successful response content: application/json: schema: type: object properties: username: type: string description: Proxy username with parameters example: >- user-USERNAME-type-residential-country-US-city-New_York-session-my_session_1-rotation-15 password: type: string description: Proxy password placeholder example: PASSWORD host: type: string description: Proxy hostname example: geo.g-w.info port: type: number description: Proxy port example: 10080 connectionString: type: string description: Full proxy connection string example: >- http://user-USERNAME-type-residential-country-US-city-New_York-session-my_session_1-rotation-15:PASSWORD@geo.g-w.info:10080 required: - username - password - host - port - connectionString components: securitySchemes: apiKeyHeader: type: apiKey in: header name: X-Api-Key ``` -------------------------------- ### Session Lifetime Example Source: https://floppydata.com/docs/proxies/basics Sessions remain active for up to 10 minutes of inactivity, with each request resetting the timer. This example illustrates the session's active period. ```text 12:00 → Request (IP A) 12:05 → Request (IP A) — session alive 12:14 → Request (IP A) — session alive 12:25 → Request (IP B) — session expired after 10min inactivity ``` -------------------------------- ### Example Mobile Proxy Username Source: https://floppydata.com/docs/proxies/browser-and-extension-setup An example of a username format for a mobile proxy, specifying type and country. Mobile proxies offer the highest trust for bypassing restrictions. ```text user123-type-mobile-country-US ``` -------------------------------- ### GET /v1/rotating/locations OpenAPI Specification Source: https://floppydata.com/docs/api-reference/endpoint/rotating-locations This OpenAPI 3.1.0 specification defines the GET /v1/rotating/locations endpoint. It outlines the request method, tags, summary, operation ID, and the structure of the successful response, including the schema for location data. ```yaml GET /v1/rotating/locations openapi: 3.1.0 info: title: FloppyData Client API description: >- API documentation for FloppyData Client API. You can manage your API keys in [account settings](https://app.floppydata.com/settings/account) version: 1.0.0 servers: - url: https://api.floppydata.net security: - apiKeyHeader: [] tags: - name: Rotating proxy description: Endpoints to gather data about rotating proxies - name: Static IPs description: Endpoints to manage static IPs - name: Web Unlocker description: |- Remove the need to develop and maintain the infrastructure. Simply extract high volume web data, and ensure scalability and reliability using web scraper API - name: Tools description: Utility endpoints for proxy-related tasks paths: /v1/rotating/locations: get: tags: - Rotating proxy summary: Available locations description: Get a list of all available proxy locations with countries and cities operationId: getV1RotatingLocations responses: '200': description: Successful response content: application/json: schema: type: array items: type: object properties: name: type: string description: Full name of the country example: United States countryCode: type: string minLength: 2 maxLength: 2 description: 2-letter country code (ISO 3166-1 alpha-2) example: US cities: type: array items: type: string description: Array of available cities in this country example: - New York - Los Angeles - Chicago required: - name - countryCode - cities description: List of available locations with countries and cities components: securitySchemes: apiKeyHeader: type: apiKey in: header name: X-Api-Key ``` -------------------------------- ### Proxy Username with Smart Parameters Source: https://floppydata.com/docs/authentication Demonstrates how to add smart parameters to the username for controlling proxy behavior. ```text USERNAME-parameter1-value1-parameter2-value2 ``` -------------------------------- ### Get Available Locations Source: https://floppydata.com/docs/api-reference/endpoint/rotating-locations Retrieves a list of all available proxy locations, categorized by country and city. ```APIDOC ## GET /v1/rotating/locations ### Description Get a list of all available proxy locations with countries and cities. ### Method GET ### Endpoint /v1/rotating/locations ### Parameters ### Request Example ### Response #### Success Response (200) - **name** (string) - Full name of the country - **countryCode** (string) - 2-letter country code (ISO 3166-1 alpha-2) - **cities** (array) - Array of available cities in this country #### Response Example { "example": "[\n {\n \"name\": \"United States\",\n \"countryCode\": \"US\",\n \"cities\": [\n \"New York\",\n \"Los Angeles\",\n \"Chicago\" ] }\n]" } ``` -------------------------------- ### Get Traffic Usage Statistics Source: https://floppydata.com/docs/api-reference/endpoint/rotating-statistics Fetches traffic usage statistics for rotating proxies. Statistics are updated hourly. ```APIDOC ## GET /v1/rotating/statistics ### Description Traffic usage statistics updated hourly. ### Method GET ### Endpoint /v1/rotating/statistics ### Parameters #### Query Parameters - **from** (string) - Optional - Start date or datetime in RFC 3339 format - **to** (string) - Optional - End date or datetime in RFC 3339 format - **poolId** (number) - Optional - ID of the proxy pool. - **proxyType** (string) - Optional - If omitted all proxy types will be included. Allowed values: residential, mobile, datacenter. - **countryCode** (string) - Optional - 2-letter country code (CCA2). If ommited all countries will be included ### Response #### Success Response (200) - **total_bytes** (number) - Total traffic used - **total_gb** (number) - Total traffic used in gigabytes - **tx_bytes** (number) - Outcoming traffic - **rx_bytes** (number) - Incoming traffic ### Request Example ```json { "example": "request body" } ``` ### Response Example ```json { "total_bytes": 10737418240, "total_gb": 10, "tx_bytes": 5368709120, "rx_bytes": 5368709120 } ``` ``` -------------------------------- ### Get Current IP Address Source: https://floppydata.com/docs/authentication Use this command to retrieve your current public IP address, which may be needed for IP whitelisting. ```bash curl https://api.ipify.org ``` -------------------------------- ### Ruby Net::HTTP Proxy Example Source: https://floppydata.com/docs/proxies/using-proxies Utilize Ruby's built-in Net::HTTP library to route requests through a proxy. Requires parsing the proxy URI and providing host, port, user, and password to Net::HTTP.start. ```ruby require 'net/http' require 'uri' proxy_uri = URI.parse('http://user-type-residential-country-US:pass@geo.g-w.info:10080') Net::HTTP.start( 'example.com', 80, proxy_uri.host, proxy_uri.port, proxy_uri.user, proxy_uri.password ) do |http| response = http.get('/') puts response.body end ``` -------------------------------- ### Build Smart Parameters Username Source: https://floppydata.com/docs/guides/rotating-proxy Construct a username with smart parameters for proxy requests. Supported parameters include type, country, city, rotation, session, and protocol. Rotation -1 requests a new IP per request, 0 keeps the same IP within a session, and 1-60 rotates after that many minutes. ```bash curl --request GET \ --url "$FLOPPY_BASE_URL/v1/rotating/smartParamsBuilder?type=residential&country=US&city=New_York&rotation=15&protocol=http" \ --header "X-Api-Key: $FLOPPY_API_KEY" ``` -------------------------------- ### PHP cURL Proxy Example Source: https://floppydata.com/docs/proxies/using-proxies Use cURL in PHP to make HTTP requests through a proxy. Requires setting proxy URL and credentials. ```php ``` -------------------------------- ### Extract First Connection Values Source: https://floppydata.com/docs/guides/static-ips This command fetches the static IP list and then uses jq to extract the host, port, username, and password for the first IP in the list. This is useful for quickly obtaining connection details for a single static IP. ```bash curl --silent \ --url "$FLOPPY_BASE_URL/v1/static/list" \ --header "X-Api-Key: $FLOPPY_API_KEY" | jq '.ip_list[0] | {host, port, username, password}' ``` -------------------------------- ### Get Proxy Statistics via API Source: https://floppydata.com/docs/proxies/troubleshooting Fetch statistics related to your proxy usage, such as concurrent connection limits, by querying the FloppyData API. ```bash curl -H "X-Api-Key: YOUR_KEY" \ https://api.floppydata.net/v1/rotating/statistics ``` -------------------------------- ### Verify Proxy Host and Port Configuration Source: https://floppydata.com/docs/proxies/troubleshooting Ensure your proxy URL correctly specifies the host and port. Incorrect values are a common cause of connection refused errors. ```python # Correct proxy = "http://user:pass@geo.g-w.info:10080" # Wrong - don't use these # geo.g-w.com (wrong domain) # floppydata.com (wrong domain) # port 8080 (wrong port) ``` -------------------------------- ### Smart Parameters Credentials Source: https://floppydata.com/docs/llms.txt Returns the username and password for the rotating proxy. ```APIDOC ## GET /api-reference/endpoint/rotating-smart-params-credentials.md ### Description Returns the username and password for the rotating proxy. ### Method GET ### Endpoint /api-reference/endpoint/rotating-smart-params-credentials.md ``` -------------------------------- ### Playwright Firefox Proxy Setup Source: https://floppydata.com/docs/proxies/using-proxies Configure Playwright's Firefox browser to use a proxy server. Note the different session identifier for Firefox. ```javascript const { firefox } = require('playwright'); (async () => { const browser = await firefox.launch({ proxy: { server: 'http://geo.g-w.info:10080', username: 'user123-type-residential-country-US-session-ff01', password: 'your_password' } }); const context = await browser.newContext(); const page = await context.newPage(); await page.goto('https://example.com'); const title = await page.title(); console.log(title); await browser.close(); })(); ``` -------------------------------- ### List Static IPs Source: https://floppydata.com/docs/guides/static-ips Use this command to retrieve an inventory of all allocated static IPs and the count of pending IPs. Ensure your API key is set as an environment variable. ```bash curl --request GET \ --url "$FLOPPY_BASE_URL/v1/static/list" \ --header "X-Api-Key: $FLOPPY_API_KEY" ``` -------------------------------- ### Get Available Traffic Source: https://floppydata.com/docs/api-reference/endpoint/rotating-balance Retrieves the available traffic balance for a user, categorized by type (residential, mobile, datacenter). It includes details on subscription-based and non-expiring traffic. ```APIDOC ## GET /balance/traffic ### Description Retrieves the available traffic balance for a user, categorized by type (residential, mobile, datacenter). It includes details on subscription-based and non-expiring traffic. ### Method GET ### Endpoint /balance/traffic ### Parameters #### Query Parameters - **X-Api-Key** (string) - Required - API key for authentication. ### Response #### Success Response (200) - **subscription** (object) - Required - Details about subscription traffic. - **expiresOn** (string) - Required - The expiration date of the subscription traffic. - **bytes** (number) - Required - The remaining traffic in bytes. - **gb** (number) - Required - The remaining traffic in gigabytes. - **nonExpiring** (object) - Required - Details about non-expiring traffic. - **bytes** (number) - Required - The available non-expiring traffic in bytes. - **gb** (number) - Required - The available non-expiring traffic in gigabytes. #### Response Example ```json { "subscription": { "expiresOn": "2024-12-31T23:59:59Z", "bytes": 10737418240, "gb": 10 }, "nonExpiring": { "bytes": 5368709120, "gb": 5 } } ``` ``` -------------------------------- ### Configure Chrome Proxy with Selenium Source: https://floppydata.com/docs/proxies/using-proxies Set up a proxy server for Chrome using Selenium. This method directly configures the proxy server address and injects authentication headers via CDP commands. ```python from selenium import webdriver from selenium.webdriver.chrome.options import Options PROXY_USER = "user123-type-residential-country-US" PROXY_PASS = "your_password" PROXY_HOST = "geo.g-w.info:10080" chrome_options = Options() # Configure proxy chrome_options.add_argument(f'--proxy-server=http://{PROXY_HOST}') # Create driver driver = webdriver.Chrome(options=chrome_options) # Authenticate (inject script) driver.execute_cdp_cmd('Network.enable', {}) driver.execute_cdp_cmd('Network.setExtraHTTPHeaders', { 'headers': { 'Proxy-Authorization': f'Basic {PROXY_USER}:{PROXY_PASS}' } }) # Use driver driver.get('https://httpbin.org/ip') print(driver.page_source) driver.quit() ```