Registry / devops / axios-impersonate-adapter

axios-impersonate-adapter

JSON →
library1.1.3jsnpmunverified

Axios adapter that uses curl-impersonate to send HTTP requests, mimicking browser TLS fingerprints. Version 1.1.3 is the latest stable release, with TypeScript types included. Unlike standard axios adapters, it shells out to a bundled curl-impersonate binary, providing realistic browser impersonation (e.g., Chrome 146) for web scraping and anti-bot evasion. Supports cookie persistence via tough-cookie. Updated irregularly.

npm install axios-impersonate-adapter
INSTALL
IMPORT
SIG · AXIOS-IMPERSONATE-
A
axios-impersonate-adapter
devopsjavascriptv1.1.3
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default export (adapter)
import adapter from 'axios-impersonate-adapter'
const adapter = require('axios-impersonate-adapter')
Package is ESM-only; default export is the adapter function.
Type augmentation
import 'axios-impersonate-adapter'
null
Augments AxiosRequestConfig with 'impersonate' property. Add this import to enable TypeScript support.

Creates an axios client with the impersonate adapter using Chrome 146 profile and makes a GET request.

import axios from 'axios'; import adapter from 'axios-impersonate-adapter'; const client = axios.create({ adapter, impersonate: 'chrome146', }); const res = await client.get('https://example.com', { params: { q: 'test' }, }); console.log(res.status, res.data);
Debug
Known issues
breakingThe adapter shells out to a bundled binary (curl-impersonate), which may not be available on all platforms (e.g., Windows).
fix
Ensure the binary is present or run on Linux/macOS. Future versions may offer a native alternative.
affects: >=1.0.0
gotchaThe `impersonate` option defaults to the latest bundled Chrome profile if omitted. This default may change across versions.
fix
Always explicitly set `impersonate` to a specific browser profile to avoid unexpected behavior.
affects: >=1.0.0
gotchaIf the request only has the default axios 'Accept' header ('application/json, text/plain, */*'), the adapter removes it to apply the impersonate default. This may change header behavior.
fix
Set custom headers explicitly if you want to override the impersonate defaults.
affects: >=1.0.0
deprecatedCookie jar support is currently working but the roadmap mentions migrating away from spawn-based execution, which may change the API.
fix
Keep an eye on releases for breaking changes to cookie handling.
affects: >=1.1.0
gotchaThe `maxRedirects` option behavior differs from default axios: undefined means follow redirects (default in curl-impersonate), while a number enables --max-redirs.
fix
Set maxRedirects explicitly if you need to limit redirects; omitting may lead to unlimited redirects.
affects: >=1.0.0
Errors
Common errors & fixes
Error: spawn /path/to/curl-impersonate ENOENT
curl-impersonate binary not found or not installed correctly
fix
Reinstall with 'npm install' and verify the binary exists. On some systems, you may need to install curl-impersonate manually.
TypeError: adapter is not a function
Using CommonJS require instead of ESM import
fix
Use 'import adapter from ...' or enable ESM in your project (type: 'module' in package.json).
Property 'impersonate' does not exist on type 'AxiosRequestConfig'
Type augmentation not imported
fix
Add 'import "axios-impersonate-adapter";' to your TypeScript file.
Request failed with status 403 (Forbidden) or 503
The impersonation profile may be detected or the site blocks CLIs.
fix
Try a different browser profile (e.g., 'chrome146') or update to the latest version for better fingerprints.
Upgrade
Version history
1.1.3latest on npm
Audit
Dependencies
axiosrequiredPeer dependency; adapter extends axios request config.
tough-cookieoptionalRequired for cookie jar support.
Agent activity
16 hits · last 30 days
node
14
OpenAI (training)
2
Resources
axios-impersonate-adapter — npm install axios-impersonate-adapter · libregistry