HS Mail API

Simple and Powerful API Integration

Your API Key

Login Required

Please login to generate your API key.

Authentication

Include your API key in every request using one of these methods:

Method 1: Header (Recommended)

X-API-Key: your_api_key_here

Method 2: Query Parameter

?api_key=your_api_key_here

API Endpoints

GET
https://hsmail.shop/api/v1/profile
Full URL (with API Key):
https://hsmail.shop/api/v1/profile?api_key=YOUR_API_KEY

Get your account profile and balance.

Method: GET | Authentication: Required (API Key via header or query parameter)

@php
$apiKey = 'YOUR_API_KEY';
$url = 'https://hsmail.shop/api/v1/profile?api_key=' . $apiKey;

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Accept: application/json',
    'X-API-Key: ' . $apiKey
]);
$response = curl_exec($ch);
curl_close($ch);

$result = json_decode($response, true);
print_r($result);
GET
https://hsmail.shop/api/v1/products
Full URL (with API Key):
https://hsmail.shop/api/v1/products?api_key=YOUR_API_KEY

Get all active products with categories, prices, and stock.

Method: GET | Authentication: Required (API Key via header or query parameter)

@php
$apiKey = 'YOUR_API_KEY';
$url = 'https://hsmail.shop/api/v1/products?api_key=' . $apiKey;

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Accept: application/json',
    'X-API-Key: ' . $apiKey
]);
$response = curl_exec($ch);
curl_close($ch);

$result = json_decode($response, true);
print_r($result);
GET
https://hsmail.shop/api/v1/product/1
Full URL (with API Key):
https://hsmail.shop/api/v1/product/1?api_key=YOUR_API_KEY

Get details of a specific product. Replace 1 with product ID.

Method: GET | Authentication: Required (API Key via header or query parameter)

ParameterTypeRequiredDescription
idintegerRequiredProduct ID
@php
$apiKey = 'YOUR_API_KEY';
$productId = 1;
$url = 'https://hsmail.shop/api/v1/product/' . $productId . '?api_key=' . $apiKey;

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Accept: application/json',
    'X-API-Key: ' . $apiKey
]);
$response = curl_exec($ch);
curl_close($ch);

$result = json_decode($response, true);
print_r($result);
GET
https://hsmail.shop/api/v1/calculate-price?product_id=1&quantity=10
Full URL (with API Key):
https://hsmail.shop/api/v1/calculate-price?product_id=1&quantity=10&api_key=YOUR_API_KEY

Calculate final price with discounts and coupons.

Method: GET | Authentication: Required (API Key via header or query parameter)

ParameterTypeRequiredDescription
product_idintegerRequiredProduct ID
quantityintegerRequiredQuantity
coupon_codestringOptionalCoupon code
@php
$apiKey = 'YOUR_API_KEY';
$url = 'https://hsmail.shop/api/v1/calculate-price?product_id=1&quantity=10&api_key=' . $apiKey;

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Accept: application/json',
    'X-API-Key: ' . $apiKey
]);
$response = curl_exec($ch);
curl_close($ch);

$result = json_decode($response, true);
print_r($result);
GET
https://hsmail.shop/api/v1/place-order?product_id=1&quantity=5
Full URL (with API Key):
https://hsmail.shop/api/v1/place-order?product_id=1&quantity=5&api_key=YOUR_API_KEY

Place an order (requires sufficient balance).

Method: GET | Authentication: Required (API Key via header or query parameter)

ParameterTypeRequiredDescription
product_idintegerRequiredProduct ID
quantityintegerRequiredQuantity
coupon_codestringOptionalCoupon code
@php
$apiKey = 'YOUR_API_KEY';
$url = 'https://hsmail.shop/api/v1/place-order?product_id=1&quantity=5&api_key=' . $apiKey;

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Accept: application/json',
    'X-API-Key: ' . $apiKey
]);
$response = curl_exec($ch);
curl_close($ch);

$result = json_decode($response, true);
print_r($result);
GET
https://hsmail.shop/api/v1/orders
Full URL (with API Key):
https://hsmail.shop/api/v1/orders?api_key=YOUR_API_KEY

Get your order history (last 50 orders).

Method: GET | Authentication: Required (API Key via header or query parameter)

@php
$apiKey = 'YOUR_API_KEY';
$url = 'https://hsmail.shop/api/v1/orders?api_key=' . $apiKey;

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Accept: application/json',
    'X-API-Key: ' . $apiKey
]);
$response = curl_exec($ch);
curl_close($ch);

$result = json_decode($response, true);
print_r($result);
GET
https://hsmail.shop/api/v1/stats
Full URL (with API Key):
https://hsmail.shop/api/v1/stats?api_key=YOUR_API_KEY

Get your API usage statistics.

Method: GET | Authentication: Required (API Key via header or query parameter)

@php
$apiKey = 'YOUR_API_KEY';
$url = 'https://hsmail.shop/api/v1/stats?api_key=' . $apiKey;

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Accept: application/json',
    'X-API-Key: ' . $apiKey
]);
$response = curl_exec($ch);
curl_close($ch);

$result = json_decode($response, true);
print_r($result);

Mailbox API

Read mailboxes (Gmail, Hotmail/Outlook, Business Mail) without requiring your main API Key.

GET
https://hsmail.shop/api/v1/public/mailbox/gmail?email=user@gmail.com|token
Full URL Format:
https://hsmail.shop/api/v1/public/mailbox/gmail?email=user@gmail.com|token

What is this for?
This endpoint allows you to check the status of a Gmail account and extract verification codes (e.g., for Instagram, Facebook, Netflix) from its emails. It uses internal tokens to access the mailbox securely.

Method: GET | Authentication: Not required

ParameterTypeRequiredDescription
emailstringRequiredFormat: email|token. The Gmail address and its access token separated by a pipe.
@php
$email = 'user@gmail.com|token';
$url = 'https://hsmail.shop/api/v1/public/mailbox/gmail?email=' . urlencode($email);

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);

$result = json_decode($response, true);
print_r($result);
GET
https://hsmail.shop/api/v1/public/mailbox/hotmail?accounts[]=user@outlook.com|pass|token|client||recovery@gmail.com&mode=oauth
Full URL Format:
https://hsmail.shop/api/v1/public/mailbox/hotmail?accounts[]=user@outlook.com|pass|token|client_id||recovery@gmail.com&mode=oauth

What is this for?
Check Microsoft Outlook or Hotmail accounts for emails. It supports both OAuth2 tokens and direct Graph API access. You can check multiple accounts at once.

Method: GET | Authentication: Not required

ParameterTypeRequiredDescription
accounts[]arrayRequiredList of accounts. Format: email|pass|token|client_id||recovery_email
modestringOptionaloauth (default) or graph
Format: email|password|refresh_token|client_id|recovery_email
Example: user@outlook.com|password123|token|client_id||recovery@gmail.com
GET
https://hsmail.shop/api/v1/public/mailbox/business-email?token=YOUR_TOKEN
Full URL Format:
https://hsmail.shop/api/v1/public/mailbox/business-email?token=YOUR_TOKEN

What is this for?
Connect to a Business Email server using a specific access token to retrieve messages.

Method: GET | Authentication: Not required

ParameterTypeRequiredDescription
tokenstringRequiredThe access token string.
GET
https://hsmail.shop/api/v1/public/facebook/live?uid=USER_ID
Full URL Format:
https://hsmail.shop/api/v1/public/facebook/live?uid=USER_ID

What is this for?
Check if a specific Facebook User ID (UID) is currently live or active. Useful for verifying Facebook account status.

Method: GET | Authentication: Not required

ParameterTypeRequiredDescription
uidstringRequiredThe Facebook User ID to check.
$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://hsmail.shop/api/v1/public/facebook/live?uid=1000...',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
));

$response = curl_exec($curl);
curl_close($curl);

$result = json_decode($response, true);
if ($result['status'] === 'live') {
    echo "User is Live!";
}

POST
https://hsmail.shop/api/refresh-token

Refresh Microsoft/Outlook OAuth2 tokens by exchanging a refresh token for a new access token. This endpoint connects directly to Microsoft's Identity Platform.

ParameterTypeRequiredDescription
client_idstringRequiredYour Application Client ID (from Azure Portal).
refresh_tokenstringRequiredThe expired or valid refresh token.
client_secretstringOptionalClient Secret (required for Web Apps, optional for Public Clients).

Live Console

Code Examples

$curl = curl_init();

$postData = array(
    'client_id' => 'YOUR_CLIENT_ID',
    'refresh_token' => 'YOUR_REFRESH_TOKEN',
    'client_secret' => 'YOUR_CLIENT_SECRET' // Optional
);

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://hsmail.shop/api/refresh-token',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => json_encode($postData),
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);
curl_close($curl);
echo $response;

2FA Generator API

Generate 2FA TOTP codes programmatically.

GET
https://hsmail.shop/api/2fa-generate

Generate a current TOTP code from a secret key.

ParameterTypeRequiredDescription
key String Yes The 2FA Secret Key (Base32 encoded)
curl -X GET "https://hsmail.shop/api/2fa-generate?key=JBSWY3DPEHPK3PXP"

Error Handling

All API errors follow this standardized format:

{ "success": false, "error": "Error message description" }

Common HTTP Status Codes:

Code Meaning Description
200 OK Request successful
400 Bad Request Invalid parameters
401 Unauthorized Invalid or missing API key
404 Not Found Resource not found
500 Server Error Internal server error