API Guide - Get Emails
1. Introduction
This API enables you to retrieve a list of emails from the system using an API key and optional parameters. The API endpoint is:
https://mailv2.theloi.io.vn/api/get_emails.php
2. Requirements
- A valid API key (starting with FREE_ or a custom key from the database).
- Method: GET or POST.
- Access via HTTPS for security.
3. Parameters
| Parameter Name |
Description |
Required |
Default Value |
| apikey |
API key for authentication. |
Yes |
- |
| to |
Destination email address (searched by pattern). |
Yes |
- |
| seen |
Fetch only unseen emails (true/false). |
No |
false |
| limit |
Number of emails to return (max 20). |
No |
20 |
4. Sample URLs
Below are examples of valid API request URLs:
https://mailv2.theloi.io.vn/api/get_emails.php?apikey=FREE_abc123&to=user@example.com
https://mailv2.theloi.io.vn/api/get_emails.php?apikey=FREE_abc123&to=user@example.com&seen=true&limit=5
https://mailv2.theloi.io.vn/api/get_emails.php?apikey=custom_key_123&to=test@domain.com&limit=10
5. Rate Limiting
- FREE API Key: Limited to 100 requests per minute.
- Custom API Key: Limited based on the request_limit value in the database, per minute.
- Rate limits are tracked using Redis with a 61-second expiration.
6. Response Format
The API returns data in JSON format. Example responses: