Skip to main content

LangChain ProxyClaw Integration

PyPI version License: MIT

Official LangChain integration for ProxyClaw - a residential proxy network with 10M+ IPs across 111+ countries.

Overview

This package provides LangChain Tools for routing HTTP requests through ProxyClaw's residential proxy network, enabling AI agents to scrape websites with:

  • 🌍 Global IP coverage - 111+ countries
  • 🔄 Automatic rotation - Fresh IPs per request or sticky sessions
  • 🛡️ Anti-detection - Built-in fingerprint spoofing
  • ⚡ High success rate - Residential IPs bypass most blocks

Installation

pip install langchain-proxyclaw

For development:

pip install langchain-proxyclaw[dev]

Quick Start

from langchain_proxyclaw import ProxyClawTool
from langchain.agents import AgentType, initialize_agent
from langchain_openai import ChatOpenAI

# Initialize the tool
tool = ProxyClawTool(api_key="your_api_key")

# Use with an agent
llm = ChatOpenAI(temperature=0)
agent = initialize_agent(
    [tool],
    llm,
    agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION,
    verbose=True
)

# Ask the agent to scrape a website
agent.run("Get the content from https://example.com using a US proxy")

Tools

1. ProxyClawTool

Basic HTTP requests through ProxyClaw proxies.

from langchain_proxyclaw import ProxyClawTool

tool = ProxyClawTool(api_key="your_api_key")

# Simple GET request
result = tool.invoke({
    "url": "https://example.com",
    "country": "US"
})

# POST request with data
result = tool.invoke({
    "url": "https://api.example.com/data",
    "method": "POST",
    "data": {"key": "value"},
    "headers": {"Authorization": "Bearer token"},
    "country": "GB"
})

Parameters:

  • url (str, required): Target URL
  • method (str): HTTP method (GET, POST, PUT, DELETE) - default: GET
  • headers (dict): Optional HTTP headers
  • data (str/dict): Request body data
  • country (str): Country code for proxy location (e.g., "US", "GB", "DE")
  • session_id (str): Session ID for sticky sessions

2. ProxyClawSessionTool

Sticky proxy sessions for multi-step workflows.

from langchain_proxyclaw import ProxyClawSessionTool

tool = ProxyClawSessionTool(api_key="your_api_key")

# Scrape multiple pages with the same IP
result = tool.invoke({
    "urls": [
        "https://site.com/login",
        "https://site.com/dashboard",
        "https://site.com/profile"
    ],
    "country": "US"
})

Parameters:

  • urls (list[str], required): List of URLs to fetch
  • country (str): Country code
  • session_lifetime (int): Session duration in minutes - default: 30

3. ProxyClawScraperTool

Advanced scraper with retries and auto-rotation.

from langchain_proxyclaw import ProxyClawScraperTool

tool = ProxyClawScraperTool(api_key="your_api_key")

# Scrape with retries and link extraction
result = tool.invoke({
    "url": "https://example.com/products",
    "country": "US",
    "retries": 3,
    "timeout": 30,
    "extract_links": True
})

Parameters:

  • url (str, required): Target URL
  • country (str): Country code
  • retries (int): Number of retry attempts - default: 3
  • timeout (int): Request timeout in seconds - default: 30
  • extract_links (bool): Extract all links from the page - default: False

Authentication

Get your API key from ProxyClaw Dashboard:

api_key = "pk_live_xxxxxxxxxxxxxxxx"

Country Codes

Common country codes:

  • US - United States
  • GB - United Kingdom
  • DE - Germany
  • FR - France
  • JP - Japan
  • IN - India
  • BR - Brazil

Full list: 111+ countries supported. Use ISO 3166-1 alpha-2 codes.

Use Cases

Web Scraping for AI Agents

from langchain_proxyclaw import ProxyClawScraperTool
from langchain.agents import AgentType, initialize_agent

scraper = ProxyClawScraperTool(api_key="your_api_key")

agent = initialize_agent(
    [scraper],
    llm,
    agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION
)

# Agent can now scrape without being blocked
agent.run("Find pricing information from https://competitor.com/pricing")

E-commerce Monitoring

session_tool = ProxyClawSessionTool(api_key="your_api_key")

# Same IP for login + price check
result = session_tool.invoke({
    "urls": [
        "https://shop.com/login",
        "https://shop.com/product/123"
    ],
    "country": "US"
})

Market Research

from langchain_proxyclaw import ProxyClawTool

tool = ProxyClawTool(api_key="your_api_key")

# Check how a site appears from different countries
for country in ["US", "GB", "DE", "JP"]:
    result = tool.invoke({
        "url": "https://global-site.com",
        "country": country
    })
    print(f"{country}: {result}")

LangChain Integration Tests

To run LangChain's standard integration tests:

pip install langchain-proxyclaw[dev]
pytest tests/ -v

Documentation

Full documentation: docs.proxyclaw.ai

LangChain docs: python.langchain.com

API Reference

See ProxyClaw API Docs for details on:

  • Authentication formats
  • Country targeting
  • Session management
  • Bandwidth tracking

Pricing

ProxyClaw uses pay-as-you-go pricing:

  • $0.35/GB under 10TB
  • $0.25/GB over 10TB

No minimums, no commitments. Sign up

Support

License

MIT License - see LICENSE file.

Contributing

Contributions welcome! See CONTRIBUTING.md for guidelines.


Built with ❤️ by the IPLoop team.

Metadata

Release files for langchain-proxyclaw 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for langchain-proxyclaw 0.1.0
File Size Uploaded Provenance
langchain_proxyclaw-0.1.0.tar.gz 8.5 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for langchain-proxyclaw 0.1.0
File Interpreter ABI Platform
langchain_proxyclaw-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 17.0 kB

Release files / langchain_proxyclaw-0.1.0.tar.gz

Download URL langchain_proxyclaw-0.1.0.tar.gz
Size 8.5 kB
Tags Source
SHA-256 checksum
How to use checksums
b37e540798390be4f66e9e0a3f57a361629a1fc15acdcbb1de645829c4f6171c
BLAKE2b-256 checksum
How to use checksums
44cb6a078528e67a4a875a106819431dc8f6ab7a0dc9fbc246502e85e45c892a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / langchain_proxyclaw-0.1.0-py3-none-any.whl

Download URL langchain_proxyclaw-0.1.0-py3-none-any.whl
Size 8.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
aef126afc199581950ef1d4108fd923512963c2c51422c563645d9da3d5c36fc
BLAKE2b-256 checksum
How to use checksums
5ff4831c62bdf96ab6920aaa915ca686138f2300ccaf39087964b2ac2ef64475
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Security for langchain-proxyclaw 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page