Python SDK
The MeetLogin Python SDK (in development) supports both sync and async code.
Installation
Not yet published. The SDK is not on the public package registry yet, so the install command below will not work until it is released. Until then, use the REST API directly with your API key in the X-API-Key header.
pip install meetlogin # available once releasedInitialization
from meetlogin import MeetLogin
client = MeetLogin(token="YOUR_API_KEY")List Profiles
profiles = client.profiles.list(workspace_id="YOUR_WORKSPACE_ID")
for p in profiles:
print(p['name'], p['id'])Create and Launch a Profile
# Create a profile
profile = client.profiles.create(
name="Scraping Account",
os="win",
browser_version="137",
workspace_id="YOUR_WORKSPACE_ID",
)
# Launch the profile
result = client.profiles.start(profile['id'])
ws_url = result['wsUrl']
# Connect Playwright to the running profile
from playwright.sync_api import sync_playwright
with sync_playwright() as p:
browser = p.chromium.connect_over_cdp(ws_url)
page = browser.new_page()
page.goto("https://example.com")
print(page.title())
browser.close()
# Stop the profile
client.profiles.stop(profile['id'])Async Usage
import asyncio
from meetlogin import AsyncMeetLogin
async def main():
async with AsyncMeetLogin(token="YOUR_API_KEY") as client:
profiles = await client.profiles.list(workspace_id="WS_ID")
print(profiles)
asyncio.run(main())