🌐
English
Python Documentation
You can use our API directly or install the SDK. Check out our Playwright integration example for a complete demo.
1
Install our SDK
pip install tigrmail
2
Copy your token and use it for initialization
YOUR_API_TOKEN
Example
# Step 1: Import the library. from tigrmail import Tigrmail, TigrmailError import re # Step 2: Initialise the library using your token. tigrmail = Tigrmail(token="YOUR_API_TOKEN") # Step 3: Generate an inbox, this will be your unique email address. # It's okay to create a new email address (inbox) for each new test run. email_address = tigrmail.create_email_address() # Optional: list available domains and create an inbox on one of them. # Use this when your test requires a specific inbox domain. # domains = tigrmail.get_domains() # email_address = tigrmail.create_email_address(domain=domains[0]) # Step 4: Use the inbox (e.g. sign up for a service). sign_up_in_my_app(email_address) # Step 5: Poll for the next message. message = tigrmail.poll_next_message(inbox=email_address) # Step 6: Grab the verification link or code. # For this example, we expect the subject to be "Verification Code: 123456". verification_code = re.search(r'\d{6}', message['subject']).group(0) # Step 7: Use the verification code # (e.g. go to a verification page and enter it). verify_account(verification_code)