Developer API

Integrate temporary email functionality into your applications with our simple REST API.
All responses are in JSON format. Base URL: https://sporn.biz/api

GET https://sporn.biz/api/domains

Get Available Domains

Retrieve a list of active domains and Gmail accounts available for creating emails.

Response Example

{
    "status": "success",
    "domains": [
        { "id": 1, "domain": "example.com" },
        { "id": 2, "domain": "temp-mail.org" }
    ],
    "gmail_accounts": [
        { "id": 1, "email": "user@gmail.com" }
    ]
}

Code Examples

JavaScript (Fetch API)
fetch('https://sporn.biz/api/domains')
    .then(response => response.json())
    .then(data => {
        console.log('Domains:', data.domains);
        console.log('Gmail:', data.gmail_accounts);
    });
POST https://sporn.biz/api/create-session

Create Email Address

Generate a new temporary email address. You can specify parameters or let it be random.

ParameterTypeDescription
prefixstringOptional. Custom username for the email.
domain_idintOptional. ID of the domain to use.
use_gmailintOptional. Set to 1 to generate a Gmail alias.
gmail_autointOptional. Set to 1 to auto-select Gmail account.

Response Example

{
    "status": "success",
    "email": "random123@example.com",
    "token": "a1b2c3d4e5f6g7h8i9j0",
    "expires_at": "2026-01-30 18:00:00"
}
GET https://sporn.biz/api/check-mail

Check Inbox

Get a list of messages for a specific email session.

ParameterTypeDescription
tokenstringRequired. The session token.

Response Example

{
    "status": "success",
    "messages": [
        {
            "id": 105,
            "sender_name": "Facebook",
            "sender_email": "noreply@facebook.com",
            "subject": "Welcome to Facebook",
            "received_at": "2026-01-30 10:30:00"
        }
    ]
}
GET https://sporn.biz/api/read-mail

Read Message

Get the full content of a specific message.

ParameterTypeDescription
tokenstringRequired. The session token.
idintRequired. The message ID.
POST https://sporn.biz/api/delete-mail

Delete Message

Delete a specific message from the inbox.

ParameterTypeDescription
tokenstringRequired. The session token.
idintRequired. The message ID to delete.