Giter Club home page Giter Club logo

api-python's Introduction

TempMail.lol Python API

discord

This repository is for the TempMail.lol Python API.

Updating form v2

The library is completely different from version 2.x.x. Please see Usage to learn more about the changes to the Python library.

Please switch to the new version of the library if you are using a new API key. If you are still using a BananaCrumbs ID, you must use v2.

Installation

You can install the TempMail API using PIP:

pip install tempmail-lol

TempMail Plus and Ultra

If you have a TempMail Plus or Ultra subscription, you can use it in the API. Please see the usage below. If you need help, ask in our Discord Server or email us at [email protected].

You do not need an API key to use the free tier of TempMail.

Usage

from TempMail import TempMail

# Create a new TempMail object
tmp = TempMail()

# If you have an API Key, use it here (you do not need an API key to use the free tier)
tmp = TempMail("tm.1234567890.randomcharactershere")

# Generate an inbox with a random domain and prefix
inb = tmp.createInbox()

# Or... use a prefix
inb = tmp.createInbox(prefix = "joe")

# Generate an inbox using a specific domain (you can also use your custom domain here)
# Prefixes on custom domains has no extra characters.  For example, a custom domain example.com
# with a prefix of "whoever" will make "[email protected]".  If you do not provide a prefix,
# a random one will be created for you.
inb = tmp.createInbox(domain = "mycustomdomain.com", prefix = "optional")

# Check for emails (throws exception on invalid token)
emails = tmp.getEmails(inb)

# Or... use the token (which is a string)
emails = tmp.getEmails(inb.token)

print("Emails:")

for email in emails:
    print("\tSender: " + email.sender)
    print("\tRecipient: " + email.recipient)
    print("\tSubject: " + email.subject)
    print("\tBody: " + email.body)
    print("\tHTML: " + str(email.html)) # may be None
    print("\tDate: " + str(email.date)) # Unix timestamp in milliseconds

Custom Domain Keys

Note that the token for custom inboxes is stored on your domain as a text record with a name of _tmpml and a sha512 hash.

See more details in accounts.tempmail.lol.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.