• 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 X 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 X
  • 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 July 14th, 2025 )

Updated on July 14th, 2025

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 X account email
    2. PASSWORD: your Multilogin X 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 profiles in Multilogin X
  • How to export proxy details with Python

ANTIDETECT PLATFORM

  • Antidetect browser
  • Residential proxies
  • Mobile antidetect browser
  • Multi-account management
  • Headless browser
  • Web automation
  • AI Quick Action Automation

MULTI-ACCOUNTING

  • Create multiple Facebook accounts
  • Create multiple Gmail accounts
  • Create multiple LinkedIn accounts
  • Create multiple Amazon accounts
  • Create multiple Onlyfans accounts
  • Create multiple Twitter accounts
  • Create multiple TikTok accounts

GEO PROXIES

  • UK proxy
  • USA proxy
  • Japan proxy
  • India proxy
  • Pakistan proxy
  • China proxy
  • New Zealand proxy

RESOURCES

  • Knowledge base
  • API documentation
  • Glossary
  • Blog
  • Multilogin 6 download
  • Server status
  • Release notes

COMPARISON

  • Multilogin vs. Gologin
  • Multilogin vs. Adspower
  • Multilogin vs. Dolphin Anty
  • Multilogin vs. Incognition
  • Multilogin vs. Octo Browser
  • Multilogin vs. Undetectable
  • Multilogin vs. MoreLogin

PLATFORM PROXIES

  • Mobile proxy
  • Reddit proxy
  • Facebook proxy
  • SOCKS5 proxy
  • Instagram proxy
  • Onlyfans proxy
  • LinkedIn proxy

FREE TOOLS

  • Online URL to text converter

GET IN TOUCH

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

© 2025 Multilogin. All rights reserved.

  • Privacy policy
  • Terms of service
  • Cookie policy
Multilogin abstract watermark
  • ANTIDETECT PLATFORM

    • Antidetect browser
    • Residential proxies
    • Mobile antidetect browser
    • Multi-account management
    • Headless browser
    • Web automation
    • AI Quick Action Automation
  • MULTI-ACCOUNTING

    • Create multiple Facebook accounts
    • Create multiple Gmail accounts
    • Create multiple LinkedIn accounts
    • Create multiple Amazon accounts
    • Create multiple Onlyfans accounts
    • Create multiple Twitter accounts
    • Create multiple TikTok accounts
  • GEO PROXIES

    • UK proxy
    • USA proxy
    • Japan proxy
    • India proxy
    • Pakistan proxy
    • China proxy
    • New Zealand proxy
  • RESOURCES

    • Knowledge base
    • API documentation
    • Glossary
    • Blog
    • Multilogin 6 download
    • Server status
    • Release notes
  • COMPARISON

    • Multilogin vs. Gologin
    • Multilogin vs. Adspower
    • Multilogin vs. Dolphin Anty
    • Multilogin vs. Incognition
    • Multilogin vs. Octo Browser
    • Multilogin vs. Undetectable
    • Multilogin vs. MoreLogin
  • PLATFORM PROXIES

    • Mobile proxy
    • Reddit proxy
    • Facebook proxy
    • SOCKS5 proxy
    • Instagram proxy
    • Onlyfans proxy
    • LinkedIn proxy
  • FREE TOOLS

    • Online URL to text converter
  • GET IN TOUCH

    • Contact 24/7 support
      [email protected]
    • Contact sales
    • Referral program
    • Affiliate program
    • Pricing page
    • Careers
Multilogin abstract watermark
  • Privacy policy
  • Terms of service
  • Cookie policy

© 2025 Multilogin. All rights reserved.

Expand