Quay lại trang chủ

API Documentation

Tài liệu chi tiết các API của dịch vụ Đọc Hotmail & CheckLive TikTok

Endpoint chính để đọc email từ Hotmail/Outlook/Gmail qua nhiều phương thức: OAuth2 IMAP/POP3, OAuth2 Graph API, và Roundcube.
Endpoint Chính
POST https://smail1s.com/get_messages
Request Parameters
TypeNameDescription
requireddataChuỗi chứa thông tin tài khoản email. Mỗi tài khoản trên 1 dòng.
OAuth/Graph: user@gmail.com|refresh_token|client_id|client_secret
Roundcube: user@wmhotmail.com|password
requiredmodePhương thức kết nối hộp thư. Một trong: oauth, graph, roundcube
oauth — Dùng refresh_token và client_id (lấy từ Azure AD app registration) để lấy access token tự động, không cần password.
graph — Dùng Microsoft Graph API để đọc thư trực tiếp từ Microsoft.
roundcube — Kết nối trực tiếp đến server webmail wmhotmail.com qua IMAP.
Request Example
// OAuth2 / IMAP - Hotmail/Outlook
fetch('https://smail1s.com/get_messages', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    mode: 'oauth',
    data: 'user@outlook.com|refresh_token|client_id|client_secret'
  })
}).then(r => r.json()).then(console.log);

// OAuth2 Graph API
fetch('https://smail1s.com/get_messages', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    mode: 'graph',
    data: 'user@gmail.com|refresh_token|client_id|client_secret'
  })
}).then(r => r.json());
Response Parameters
TypeFieldDescription
optionaldata[].emailĐịa chỉ email của tài khoản
optionaldata[].messagesMảng các thư, mỗi thư có: from, subject, date, message, code, uid
from — Tên người gửi
subject — Tiêu đề thư
date — Thời gian nhận thư (format: YYYY-MM-DD HH:mm:ss)
message — Nội dung thư (HTML nếu bắt đầu bằng <, plain text nếu không)
code — Mã xác nhận trích xuất tự động từ thư (nếu có)
uid — UID định danh duy nhất của thư
optionaldata[].errorThông báo lỗi nếu đọc thư thất bại
Response Example (Success) — 200
{
  "data": [
    {
      "email": "user@outlook.com",
      "error": null,
      "mailSource": "oauth",
      "messages": [
        {
          "uid": "abc123def456",
          "from": "Google <no-reply@google.com>",
          "subject": "Mã xác nhận Google",
          "date": "2026-05-23 10:30:00",
          "message": "97530 là mã xác nhận của bạn",
          "code": "97530"
        }
      ]
    }
  ]
}
Response Example (Error) — 500
{
  "data": [
    {
      "email": null,
      "error": "Đã xảy ra lỗi hệ thống",
      "messages": []
    }
  ]
}
Roundcube — Kết nối trực tiếp đến server webmail wmhotmail.com qua IMAP.. Server mặc định: http://mail.wmhotmail.com. Có thể truyền roundcubeBaseUrl để dùng server khác.
Request Parameters
TypeNameDescription
requireddataChuỗi chứa thông tin tài khoản email. Mỗi tài khoản trên 1 dòng.
Roundcube: user@wmhotmail.com|password
requiredmodeGiá trị: roundcube
optionalroundcubeBaseUrlURL server Roundcube (mặc định: http://mail.wmhotmail.com)
Request Example
// Roundcube - Get Code wmhotmail.com
fetch('https://smail1s.com/get_messages', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    mode: 'roundcube',
    data: 'user@wmhotmail.com|password123'
  })
}).then(r => r.json());
Response Example (Success) — 200
{
  "data": [
    {
      "email": "user@wmhotmail.com",
      "error": null,
      "mailSource": "roundcube",
      "messages": [
        {
          "uid": "44",
          "from": "Google <no-reply@google.com>",
          "subject": "Mã xác minh",
          "date": "2026-05-23 10:30",
          "code": "892073",
          "message": "892073 là mã xác nhận của bạn"
        }
      ]
    }
  ]
}
API đọc Gmail Edu hỗ trợ realtime - tự động nhận thư mới qua Socket.io hoặc HTTP polling fallback. Tốt nhất cho các ứng dụng cần mã xác nhận nhanh (OTP, 2FA, xác minh tài khoản).
Lấy thư Gmail Edu + Realtime notification
POST https://smail1s.com/get_messages

Đọc thư từ tài khoản Gmail Edu. Sau khi gọi, hệ thống sẽ subscribe email này để nhận thư mới qua Socket.io hoặc HTTP polling (12 giây/lần).

Request Parameters
TypeNameDescription
requireddataEmailEdu chỉ cần email (không cần password): user@emailfake.com
requiredmodeGiá trị: emailfake
Request Example
// EmailFake - Gmail Edu (không cần password)
fetch('https://smail1s.com/get_messages', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    mode: 'emailfake',
    data: 'user@emailfake.com'
  })
}).then(r => r.json());
Response Example (Success) — 200
{
  "data": [
    {
      "email": "user@emailfake.com",
      "error": null,
      "mailSource": "emailfake",
      "messages": [
        {
          "uid": "a1b2c3d4e5f678901234567890123456",
          "from": "Meta",
          "subject": "Your Instagram code",
          "date": "2026-05-23T10:30:00.000Z",
          "code": "654321"
        }
      ]
    }
  ]
}
Lấy chi tiết một email cụ thể
POST https://smail1s.com/api/emailfake/detail
Sau khi có UID từ /get_messages, gọi endpoint này để lấy nội dung đầy đủ.
Request Parameters
TypeNameDescription
requiredemailĐịa chỉ email cần lấy chi tiết
requireduidUID của thư cần lấy chi tiết
optionalsubjectTiêu đề thư dự phòng — dùng khi không lấy được từ trang
optionalfromNgười gửi dự phòng — dùng khi không lấy được từ trang
Request Example
// Lấy chi tiết 1 email
fetch('https://smail1s.com/api/emailfake/detail', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    email: "user@emailfake.com",
    uid: "a1b2c3d4e5f678901234567890123456",
    subject: "Your Instagram code",
    from: "Meta"
  })
}).then(r => r.json());
Response Example (Success) — 200
{
  "success": true,
  "detail": {
    "subject": "Your Instagram code",
    "from": "Meta",
    "bodyHtml": "<div>...full HTML content...</div>",
    "bodyText": "Your Instagram verification code is 654321...",
    "code": "654321"
  }
}
Fallback: Nếu Puppeteer không lấy được nội dung (email chỉ chứa hình ảnh), server trả fallback với subject và thông báo nội dung không khả dụng.
Nhận thư mới realtime qua WebSocket

Sử dụng Socket.io để nhận thư mới ngay lập tức khi có thư đến hộp thư. Nếu Socket.io không khả dụng, hệ thống tự động fallback sang HTTP polling mỗi 12 giây.

Kết nối: io('https://smail1s.com')
Namespace: Root / | Transport: websocket (auto fallback: polling)
Client Events (Emit) / Server Events (Listen)
DirectionEventDescription
Emitemail:subscribeĐăng ký theo dõi một email. Server sẽ bắt đầu gửi thư mới đến email này.
Emitemail:unsubscribeHủy đăng ký theo dõi một email.
Emitemail:known_uidsGửi UIDs đã load để server không thông báo lại
Listenemail:newThư mới vừa nhận được. Payload gồm: email, uid, from, subject, body, code, isHtml
Listenemail:subscribedXác nhận đã subscribe thành công.
Socket.io Payload Example (email:new)
// socket.emit('email:subscribe', 'user@emailfake.com')
// socket.on('email:new', (data) => { ... })

{
  "email": "user@emailfake.com",
  "uid": "f1e2d3c4b5a697801234567890123456",
  "from": "Meta",
  "subject": "Your Instagram code",
  "body": "<div>...</div>",
  "code": "654321",
  "isHtml": true,
  "timestamp": "2026-05-23T10:35:00.000Z"
}
Full Socket.io Integration
// 1. Kết nối Socket.io
const socket = io('https://smail1s.com');

// 2. Subscribe email
socket.emit('email:subscribe', 'user@emailfake.com');

// 3. Gửi known_uids (tránh thông báo lại email đã load)
socket.emit('email:known_uids', {
  email: 'user@emailfake.com',
  uids: ['abc123', 'def456']
});

// 4. Lắng nghe email mới
socket.on('email:new', (data) => {
  console.log('New email!', data);
  if (data.code) {
    console.log('Verification code:', data.code);
  }
});

// 5. Fallback: HTTP polling khi không có Socket.io
async function pollEmail(email) {
  const res = await fetch('https://smail1s.com/get_messages', {
    method: 'POST',
    body: JSON.stringify({ mode: 'emailfake', data: email })
  });
  return res.json();
}
setInterval(() => pollEmail('user@emailfake.com'), 12000); // 12s
API kiểm tra trạng thái tài khoản TikTok: LIVE (hoạt động), DIE (die/hết hạn), UNKNOWN (không xác định). Hỗ trợ proxy riêng để check hàng loạt.
Kiểm tra trạng thái 1 tài khoản TikTok
POST https://smail1s.com/api/check-tiktok-single

Kiểm tra trạng thái của một tài khoản TikTok. Hỗ trợ nhiều format dữ liệu đầu vào từ chỉ username đến đầy đủ thông tin tài khoản.

Request Parameters
TypeNameDescription
requiredlineThông tin tài khoản TikTok cần kiểm tra. Hỗ trợ nhiều format:
Chỉ username: tiktok_user
Đầy đủ: user123|password|email@gmail.com|pwd|refresh_token|client_id
optionaluseProxyBật/tắt sử dụng proxy. Default: false
optionalproxyKeyThông tin proxy (bắt buộc nếu useProxy: true)
31.59.20.176:6754:username:password
Request Example
fetch('https://smail1s.com/api/check-tiktok-single', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    line: 'tiktok_user|password123',
    useProxy: true,
    proxyKey: '31.59.20.176:6754:username:password'
  })
}).then(r => r.json());
Response Parameters
TypeFieldDescription
optionalsuccessTrue nếu request thành công (không phải trạng thái tài khoản)
optionalaccountChuỗi tài khoản gốc đã gửi lên
optionalstatusTrạng thái tài khoản: live (hoạt động), die (die/hết hạn), unknown (không xác định)
LIVE — Tài khoản hoạt động bình thường
DIE — Tài khoản đã die (cookie/token hết hạn hoặc sai)
UNKNOWN — Không thể xác định (lỗi mạng, lỗi server TikTok)
optionalmessageThông báo chi tiết về trạng thái hoặc lỗi
Request thành công (trạng thái tài khoản nằm trong field status) — 200
{
  "success": true,
  "account": "tiktok_user|password123",
  "status": "live",
  "message": "LIVE"
}
Dữ liệu đầu vào không hợp lệ — 400
{
  "success": false,
  "message": "Thiếu dữ liệu tài khoản để check!"
}
Lỗi server khi kiểm tra TikTok — 500
{
  "success": false,
  "message": "Lỗi server: ..."
}
Kiểm tra nhiều tài khoản cùng lúc

Để check hàng loạt, gọi /api/check-tiktok-single cho mỗi tài khoản. Hệ thống hỗ trợ gọi song song (parallel) - bạn có thể gửi tất cả request cùng lúc.

Không giới hạn request: Bạn có thể gọi song song tất cả các tài khoản cùng lúc.
Proxy: Mỗi proxy có thể dùng cho nhiều tài khoản (hệ thống tự luân chuyển).
Timeout: Mỗi request có timeout 60 giây.
Batch Example Flow (JavaScript)
// Batch check TikTok - parallel requests
async function checkAllAccounts(accounts, proxies = []) {
  const results = await Promise.all(
    accounts.map((line, idx) => {
      const proxyKey = proxies[idx % proxies.length];
      return fetch('https://smail1s.com/api/check-tiktok-single', {
        method: 'POST',
        headers: { 'Content-Type': 'application/json' },
        body: JSON.stringify({
          line: line,
          useProxy: !!proxyKey,
          proxyKey: proxyKey || undefined
        })
      }).then(r => r.json());
    })
  );

  const live    = results.filter(r => r.status === 'live');
  const die     = results.filter(r => r.status === 'die');
  const unknown = results.filter(r => r.status === 'unknown');

  console.log(`LIVE: ${${live.length}$ | DIE: ${${die.length}$ | UNKNOWN: ${${unknown.length}$}`);
  return { live, die, unknown, all: results };
}

// Usage
const accounts = ['user1', 'user2|password', 'user3|pass|email@x.com|pwd|refresh|clientid'];
const proxies  = ['31.59.20.176:6754:user:pass'];
checkAllAccounts(accounts, proxies);
TempMail API v2 — Hệ thống tạo email tạm (temp mail) với khả năng trích xuất OTP tự động. Mỗi mailbox tồn tại 15 phút, hỗ trợ realtime Socket.io.
Lấy danh sách domain
GET https://smail1s.com/api/v2/mail/domains

Lấy danh sách domain khả dụng để tạo mailbox

Request Example
fetch('https://smail1s.com/api/v2/mail/domains')
  .then(r => r.json())
  .then(console.log);
Response — 200
{
  "success": true,
  "domains": ["smail1s.com"]
}
Tạo mailbox
POST https://smail1s.com/api/v2/mail/create

Tạo mailbox mới (ngẫu nhiên hoặc tùy chỉnh), thời gian sống: 15 phút

Body Parameters (JSON)
TypeNameDescription
optionalmailboxTên mailbox (a-z0-9._-, 1-32 ký tự). Để trống = tạo ngẫu nhiên
optionaldomainDomain muốn dùng. Để trống = dùng domain đầu tiên
Request Example
// Tạo email ngẫu nhiên
fetch('https://smail1s.com/api/v2/mail/create', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({})
}).then(r => r.json());

// Tạo email tùy chỉnh
fetch('https://smail1s.com/api/v2/mail/create', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    mailbox: 'mytest123',
    domain: 'smail1s.com'
  })
}).then(r => r.json());
Response — 201
{
  "success": true,
  "email": "a1b2c3d4e5f6@smail1s.com",
  "expiresAt": "2026-08-13T10:45:00.000Z"
}
Lấy danh sách mail
POST https://smail1s.com/api/v2/mail/inbox

Lấy tất cả email trong inbox (sắp xếp theo UID giảm dần)

Body Parameters (JSON)
TypeNameDescription
requiredemailĐịa chỉ email muốn đọc inbox
Request Example
fetch('https://smail1s.com/api/v2/mail/inbox', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    email: 'a1b2c3d4e5f6@smail1s.com'
  })
}).then(r => r.json());
Response — 200
{
  "messages": [
    {
      "uid": 42,
      "subject": "Your verification code",
      "from": "Google <no-reply@google.com>",
      "date": "2026-08-13T10:30:00.000Z",
      "preview": "Your verification code is 456745...",
      "hasAttachments": false
    }
  ]
}
Chi tiết email
POST https://smail1s.com/api/v2/mail/detail

Lấy nội dung đầy đủ của một email (HTML, text, attachments)

Body Parameters (JSON)
TypeNameDescription
requiredemailĐịa chỉ email
requireduidUID của email (lấy từ inbox)
Request Example
fetch('https://smail1s.com/api/v2/mail/detail', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    email: 'a1b2c3d4e5f6@smail1s.com',
    uid: 42
  })
}).then(r => r.json());
Response — 200
{
  "uid": 42,
  "subject": "Your verification code",
  "from": "Google <no-reply@google.com>",
  "to": "a1b2c3d4e5f6@smail1s.com",
  "cc": "",
  "replyTo": "",
  "date": "2026-08-13T10:30:00.000Z",
  "html": "<div>Your verification code is <strong>456745</strong></div>",
  "text": "Your verification code is 456745",
  "attachments": []
}
Đọc OTP (long-polling 60s)
GET https://smail1s.com/api/v2/mail/otp?email={email}

Đợi và trích xuất OTP từ email mới nhất (timeout 60s). Response: text/plain

Long-polling: Request này sẽ chờ tối đa 60 giây cho đến khi có email mới chứa OTP. Chỉ gọi 1 lần duy nhất sau khi đăng ký dịch vụ.
Request Example
// Response là plain text (KHÔNG phải JSON), dùng .text()
const otp = await fetch(
  'https://smail1s.com/api/v2/mail/otp?email=a1b2c3d4e5f6@smail1s.com'
).then(r => r.text());

if (otp) {
  console.log('OTP:', otp); // "456745"
} else {
  console.log('Timeout - no OTP received in 60s');
}
Response — 200 (Content-Type: text/plain)
456745
Nếu timeout hoặc không có OTP, response body sẽ rỗng (empty string).
🚀 Create + OTP Combined (Endpoint đặc biệt)
GET (Recommended cho automation)
GET https://smail1s.com/api/v2/mail/create-and-otp?email={email}

Tạo mailbox (nếu chưa có) hoặc sử dụng lại (nếu đã có) + đợi OTP trong 1 request duy nhất (long-polling 60s). Response: text/plain chứa OTP.

Lưu ý: OTP chỉ trả về 1 lần duy nhất. Lần gọi tiếp theo với cùng email sẽ trả rỗng nếu chưa có OTP mới, hoặc trả OTP mới nếu có mail mới.
Use case: Automation tool cần tự động tạo email + lấy OTP chỉ bằng 1 URL duy nhất. Hoàn hảo cho browser extension, Selenium, hay script tự động.
Query Parameters
TypeNameDescription
requiredemailĐịa chỉ email đầy đủ (vd: test123@smail1s.com). Nếu chưa tồn tại sẽ tự động tạo mới.
Request Example
// Cách 1: Dùng trực tiếp trong browser hoặc curl
// Browser: Copy URL này vào address bar
https://smail1s.com/api/v2/mail/create-and-otp?email=test123@smail1s.com

// Terminal: curl
curl "https://smail1s.com/api/v2/mail/create-and-otp?email=test123@smail1s.com"

// Cách 2: JavaScript fetch (long-polling 60s)
const email = 'test123@smail1s.com';

// Gọi API và đợi OTP
const otp = await fetch(
  `https://smail1s.com/api/v2/mail/create-and-otp?email=${encodeURIComponent(email)}`
).then(r => r.text());

if (otp) {
  console.log('OTP received:', otp); // "456745"
  // Dùng email để đăng ký service
  await registerService(email);
  // Verify với OTP
  await verifyWithOTP(otp);
} else {
  console.log('Timeout or already consumed');
}

// Gọi lần 2 với cùng email → trả rỗng (OTP đã consumed)
const otp2 = await fetch(
  `https://smail1s.com/api/v2/mail/create-and-otp?email=${encodeURIComponent(email)}`
).then(r => r.text());
console.log(otp2); // "" (empty)

// Nếu có mail OTP mới → gọi lại sẽ nhận OTP mới
Response — 200 (Content-Type: text/plain)
456745
POST (Legacy, vẫn hoạt động)
POST https://smail1s.com/api/v2/mail/create-and-otp

POST version trả về JSON với email address, sau đó cần gọi /otp riêng để lấy OTP.

Request Example
const { email } = await fetch('https://smail1s.com/api/v2/mail/create-and-otp', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({ mailbox: 'test123' })
}).then(r => r.json());

// Dùng email để đăng ký
await registerService(email);

// Đọc OTP qua endpoint riêng
const otp = await fetch(
  `https://smail1s.com/api/v2/mail/otp?email=${encodeURIComponent(email)}`
).then(r => r.text());
💡 Endpoint này có cả GET và POST. GET method cho phép dùng trực tiếp trong browser address bar hoặc automation tool đơn giản. Email param: ?email=yourname@smail1s.com
Full Usage Flow
// ========== FLOW 1: Tách biệt (Create riêng + OTP riêng) ==========

// 1. Tạo mailbox
const { email } = await fetch('https://smail1s.com/api/v2/mail/create', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({})
}).then(r => r.json());

console.log('Created:', email);

// 2. Đăng ký dịch vụ bên thứ 3
await registerThirdPartyService(email);

// 3. Đợi OTP (long-polling 60s)
const otp = await fetch(
  `https://smail1s.com/api/v2/mail/otp?email=${encodeURIComponent(email)}`
).then(r => r.text());

if (otp) {
  console.log('OTP received:', otp);
  await verifyWithOTP(otp);
}

// ========== FLOW 2: Combined (tối ưu cho automation) ==========

// Tạo mailbox qua create-and-otp
const { email: email2 } = await fetch('https://smail1s.com/api/v2/mail/create-and-otp', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({})
}).then(r => r.json());

// Đăng ký dịch vụ với tracking param
await registerService({
  email: email2,
  callbackUrl: `https://app.com/verify?localPath=${encodeURIComponent(email2)}`
});

// Đợi OTP - có thể gọi ngay sau khi đăng ký
const otp2 = await fetch(
  `https://smail1s.com/api/v2/mail/otp?email=${encodeURIComponent(email2)}`
).then(r => r.text());

if (otp2) {
  console.log('OTP:', otp2);
  await verifyWithOTP(otp2);
}

// ========== FLOW 3: Kiểm tra inbox thủ công ==========

// Lấy danh sách email
const { messages } = await fetch('https://smail1s.com/api/v2/mail/inbox', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({ email: email })
}).then(r => r.json());

// Đọc chi tiết email đầu tiên
if (messages.length > 0) {
  const detail = await fetch('https://smail1s.com/api/v2/mail/detail', {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({
      email: email,
      uid: messages[0].uid
    })
  }).then(r => r.json());
  
  console.log('Subject:', detail.subject);
  console.log('Text:', detail.text);
}