GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - apify/impit: impit | rust library for browser impersonation

BranchesTags
Open more actions menu

Latest commit

 

History

593 Commits
593 Commits

Folders and files

NameName
Last commit message
Last commit date
.cargo
.cargo
 
 
.devcontainer
.devcontainer
 
 
.github
.github
 
 
benchmarks
benchmarks
 
 
impit-node
impit-node
 
 
impit-python
impit-python
 
 
impit
impit
 
 
.editorconfig
.editorconfig
 
 
.gitignore
.gitignore
 
 
Cargo.lock
Cargo.lock
 
 
Cargo.toml
Cargo.toml
 
 
LICENSE.md
LICENSE.md
 
 
README.md
README.md
 
 
cliff.toml
cliff.toml
 
 
renovate.json
renovate.json
 
 

Repository files navigation

impit | browser impersonation made simple

impit is a rust library that allows you to impersonate a browser and make requests to websites. It is built on top of reqwest, rustls and tokio and supports HTTP/1.1, HTTP/2, and HTTP/3.

The library provides a simple API for making requests to websites, and it also allows you to customize the request headers, use proxies, custom timeouts and more.

use impit::cookie::Jar;
use impit::{impit::Impit, fingerprint::database as fingerprints};

#[tokio::main]
async fn main() {
    let impit = Impit::<Jar>::builder()
        .with_fingerprint(fingerprints::firefox_144::fingerprint())
        .build()
        .unwrap();

    let response = impit
        .get(String::from("https://example.com"), None, None)
        .await;

    match response {
        Ok(response) => {
            println!("{}", response.text().await.unwrap());
        }
        Err(e) => {
            println!("{:#?}", e);
        }
    }
}

Comparison

Median of 11 runs of 2000 sequential requests to a local HTTP/2 server, 1 KiB JSON responses over one warm connection. Profiles counts the impersonation targets each API exposes.

Python

Package req/s Wheel Profiles Backend
primp 7546 6.6 MB n/a Rust
rnet 6801 3.7 MB 75 Rust
impit 5898 5.2 MB 20 Rust
curl_cffi 3259 14.1 MB 47 C (libcurl)
tls-client 2271 8.5 MB 83 Go
httpx (no impersonation) 1976 0.1 MB — Python

Node.js

Package req/s Install Profiles Backend
impit 2280 10.8 MB 21 Rust
got-scraping 1956 4.9 MB 3 Node.js TLS
cycletls 471 133.0 MB raw JA3 Go subprocess
undici (no impersonation) 7022 2.2 MB — Node.js

Measured by benchmarks/ on linux-x64, 2026-11-01. Rerun it on your own hardware.

Other projects

If you'd prefer to use impit from a Node.js application, check out the impit-node folder, or download the package from npm:

npm install impit

The interface is the same as the native fetch.

import { Impit } from 'impit';

// Set up the Impit instance
const impit = new Impit({
    browser: "chrome", // or "firefox"
    proxyUrl: "http://localhost:8080",
    ignoreTlsErrors: true,
});

// Use the `fetch` method as you would with the built-in `fetch` function
const response = await impit.fetch("https://example.com");

console.log(response.status);
console.log(response.headers);
console.log(await response.text());
// console.log(await response.json());
// ...

Usage from Rust

Technically speaking, the impit project is a somewhat thin wrapper around reqwest that provides a more ergonomic API for making requests to websites. The real strength of impit is that it uses patched versions of rustls and other libraries that allow it to make browser-like requests.

Note that if you want to use this library in your rust project, you have to add the following dependencies to your Cargo.toml file:

[dependencies]
impit = { git="https://github.com/apify/impit.git", branch="master" }

[patch.crates-io]
rustls = { git="https://github.com/apify/rustls.git" }
h2 = { git="https://github.com/apify/h2.git" }

Without the patched dependencies, the project won't build.

HTTP/3 support is behind the http3 feature (impit = { ..., features = ["http3"] }). With it, you also have to build your project with rustflags = "--cfg reqwest_unstable", otherwise, the build will fail. This is because HTTP/3 support in reqwest is unstable, so it's not available in the stable version of the library.

About

impit | rust library for browser impersonation

apify.github.io/impit/js

Resources

Readme
Apache-2.0 license
Activity
Custom properties

Stars

639 stars

Watchers

7 watching

Forks

51 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.