4PX Express Tracking API & MCP
Query live 4PX Worldwide Express (4px, 递四方) cross-border package status, scan history, and domestic last-mile handoff numbers in a single synchronous GET request or MCP tool call. lastscanned auto-detects 18-character 4PX…CN tracking numbers, repairs 4PX's cross-timezone chronological sorting bug, and returns a normalized TrackingResult JSON payload.
Overview & Quick Facts
| Property | Value |
|---|---|
Carrier slug (?carrier=) | 4px |
| Brand & service aliases | 4PX Express, 4PX Worldwide Express (递四方), 4PX…CN |
| Category | China cross-border e-commerce logistics consolidator (Detection precedence #16 of 31) |
| Single-package REST endpoint | GET https://api.lastscanned.com/v1/track/{trackingNumber} |
| Batch REST endpoint | GET https://api.lastscanned.com/v1/track?numbers=4PX...CN,4PX...CN (up to 35 numbers per carrier in a 100-number call) |
MCP server (https://mcp.lastscanned.com) | track_package, track_packages, list_carriers (claude mcp add --transport http lastscanned https://mcp.lastscanned.com) |
| Authentication & pricing | Authorization: Bearer lsk_live_... · 1 free keyless lookup/day per IP · Free tier (5 unique numbers/day, $0) · Pro ($4.99/mo for 1,000 unique numbers, unlimited re-polls, $0.015/extra) · HTTP 402 Stripe MPP ($0.50 for 25-number lsk_pack_ key or $0.02/number in USDC on Tempo) |
Why developers use lastscanned for 4PX Express
- Fixes 4PX's broken cross-timezone scan ordering: 4PX's upstream API computes its
tkDateepoch by interpreting every scan's local wall-clock time (tkDateStr) as Beijing time (UTC+8)—ignoring the scan's actualtkTimezone(UTC-05:00). Because US local wall-clock times are 12–13 hours behind Shenzhen, 4PX sorts Chinese export scans above US last-mile scans that occurred hours later in real UTC time.lastscannedignores the brokentkDateepoch, computes true UTC fromtkDateStr+tkTimezone, and re-sorts the timeline in true chronological order. - Surfaces last-mile carrier & exchange number in
message: When 4PX hands a parcel to USPS, UniUni, or another domestic carrier,lastscannedextracts bothchannelContact(the carrier name) andserverCode(the domestic tracking number) intomessage.
Tracking Number Formats & Auto-Detection (matches vs mayMatch)
4PX is evaluated sixteenth (#16) in lastscanned's two-pass detector:
| Pass | Rule / Regex | Check Digit | Examples |
|---|---|---|---|
Pass 1 (matches) | /^4PX\d{13}CN$/i (4PX + 13 digits + CN = 18 chars) | — | 4PX3002491827361CN, 4PX3000123456789CN |
Pass 2 (mayMatch) | None | — | — |
When is ?carrier=4px optional vs required?
- Optional (auto-detected): All 18-character
4PX+ 13 digits +CNtracking numbers auto-detect in Pass 1. - Required (
?carrier=4px): When querying 4PX's system using the domestic last-mile barcode (e.g. a USPS92…or Royal Mail S10 number that was inducted by 4PX) or a custom merchant order number.
Synchronous GET Request & Normalized JSON Response
curl
curl -s "https://api.lastscanned.com/v1/track/4PX3002491827361CN" \
-H "Authorization: Bearer $LASTSCANNED_API_KEY"JavaScript / TypeScript (fetch)
const res = await fetch("https://api.lastscanned.com/v1/track/4PX3002491827361CN", {
headers: { Authorization: `Bearer ${process.env.LASTSCANNED_API_KEY}` },
});
const pkg = await res.json();
console.log(pkg.status, pkg.message, pkg.events[0]);MCP track_package tool call
{
"tool": "track_package",
"arguments": {
"tracking_number": "4PX3002491827361CN"
}
}Normalized TrackingResult JSON response
{
"carrier": "4px",
"trackingNumber": "4PX3002491827361CN",
"status": "delivered",
"statusDescription": "Delivered, In/At Mailbox",
"service": null,
"deliveredAt": "2026-10-24T19:22:00Z",
"deliveredAtLocal": "2026-10-24T14:22:00",
"signedBy": null,
"destination": {
"city": null,
"state": null,
"country": "US"
},
"estimatedDelivery": null,
"message": "Handed to USPS as 9261290312839104827163",
"events": [
{
"timestamp": "2026-10-24T19:22:00Z",
"localTime": "2026-10-24T14:22:00",
"status": "delivered",
"description": "Delivered, In/At Mailbox",
"location": "DALLAS, TX 75201",
"code": "FPX_L_ok"
},
{
"timestamp": "2026-10-24T11:15:00Z",
"localTime": "2026-10-24T06:15:00",
"status": "out_for_delivery",
"description": "Out for Delivery",
"location": "DALLAS, TX 75201",
"code": "FPX_I_RC"
},
{
"timestamp": "2026-10-20T16:40:00Z",
"localTime": "2026-10-21T00:40:00",
"status": "in_transit",
"description": "Depart from facility to service provider.",
"location": "Shenzhen, China",
"code": "FPX_C_BTC"
},
{
"timestamp": "2026-10-18T03:12:00Z",
"localTime": "2026-10-18T11:12:00",
"status": "label_created",
"description": "Shipment information received",
"location": null,
"code": "FPX_O_CR"
}
]
}Raw status & scan codes:
events[].codepreserves 4PX'stkCode("FPX_O_CR"→label_created,"FPX_C_..."/"FPX_M_..."→in_transit,"FPX_I_RC"→out_for_deliverywhen out for delivery,"FPX_L_ok"→delivered,"FPX_L_RPI"→returned).
Chaining Last-Mile Handoffs (message)
When 4PX assigns a secondary domestic tracking number (serverCode) different from the 4PX…CN number, lastscanned populates message with:
"Handed to USPS as 9261290312839104827163"(whenchannelContactidentifies the last-mile carrier), or"Handed to the destination carrier as <serverCode>"
You can pass that secondary tracking number directly into a follow-up GET /v1/track/{serverCode} call to retrieve native last-mile scans from USPS, UniUni, GOFO, or OnTrac.
Related Resources
- Live browser lookup tool: Track a 4PX Express package live on lastscanned.com/lookup/4px
- Carrier hub: All 31 supported carriers
- Regex & check digits: Tracking number formats & auto-detection
- AI support workflows: WISMO AI agents & synchronous tracking
Yanwen Express Tracking API & MCP
Track Yanwen Logistics (UPU S10 ...YP and YW... tracking numbers) cross-border packages and last-mile USPS / UniUni handoffs via synchronous REST GET or MCP. Normalized JSON status, scan history, and format rules—no carrier credentials required.
Cainiao Tracking API & MCP
Track Cainiao Smart Logistics (LP... and AP... AliExpress Standard Shipping tracking numbers) cross-border packages and last-mile handoffs via synchronous REST GET or MCP. Normalized JSON status, scan history, and format rules—no carrier credentials required.