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

Royal Mail Tracking API

Track Royal Mail packages with WhereParcel's unified tracking API. Support for 1st Class, 2nd Class, Special Delivery, and international services.

Quick Start

Track Royal Mail 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": "gb.royalmail",
      "trackingNumber": "AB123456789GB"
    }]
  }'

Royal Mail Tracking Number Formats

ServiceFormatExample
Royal Mail TrackedXX XXXX XXXX X GBAB123456789GB

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: 'gb.royalmail',
      trackingNumber: 'AB123456789GB',
    }],
  }),
});

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': 'gb.royalmail',
            'trackingNumber': 'AB123456789GB',
        }],
    },
)

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

Real-Time Updates with Webhooks

Instead of polling, register a webhook to receive Royal Mail 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: 'Royal Mail tracking updates',
  }),
});