{"id":18710701,"url":"https://github.com/apify/fingerprint-generator","last_synced_at":"2025-11-03T16:30:58.765Z","repository":{"id":44761665,"uuid":"350313206","full_name":"apify/fingerprint-generator","owner":"apify","description":"Generates realistic browser fingerprints","archived":false,"fork":false,"pushed_at":"2022-07-25T12:58:21.000Z","size":8067,"stargazers_count":75,"open_issues_count":0,"forks_count":15,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-04-11T22:11:26.315Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/apify.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-03-22T11:12:34.000Z","updated_at":"2025-04-09T09:01:09.000Z","dependencies_parsed_at":"2022-08-29T22:51:23.206Z","dependency_job_id":null,"html_url":"https://github.com/apify/fingerprint-generator","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apify%2Ffingerprint-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apify%2Ffingerprint-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apify%2Ffingerprint-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apify%2Ffingerprint-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apify","download_url":"https://codeload.github.com/apify/fingerprint-generator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248560411,"owners_count":21124650,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T12:35:19.383Z","updated_at":"2025-11-03T16:30:58.730Z","avatar_url":"https://github.com/apify.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# (DEPRECATED) Fingerprint generator\n\n---\n\n**DEPRECATED** The `fingerprint-generator` package now lives in the [fingerprint-suite](https://github.com/apify/fingerprint-suite) repository. This repository is no longer actively maintained.\n\n---\n\nNodeJs package for generating realistic browser fingerprints and matching headers.\n\nWorks best with the [Fingerprint injector](https://github.com/apify/fingerprint-injector).\n\n\u003c!-- toc --\u003e\n\n- [Installation](#installation)\n- [Usage](#usage)\n- [Result example](#result-example)\n- [API Reference](#api-reference)\n\n\u003c!-- tocstop --\u003e\n\n## Installation\nRun the `npm install fingerprint-generator` command. No further setup is needed afterwards.\n## Usage\nTo use the generator, you need to create an instance of the `FingerprintGenerator` class which is exported from this package. Constructor of this class accepts a `HeaderGeneratorOptions` object, which can be used to globally specify what kind of fingerprint and headers you are looking for:\n```js\nconst FingerprintGenerator = require('fingerprint-generator');\nlet fingerprintGenerator = new FingerprintGenerator({\n        browsers: [\n            {name: \"firefox\", minVersion: 80},\n            {name: \"chrome\", minVersion: 87},\n            \"safari\"\n        ],\n        devices: [\n            \"desktop\"\n        ],\n        operatingSystems: [\n            \"windows\"\n        ]\n});\n```\nYou can then get the fingerprint and headers using the `getFingerprint` method, either with no argument, or with another `HeaderGeneratorOptions` object, this time specifying the options only for this call (overwriting the global options when in conflict) and using the global options specified beforehands for the unspecified options:\n```js\nlet { fingerprint, headers } = fingerprintGenerator.getFingerprint({\n        operatingSystems: [\n            \"linux\"\n        ],\n        locales: [\"en-US\", \"en\"]\n});\n```\nThis method always generates a random realistic fingerprint and a matching set of headers, excluding the request dependant headers, which need to be filled in afterwards. Since the generation is randomized, multiple calls to this method with the same parameters can generate multiple different outputs.\n## Result example\nFingerprint that might be generated for the usage example above:\n```json\n{\n  \"userAgent\": \"Mozilla/5.0 (X11; Linux x86_64; rv:90.0) Gecko/20100101 Firefox/90.0\",\n  \"cookiesEnabled\": true,\n  \"timezone\": \"Europe/Prague\",\n  \"timezoneOffset\": -60,\n  \"audioCodecs\": {\n    \"ogg\": \"probably\",\n    \"mp3\": \"maybe\",\n    \"wav\": \"probably\",\n    \"m4a\": \"maybe\",\n    \"aac\": \"maybe\"\n  },\n  \"videoCodecs\": {\n    \"ogg\": \"probably\", \n    \"h264\": \"probably\", \n    \"webm\": \"probably\"\n  },\n  \"videoCard\": [\n    \"Intel Open Source Technology Center\",\n    \"Mesa DRI Intel(R) HD Graphics 4600 (HSW GT2)\"\n  ],\n  \"productSub\": \"20100101\",\n  \"hardwareConcurrency\": 8,\n  \"multimediaDevices\": { \n    \"speakers\": 0, \n    \"micros\": 0, \n    \"webcams\": 0\n  },\n  \"platform\": \"Linux x86_64\",\n  \"pluginsSupport\": true,\n  \"screenResolution\": [ 1920, 1080 ],\n  \"availableScreenResolution\": [ 1920, 1080 ],\n  \"colorDepth\": 24,\n  \"touchSupport\": { \n    \"maxTouchPoints\": 0, \n    \"touchEvent\": false, \n    \"touchStart\": false\n  },\n  \"languages\": [ \"en-US\", \"en\" ]\n}\n```\nAnd the matching headers:\n```json\n{\n  \"user-agent\": \"Mozilla/5.0 (X11; Linux x86_64; rv:90.0) Gecko/20100101 Firefox/90.0\",\n  \"accept\": \"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8\",\n  \"accept-language\": \"en-US,en;q=0.9\",\n  \"accept-encoding\": \"gzip, deflate, br\",\n  \"upgrade-insecure-requests\": \"1\",\n  \"te\": \"trailers\"\n}\n```\n## API Reference\nAll public classes, methods and their parameters can be inspected in this API reference.\n\n\u003ca name=\"FingerprintGenerator\"\u003e\u003c/a\u003e\n\n### FingerprintGenerator\nFingerprint generator - randomly generates realistic browser fingerprints\n\n\n* [FingerprintGenerator](#FingerprintGenerator)\n    * [`new FingerprintGenerator(options)`](#new_FingerprintGenerator_new)\n    * [`.getFingerprint(options, requestDependentHeaders)`](#FingerprintGenerator+getFingerprint)\n\n\n* * *\n\n\u003ca name=\"new_FingerprintGenerator_new\"\u003e\u003c/a\u003e\n\n#### `new FingerprintGenerator(options)`\n\n| Param | Type | Description |\n| --- | --- | --- |\n| options | [\u003ccode\u003eHeaderGeneratorOptions\u003c/code\u003e](#HeaderGeneratorOptions) | default header generation options used unless overridden |\n\n\n* * *\n\n\u003ca name=\"FingerprintGenerator+getFingerprint\"\u003e\u003c/a\u003e\n\n#### `fingerprintGenerator.getFingerprint(options, requestDependentHeaders)`\nGenerates a fingerprint and a matching set of ordered headers using a combination of the default options specified in the constructor\nand their possible overrides provided here.\n\n\n| Param | Type | Description |\n| --- | --- | --- |\n| options | [\u003ccode\u003eHeaderGeneratorOptions\u003c/code\u003e](#HeaderGeneratorOptions) | specifies options that should be overridden for this one call |\n| requestDependentHeaders | \u003ccode\u003eObject\u003c/code\u003e | specifies known values of headers dependent on the particular request |\n\n\n* * *\n\n\u003ca name=\"BrowserSpecification\"\u003e\u003c/a\u003e\n\n### `BrowserSpecification`\n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | \u003ccode\u003estring\u003c/code\u003e | One of `chrome`, `firefox` and `safari`. |\n| minVersion | \u003ccode\u003enumber\u003c/code\u003e | Minimal version of browser used. |\n| maxVersion | \u003ccode\u003enumber\u003c/code\u003e | Maximal version of browser used. |\n| httpVersion | \u003ccode\u003estring\u003c/code\u003e | Http version to be used to generate headers (the headers differ depending on the version).  Either 1 or 2. If none specified the httpVersion specified in `HeaderGeneratorOptions` is used. |\n\n\n* * *\n\n\u003ca name=\"HeaderGeneratorOptions\"\u003e\u003c/a\u003e\n\n### `HeaderGeneratorOptions`\n\n| Param | Type | Description |\n| --- | --- | --- |\n| browsers | \u003ccode\u003eArray.\u0026lt;(BrowserSpecification\\|string)\u0026gt;\u003c/code\u003e | List of BrowserSpecifications to generate the headers for,  or one of `chrome`, `firefox` and `safari`. |\n| operatingSystems | \u003ccode\u003eArray.\u0026lt;string\u0026gt;\u003c/code\u003e | List of operating systems to generate the headers for.  The options are `windows`, `macos`, `linux`, `android` and `ios`. |\n| devices | \u003ccode\u003eArray.\u0026lt;string\u0026gt;\u003c/code\u003e | List of devices to generate the headers for. Options are `desktop` and `mobile`. |\n| locales | \u003ccode\u003eArray.\u0026lt;string\u0026gt;\u003c/code\u003e | List of at most 10 languages to include in the  [Accept-Language](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Language) request header  in the language format accepted by that header, for example `en`, `en-US` or `de`. |\n| httpVersion | \u003ccode\u003estring\u003c/code\u003e | Http version to be used to generate headers (the headers differ depending on the version).  Can be either 1 or 2. Default value is 2. |\n\n\n* * *\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapify%2Ffingerprint-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapify%2Ffingerprint-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapify%2Ffingerprint-generator/lists"}