Skip to main content

Official GoLogin python package

Project description

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 here.

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 here.

Token API in Settings

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"

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 token
  • 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).
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

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

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.

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

gl = GoLogin({
	"token": "your token",
	})
gl.addGologinProxyToProfile("profileId", "us")

addCookiesToProfile - You can pass cookies to the profile and browser will import it before starting

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

gl = GoLogin({
	"token": "your token",
	})

gl.refreshProfilesFingerprint(["profileId1", "profileId2"])

changeProfileProxy - allows you to set a proxy to a profile

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

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

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 here

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gologin-2026.2.3.tar.gz (29.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gologin-2026.2.3-py3-none-any.whl (32.1 kB view details)

Uploaded Python 3

File details

Details for the file gologin-2026.2.3.tar.gz.

File metadata

  • Download URL: gologin-2026.2.3.tar.gz
  • Upload date:
  • Size: 29.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for gologin-2026.2.3.tar.gz
Algorithm Hash digest
SHA256 3f928467ad990d6264440070a234c61b6a16663622f28f489b20fbcb59686d7f
MD5 cf291c7ad66224989dea0269c8c697ce
BLAKE2b-256 7fb7696f9661bf359ad2633684af840469490bc1a5ee194a8f899894ba4fe5b7

See more details on using hashes here.

File details

Details for the file gologin-2026.2.3-py3-none-any.whl.

File metadata

  • Download URL: gologin-2026.2.3-py3-none-any.whl
  • Upload date:
  • Size: 32.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for gologin-2026.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 a9a44dfff740459cd8a727d2e6a1da6c208a23d191a302abd36db806596adf71
MD5 2e3352dc82f5869e8783c0e84aaf3984
BLAKE2b-256 8cbcc0fdd78a521a8108830bf279e834da3a335e7016548fcd4459191138dcbf

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page