whereparcel
Stuck on integration? Have a question? The developer is standing by.

USPS Tracking API

Track USPS packages with WhereParcel's unified tracking API. Support for Priority Mail, First-Class, Media Mail, and all USPS services. One API call, instant results.

Quick Start

Track USPS packages with a single API call:

curl -X POST https://api.whereparcel.com/v2/track \
  -H "Authorization: Bearer YOUR_API_KEY:YOUR_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "trackingItems": [{
      "carrier": "us.usps",
      "trackingNumber": "9400111899223456789012"
    }]
  }'

USPS Tracking Number Formats

ServiceFormatExample
Priority Mail9400 1118 9922 3XXX XXXX XX9400111899223456789012
First-Class Package9205 5XXX XXXX XXXX XXXX XX9205590164917312345671
Priority Mail InternationalECXX XXXX XXXX USEC123456789US

Code Examples

JavaScript / Node.js

const response = await fetch('https://api.whereparcel.com/v2/track', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${API_KEY}:${SECRET_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    trackingItems: [{
      carrier: 'us.usps',
      trackingNumber: '9400111899223456789012',
    }],
  }),
});

const data = await response.json();
console.log(data.trackingItems[0].status);
// → "in_transit", "delivered", etc.

Python

import requests

response = requests.post(
    'https://api.whereparcel.com/v2/track',
    headers={
        'Authorization': f'Bearer {API_KEY}:{SECRET_KEY}',
        'Content-Type': 'application/json',
    },
    json={
        'trackingItems': [{
            'carrier': 'us.usps',
            'trackingNumber': '9400111899223456789012',
        }],
    },
)

data = response.json()
print(data['trackingItems'][0]['status'])

Real-Time Updates with Webhooks

Instead of polling, register a webhook to receive USPS status updates automatically. Each tracking number counts as just 1 request — no matter how many status changes occur.

// Register a webhook endpoint
await fetch('https://api.whereparcel.com/v2/webhook-endpoints', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${API_KEY}:${SECRET_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    url: 'https://yourapp.com/webhooks/tracking',
    description: 'USPS tracking updates',
  }),
});

Why WhereParcel for USPS

  • Unified JSON — same response shape across USPS and 60+ other live carriers. No carrier-specific branching code.
  • Honest pricing — Starter $49/mo (10K req), Pro $99/mo (30K), Business $650/mo (300K). 7-day free trial on every paid plan.
  • Free 3 months — write one short blog post mentioning WhereParcel via the ambassador program and get 3 months of Starter free.
  • Don't see a carrier? Request it on our community board — we add new carriers fast.

Try without signup

Use our free Tracking Number Validator to paste any USPS number and instantly see the carrier and service type — no account needed, runs entirely in your browser.

Try with sample USPS number →

Related Resources