# pygologin - GoLogin Python SDK
This package provides functionality to run and stop GoLogin profiles with python and then connect the profiles to automation tools like Selenium, Puppetteer, Playwright etc.
## Check full gologin documentations <a href="https://gologin.com/docs/api-reference/introduction/quickstart" target="_blank">here</a>.
# How does it work?
1. You give SDK your dev token and profile id that you want to run
2. SDK takes care of downloading, preparing your profile and starts the browser
3. SDK gives you websocket url for automation tools
4. You take this websocker url and connect it to the automation tool on your choice: Puppetteer, Selenium, Playwright etc
5. Automation tool connects to browser and you can manage it through code
## Getting Started
Where is token? API token is <a href="https://app.gologin.com/#/personalArea/TokenApi" target="_blank">here</a>.

### Installation
`pip3 install gologin`
for base case - we use selenium as it is the most popular tool
`pip3 install -r requirements.txt`
### Example "gologin-selenium.py"
```py
import time
from gologin import GoLogin
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from webdriver_manager.chrome import ChromeDriverManager
profile_id = "Your profile id"
# Initialize GoLogin
gl = GoLogin({
"token": "Your token",
"profile_id": profile_id
})
# Start Browser and get websocket url
debugger_address = gl.start()
# Get Chromium version for webdriver
chromium_version = gl.get_chromium_version()
# Add proxy to profile
gl.addGologinProxyToProfile(profile_id, "us")
# Install webdriver
service = Service(ChromeDriverManager(driver_version=chromium_version).install())
chrome_options = webdriver.ChromeOptions()
chrome_options.add_experimental_option("debuggerAddress", debugger_address)
driver = webdriver.Chrome(service=service, options=chrome_options)
# Give command to Selenium to open the page
driver.get("http://www.python.org")
time.sleep(30)
driver.quit()
time.sleep(10)
gl.stop()
```
### Running example:
`python3 examples/selenium/one-time-use-profile.py`
###
### Methods
#### constructor - initiate your token, profile that you want to run and browser params
Required options:
- `token` <[string]> **Required** - your API <a href="https://gologin.com/#/personalArea/TokenApi" target="_blank">token</a>
- `profile_id` <[string]> **Required** - profile ID (NOT PROFILE NAME)
Optional options:
- `executablePath` <[string]> path to executable Orbita file. Orbita will be downloaded automatically if not specified
- `extra_params` arrayof <[string]> additional flags for browser start. For example: '--headles', '--load-extentions=path/to/extension'
- `uploadCookiesToServer` <[boolean]> upload cookies to server after profile stopping (default false). It allows you to export cookies from api later.
- `writeCookesFromServer` <[boolean]> if you have predefined cookies and you want browser to import it (default true).
```py
gl = GoLogin({
"token": "your token",
"profile_id": "your profile id",
"extra_params": ["--headless", "--load-extentions=path/to/extension"]
})
```
#### createProfileRandomFingerprint - you pass os ('lin', 'win', 'mac') and profile name and we give you brand new shiny profile
```py
gl = GoLogin({
"token": "your token",
})
profile = gl.createProfileRandomFingerprint({"os": "lin", "name": "some name"})
gl.setProfileId(profile['id'])
```
#### createProfileWithCustomParams - This method creates a profile and you can pass any particular params to it. Full list of params you can find here - https://api.gologin.com/docs
```py
gl = GoLogin({
"token": "your token",
})
profile = gl.createProfileWithCustomParams({
"os": "lin",
"name": "some name",
"navigator": {
"userAgent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36",
"resolution": "1920x1080",
"language": "en-US",
"platform": "Linux x86_64",
"hardwareConcurrency": 8,
"deviceMemory": 8,
"maxTouchPoints": 0
}
})
gl.setProfileId(profile['id'])
```
#### updateUserAgentToLatestBrowser - user agent is one of the most important thing in your fingerprint. It decides which browser version to run. This method help you to keep useragent up to date.
```py
gl = GoLogin({
"token": "your token",
})
gl.updateUserAgentToLatestBrowser(["profineId1", "profileId2"], "workspceId(optional)")
```
#### addGologinProxyToProfile - Gologin provides high quality proxies with free traffic for paid users. Here you can add gologin proxy to profile, just pass country code
```py
gl = GoLogin({
"token": "your token",
})
gl.addGologinProxyToProfile("profileId", "us")
```
#### addCookiesToProfile - You can pass cookies to the profile and browser will import it before starting
```py
gl = GoLogin({
"token": "your token",
})
gl.addCookiesToProfile("profileId", [
{
"name": "session_id",
"value": "abc123",
"domain": "example.com",
"path": "/",
"expirationDate": 1719161018.307793,
"httpOnly": True,
"secure": True
},
{
"name": "user_preferences",
"value": "dark_mode",
"domain": "example.com",
"path": "/settings",
"sameSite": "lax"
}
])
```
#### refreshProfilesFingerprint - Replaces your profile fingerprint with a new one
```py
gl = GoLogin({
"token": "your token",
})
gl.refreshProfilesFingerprint(["profileId1", "profileId2"])
```
#### changeProfileProxy - allows you to set a proxy to a profile
```py
gl = GoLogin({
"token": "your token",
})
gl.changeProfileProxy("profileId", { "mode": "http", "host": "somehost.com", "port": 109, "username": "someusername", "password": "somepassword"})
```
#### start() - prepares profile, starts browser and returns websocket url
```py
gl = GoLogin({
"token": "your token",
"profile_id": "some_profile_id"
})
wsUrl = gl.start()
```
start browser with profile id
#### stop() - stops browser, saves profile and upload it to the storage
```py
gl = GoLogin({
"token": "your token",
"profile_id": "some_profile_id"
})
wsUrl = gl.start()
gl.stop()
```
## Telemetry
This package collects anonymous error data to help improve reliability.
### How to disable:
- Set environment variable: `DISABLE_TELEMETRY=true`
### Data handling:
- No personal information collected
- Data stored securely
- Used only for bug fixes and improvements
## Privacy
Our full privacy policy you can finde <a href="https://github.com/gologinapp/pygologin/tree/main/docs/PRIVACY.md">here</a>
Raw data
{
"_id": null,
"home_page": "https://github.com/gologinapp/pygologin",
"name": "gologin",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.5",
"maintainer_email": null,
"keywords": null,
"author": "GoLogin",
"author_email": "yuri@gologin.com",
"download_url": "https://files.pythonhosted.org/packages/e0/4a/66f491de520f72b97f6b9626414c2bf1ae9ef44574058d013a755ca967f9/gologin-2025.7.7.tar.gz",
"platform": null,
"description": "# pygologin - GoLogin Python SDK\n This package provides functionality to run and stop GoLogin profiles with python and then connect the profiles to automation tools like Selenium, Puppetteer, Playwright etc.\n\n## Check full gologin documentations <a href=\"https://gologin.com/docs/api-reference/introduction/quickstart\" target=\"_blank\">here</a>.\n\n# How does it work?\n 1. You give SDK your dev token and profile id that you want to run\n 2. SDK takes care of downloading, preparing your profile and starts the browser\n 3. SDK gives you websocket url for automation tools\n 4. You take this websocker url and connect it to the automation tool on your choice: Puppetteer, Selenium, Playwright etc\n 5. Automation tool connects to browser and you can manage it through code\n\n## Getting Started\n\nWhere is token? API token is <a href=\"https://app.gologin.com/#/personalArea/TokenApi\" target=\"_blank\">here</a>.\n\n\n\n### Installation\n`pip3 install gologin`\n\nfor base case - we use selenium as it is the most popular tool\n`pip3 install -r requirements.txt`\n\n### Example \"gologin-selenium.py\"\n\n```py\nimport time\nfrom gologin import GoLogin\nfrom selenium import webdriver\nfrom selenium.webdriver.chrome.service import Service\nfrom webdriver_manager.chrome import ChromeDriverManager\nprofile_id = \"Your profile id\"\n\n# Initialize GoLogin\ngl = GoLogin({\n\t\"token\": \"Your token\",\n\t\"profile_id\": profile_id\n\t})\n\n# Start Browser and get websocket url\ndebugger_address = gl.start()\n\n# Get Chromium version for webdriver\nchromium_version = gl.get_chromium_version()\n\n# Add proxy to profile\ngl.addGologinProxyToProfile(profile_id, \"us\")\n\n# Install webdriver\nservice = Service(ChromeDriverManager(driver_version=chromium_version).install())\n\nchrome_options = webdriver.ChromeOptions()\nchrome_options.add_experimental_option(\"debuggerAddress\", debugger_address)\n\ndriver = webdriver.Chrome(service=service, options=chrome_options)\n\n# Give command to Selenium to open the page\ndriver.get(\"http://www.python.org\")\n\ntime.sleep(30)\ndriver.quit()\ntime.sleep(10)\ngl.stop()\n\n```\n### Running example:\n\n`python3 examples/selenium/one-time-use-profile.py`\n\n###\n### Methods\n#### constructor - initiate your token, profile that you want to run and browser params\n\nRequired options:\n- `token` <[string]> **Required** - your API <a href=\"https://gologin.com/#/personalArea/TokenApi\" target=\"_blank\">token</a>\n- `profile_id` <[string]> **Required** - profile ID (NOT PROFILE NAME)\n\nOptional options:\n- `executablePath` <[string]> path to executable Orbita file. Orbita will be downloaded automatically if not specified\n- `extra_params` arrayof <[string]> additional flags for browser start. For example: '--headles', '--load-extentions=path/to/extension'\n- `uploadCookiesToServer` <[boolean]> upload cookies to server after profile stopping (default false). It allows you to export cookies from api later.\n- `writeCookesFromServer` <[boolean]> if you have predefined cookies and you want browser to import it (default true).\n\n```py\ngl = GoLogin({\n\t\"token\": \"your token\",\n\t\"profile_id\": \"your profile id\",\n \"extra_params\": [\"--headless\", \"--load-extentions=path/to/extension\"]\n\t})\n```\n#### createProfileRandomFingerprint - you pass os ('lin', 'win', 'mac') and profile name and we give you brand new shiny profile\n```py\ngl = GoLogin({\n\t\"token\": \"your token\",\n\t})\nprofile = gl.createProfileRandomFingerprint({\"os\": \"lin\", \"name\": \"some name\"})\ngl.setProfileId(profile['id'])\n```\n\n\n#### createProfileWithCustomParams - This method creates a profile and you can pass any particular params to it. Full list of params you can find here - https://api.gologin.com/docs\n```py\ngl = GoLogin({\n\t\"token\": \"your token\",\n\t})\nprofile = gl.createProfileWithCustomParams({\n \"os\": \"lin\",\n \"name\": \"some name\",\n \"navigator\": {\n \"userAgent\": \"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36\",\n \"resolution\": \"1920x1080\",\n \"language\": \"en-US\",\n \"platform\": \"Linux x86_64\",\n \"hardwareConcurrency\": 8,\n \"deviceMemory\": 8,\n \"maxTouchPoints\": 0\n }\n})\ngl.setProfileId(profile['id'])\n```\n\n#### updateUserAgentToLatestBrowser - user agent is one of the most important thing in your fingerprint. It decides which browser version to run. This method help you to keep useragent up to date.\n```py\ngl = GoLogin({\n\t\"token\": \"your token\",\n\t})\ngl.updateUserAgentToLatestBrowser([\"profineId1\", \"profileId2\"], \"workspceId(optional)\")\n```\n\n#### addGologinProxyToProfile - Gologin provides high quality proxies with free traffic for paid users. Here you can add gologin proxy to profile, just pass country code\n```py\ngl = GoLogin({\n\t\"token\": \"your token\",\n\t})\ngl.addGologinProxyToProfile(\"profileId\", \"us\")\n```\n\n#### addCookiesToProfile - You can pass cookies to the profile and browser will import it before starting\n```py\ngl = GoLogin({\n\t\"token\": \"your token\",\n\t})\n\ngl.addCookiesToProfile(\"profileId\", [\n {\n \"name\": \"session_id\",\n \"value\": \"abc123\",\n \"domain\": \"example.com\",\n \"path\": \"/\",\n \"expirationDate\": 1719161018.307793,\n \"httpOnly\": True,\n \"secure\": True\n },\n {\n \"name\": \"user_preferences\",\n \"value\": \"dark_mode\",\n \"domain\": \"example.com\",\n \"path\": \"/settings\",\n \"sameSite\": \"lax\"\n }\n])\n```\n\n#### refreshProfilesFingerprint - Replaces your profile fingerprint with a new one\n```py\ngl = GoLogin({\n\t\"token\": \"your token\",\n\t})\n\ngl.refreshProfilesFingerprint([\"profileId1\", \"profileId2\"])\n```\n\n#### changeProfileProxy - allows you to set a proxy to a profile\n```py\ngl = GoLogin({\n\t\"token\": \"your token\",\n\t})\ngl.changeProfileProxy(\"profileId\", { \"mode\": \"http\", \"host\": \"somehost.com\", \"port\": 109, \"username\": \"someusername\", \"password\": \"somepassword\"})\n```\n\n#### start() - prepares profile, starts browser and returns websocket url\n```py\ngl = GoLogin({\n\t\"token\": \"your token\",\n \"profile_id\": \"some_profile_id\"\n\t})\n\nwsUrl = gl.start()\n```\n\nstart browser with profile id\n\n#### stop() - stops browser, saves profile and upload it to the storage\n```py\ngl = GoLogin({\n\t\"token\": \"your token\",\n \"profile_id\": \"some_profile_id\"\n\t})\n\nwsUrl = gl.start()\ngl.stop()\n```\n\n## Telemetry\n\nThis package collects anonymous error data to help improve reliability.\n\n### How to disable:\n- Set environment variable: `DISABLE_TELEMETRY=true`\n\n### Data handling:\n- No personal information collected\n- Data stored securely\n- Used only for bug fixes and improvements\n\n## Privacy\nOur full privacy policy you can finde <a href=\"https://github.com/gologinapp/pygologin/tree/main/docs/PRIVACY.md\">here</a>\n",
"bugtrack_url": null,
"license": null,
"summary": "Official GoLogin python package",
"version": "2025.7.7",
"project_urls": {
"Homepage": "https://github.com/gologinapp/pygologin"
},
"split_keywords": [],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "573a3bedb8b684bc6eb1e51a61751d42075e09e9cae4de9ee85a7024f17345fb",
"md5": "b8f7eb28890e429bae82158cfefe6589",
"sha256": "13ee26a1518a4da883cab92170d0bb73587a423414964eb494bbb36b9a58c2eb"
},
"downloads": -1,
"filename": "gologin-2025.7.7-py3-none-any.whl",
"has_sig": false,
"md5_digest": "b8f7eb28890e429bae82158cfefe6589",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.5",
"size": 29523,
"upload_time": "2025-07-16T10:31:22",
"upload_time_iso_8601": "2025-07-16T10:31:22.510673Z",
"url": "https://files.pythonhosted.org/packages/57/3a/3bedb8b684bc6eb1e51a61751d42075e09e9cae4de9ee85a7024f17345fb/gologin-2025.7.7-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "e04a66f491de520f72b97f6b9626414c2bf1ae9ef44574058d013a755ca967f9",
"md5": "c222d88b5d196415e192e39c8bb050a5",
"sha256": "6b93ab1cf13d10b4d68c624e59e2a64616ea3a13891d91d66b3b373d687c2fe5"
},
"downloads": -1,
"filename": "gologin-2025.7.7.tar.gz",
"has_sig": false,
"md5_digest": "c222d88b5d196415e192e39c8bb050a5",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.5",
"size": 26919,
"upload_time": "2025-07-16T10:31:23",
"upload_time_iso_8601": "2025-07-16T10:31:23.837498Z",
"url": "https://files.pythonhosted.org/packages/e0/4a/66f491de520f72b97f6b9626414c2bf1ae9ef44574058d013a755ca967f9/gologin-2025.7.7.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-16 10:31:23",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "gologinapp",
"github_project": "pygologin",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "requests",
"specs": []
},
{
"name": "psutil",
"specs": []
},
{
"name": "webdriver_manager",
"specs": [
[
">=",
"4.0.0"
]
]
},
{
"name": "selenium",
"specs": [
[
">=",
"4.11.0"
]
]
},
{
"name": "sentry-sdk",
"specs": [
[
">=",
"2.29.1"
]
]
}
],
"lcname": "gologin"
}