• Website
  • Server status
  • API documentation
  • Blog
Telegram Icon Community
EN
English
Português
Русский
中文 (中国)
Tiếng Việt
Log in Try for €1.99
  • Website
  • Server status
  • API documentation
  • Blog
  • Telegram Icon Community
  • English (US)
    English
    Português
    Русский
    中文 (中国)
    Tiếng Việt
Log in View Plans

Custom Python scripts

Build powerful automation workflows with Python and the Multilogin API. Create, manage, and launch browser profiles with fully customizable scripts.

search icon

Contact Us

If you still have questions or prefer to get help directly from an agent, please submit a request.
We’ll get back to you as soon as possible.

Please fill out the contact form below and we will reply as soon as possible.

  • Getting started with Multilogin automation
  • Basic automation with CLI
  • Low-code automation with Postman
  • Script runner & predefined scripts
  • Puppeteer, Selenium, and Playwright
  • Custom Python scripts
  • Quick solutions with Developer Tools
  • External automation tools
  • Home
  • breadcrumb separator bar
  • Multilogin (latest)
  • breadcrumb separator bar
  • Efficient task automation with API
  • breadcrumb separator bar
  • Custom Python scripts
  • breadcrumb separator bar
  • How to retrieve API tokens with Python

How to retrieve API tokens with Python

Written by Marcelo B ( Updated on March 5th, 2026 )

Updated on March 5th, 2026

In order to use the API, you must send a valid token with your requests. This article goes over how to get that authentication token.

The token expires in 30 minutes. You can refresh it with the User Refresh Token endpoint. Also, you can use the automation token and specify the required expiration period yourself.

 

Complete the steps below to be able to run the provided script example.

  1. Install the following Python library: requests
  2. Insert your values into the below variables in the script:
    1. USERNAME: your Multilogin account email
    2. PASSWORD: your Multilogin account password (MD5 encryption is not required)
import json
import requests
import hashlib

MLX_BASE = "https://api.multilogin.com"
MLX_LAUNCHER = "https://launcher.mlx.yt:45001/api/v2"
LOCAL_HOST = "http://127.0.0.1"
HEADERS = {'Accept': 'application/json',}

#TODO: Insert your account information in both variables below.
USERNAME = ""
PASSWORD = ""

def sign_in():
    payload = {
        'email': USERNAME,
        'password': hashlib.md5(PASSWORD.encode()).hexdigest()
    }
    r = requests.post(f'{MLX_BASE}/user/signin', json=payload)
    if r.status_code != 200:
        print(f'\nFailed to login: {r.text}\n')
    else:
        response = json.loads(r.text)
        token = response.get('data').get('token')
        print(token)
        return token

# Call the sign_in function to execute it
token = sign_in()

 

Was this article helpful?

Give feedback about this article

Multilogin community

Stay informed, share your thoughts, and engage with others!

Telegram Icon Join us on Telegram

Read more on the topic

Blog Post Img

10 Best Datacenter Proxies for Web Scraping (2025 Edition)

Apr 2, 2025 5 min read
Google SERP Img

What is a Google SERP Proxy and Why Should You Care?

Apr 1, 2025 6 min read
UK Proxy Img

What Are Dedicated UK Proxies? Everything You Need to Know

Apr 1, 2025 6 min read
Related Article Title Icon

Related articles

  • How to get API tokens in DevTools
  • How to export browser profiles
  • How to export proxy details with Python
  • Getting started with automation scripting

Mobile

  • Cloud phone
  • Virtual phone
  • Remote phone
  • Phone farming
  • Cloud cell phone
  • Cloud Android emulation
  • AI Quick Action Automation

Multi-accounting

  • Multiple Instagram accounts
  • Multiple Tiktok accounts
  • Multiple Reddit accounts
  • Multiple Telegram accounts
  • Multiple Facebook accounts
  • Multiple Youtube accounts
  • Multiple LinkedIn accounts

COMPARISON

  • Multilogin vs. MoreLogin
  • Multilogin vs. FlashID
  • Multilogin vs. DuoPlus
  • Multilogin vs. VMOS cloud
  • Multilogin vs. Octo Browser
  • Multilogin vs. AdsPower
  • Multilogin vs. GoLogin

Platform proxies

  • Mobile proxy
  • Reddit proxy
  • Instagram proxy
  • TikTok proxy
  • Facebook proxy
  • Youtube proxy
  • LinkedIn proxy

USECASES

  • Cloud phones for Tiktok
  • Cloud phones for Instagram
  • Cloud phones for Reddit
  • Cloud phones for Facebook
  • Cloud phones for Youtube

RESOURCES

  • Knowledge base
  • API documentation
  • Glossary
  • Academy
  • Blog
  • Server status
  • Release notes

FREE TOOLS

  • YouTube views to money calculator
  • Instagram money calculator
  • Online URL to text converter
  • Google local SERP checker
  • Random address generator

GET IN TOUCH

  • Contact 24/7 support
    [email protected]
  • Referral program
  • Affiliate program
  • Pricing page
  • Careers
GDPR Compliant

© 2026 Multilogin. All rights reserved.

  • Privacy policy
  • Terms of service
  • Cookie policy
Multilogin watermark
  • MOBILE

    • Cloud phone
    • Virtual phone
    • Remote phone
    • Phone farming
    • Cloud cell phone
    • Cloud Android emulation
    • AI Quick Action Automation
  • MULTI-ACCOUNTING

    • Multiple Instagram accounts
    • Multiple Tiktok accounts
    • Multiple Reddit accounts
    • Multiple Telegram accounts
    • Multiple Facebook accounts
    • Multiple Youtube accounts
    • Multiple LinkedIn accounts
  • COMPARISON

    • Multilogin vs. MoreLogin
    • Multilogin vs. FlashID
    • Multilogin vs. DuoPlus
    • Multilogin vs. VMOS cloud
    • Multilogin vs. Octo Browser
    • Multilogin vs. AdsPower
    • Multilogin vs. GoLogin
  • PLATFORM PROXIES

    • Mobile proxy
    • Reddit proxy
    • Instagram proxy
    • TikTok proxy
    • Facebook proxy
    • Youtube proxy
    • LinkedIn proxy
  • USECASES

    • Cloud phones for Tiktok
    • Cloud phones for Instagram
    • Cloud phones for Reddit
    • Cloud phones for Facebook
    • Cloud phones for Youtube
  • RESOURCES

    • Knowledge base
    • API documentation
    • Glossary
    • Academy
    • Blog
    • Server status
    • Release notes
  • FREE TOOLS

    • YouTube views to money calculator
    • Instagram money calculator
    • Online URL to text converter
    • Google local SERP checker
    • Random address generator
  • GET IN TOUCH

    • Contact 24/7 support
      [email protected]
    • Referral program
    • Affiliate program
    • Pricing page
    • Careers
GDPR Compliant
  • Privacy policy
  • Terms of service
  • Cookie policy

© 2026 Multilogin. All rights reserved.

Expand