This guide provides instructions on how to integrate with the USPS tracking API using your sub-API key.
https://my.labelscheap.com/
GET /api/barcodev2.php
| user_name | The username associated with the API key. |
| api_key | The valid API key provided to the user. |
| zip | Receiver Zip Code. |
| tracking | The USPS tracking number to be queried. |
curl -X GET "https://my.labelscheap.com/api/track.php?user_name=johndoe&tracking=123456789&api_key=abc123&zip=90001"
// Prepare the API endpoint and parameters
$api_url = "my.labelscheap.com/api.php";
$params = [
'user_name' => 'johndoe',
'api_key' => 'abc123',
'zip' => '9001',
'tracking' => '123456789'
];
// Build the URL with parameters
$url = $api_url . '?' . http_build_query($params);
// Fetch the response
$response = file_get_contents($url);
// Decode the response
$data = json_decode($response, true);
// Output the result
print_r($data);
import requests
# Prepare the API endpoint and parameters
url = "my.labelscheap.com/api.php"
params = {
'user_name': 'johndoe',
'api_key' : 'abc123',
'zip': '9001',
'tracking': '92000000000'
}
# Send GET request
response = requests.get(url, params=params)
# Print the response in JSON format
print(response.json())
fetch("https://my.labelscheap.com/api/tracking.php?user_name=johndoe&tracking=123456789&api_key=abc123&zip=9001")
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
const axios = require('axios');
const params = {
user_name: 'johndoe',
zip: '9001',
tracking: '123456789',
api_key: 'abc123'
};
axios.get('https://my.labelscheap.com/api/tracking.php', { params })
.then(response => console.log(response.data))
.catch(error => console.error('Error:', error));
Dim client As New WebClient()
Dim url As String = "https://my.labelscheap.com/api/tracking.php?user_name=johndoe&tracking=123456789&api_key=abc123&zip=9001"
Dim response As String = client.DownloadString(url)
Console.WriteLine(response)
{
"success": true,
"barcode_data_url": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAvoAAAB7AQMAAAA/orbCA..=="
}
user_name does not match any entry in the users table.current_balance is less than 1.tracking number does not exist or is not valid in the USPS system.user_id will be updated from the user profile page.If you have any questions, feel free to contact our support team!