Skip to main content
The Fetcher class provides fast HTTP requests with browser impersonation capabilities. Built on curl_cffi, it supports HTTP/1.1, HTTP/2, and HTTP/3 with automatic TLS fingerprint spoofing.

Basic Usage

One-Off Requests

Use the static methods for simple, one-off requests:

With FetcherSession

For multiple requests to the same domain, use FetcherSession to maintain cookies and connection pooling:

Key Features

Browser Impersonation

Impersonate real browser TLS fingerprints to avoid detection:
Supported browsers: chrome, firefox135, safari, edge, and more.

Stealthy Headers

Automatic generation of realistic browser headers:
This generates:
  • Realistic User-Agent
  • Accept headers matching the browser
  • Accept-Language
  • Referer from Google search (optional)

HTTP/3 Support

HTTP/3 may cause issues when combined with impersonate. Use one or the other.

Request Parameters

GET Request

POST/PUT/DELETE Request

Session Configuration

Default Settings

Configure default settings for all requests in a session:

Proxy Configuration

Async Support

FetcherSession supports both sync and async contexts:

Error Handling

The fetcher automatically retries on failure. Proxy-related errors are detected and logged.

Response Object

All requests return a Response object with the parsed HTML:

Best Practices

Always use FetcherSession when making multiple requests to the same domain. This maintains cookies and improves performance through connection pooling.
Set stealthy_headers=True to automatically generate realistic browser headers and avoid simple bot detection.
The default impersonate='chrome' works for most cases. Use a list to randomly rotate between browsers.
Configure retries and retry_delay based on your target’s rate limits. Higher values are better for unstable connections.

Comparison with Other Fetchers

Next Steps

Stealthy Mode

Bypass anti-bot systems with StealthyFetcher

Sessions

Learn about persistent sessions

Proxy Rotation

Rotate proxies automatically