Carriers

Mainfreight Tracking API & MCP

Query live Mainfreight (mainfreight) package status and scan history in a single synchronous GET request or MCP tool call. Mainfreight numbers are not auto-detected: consignment references have no unique format, so pass ?carrier=mainfreight.

Overview & Quick Facts

PropertyValue
Carrier slug (?carrier=)mainfreight
Brand & service aliasesMainfreight, Mainfreight Transport (mainfreight.com)
CategoryFreight and logistics carrier (New Zealand, Australia, Europe, USA)
Single-package REST endpointGET https://api.lastscanned.com/v1/track/{trackingNumber}?carrier=mainfreight
Batch REST endpointGET https://api.lastscanned.com/v1/track?numbers=ABC1234567,...&carrier=mainfreight
MCP server (https://mcp.lastscanned.com)track_package, track_packages, list_carriers (claude mcp add --transport http lastscanned https://mcp.lastscanned.com)
Authentication & pricingAuthorization: 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 Mainfreight

  • Current status of a freight consignment from Mainfreight's public tracker, without a Mainfreight login.
  • Journey and service: the result carries the consignment's service type and the time its status was set.

Tracking Number Formats & Auto-Detection

PassRule / RegexCheck DigitExamples
Pass 1 (matches)None——
Pass 2 (mayMatch)None——
Explicit (?carrier=mainfreight)A Mainfreight consignment or reference number—ABC1234567

Synchronous GET Request & Normalized JSON Response

curl

curl -s "https://api.lastscanned.com/v1/track/ABC1234567?carrier=mainfreight" \
  -H "Authorization: Bearer $LASTSCANNED_API_KEY"

JavaScript / TypeScript (fetch)

const res = await fetch("https://api.lastscanned.com/v1/track/ABC1234567?carrier=mainfreight", {
  headers: { Authorization: `Bearer ${process.env.LASTSCANNED_API_KEY}` },
});
const pkg = await res.json();
console.log(pkg.status, pkg.events[0]);

MCP track_package tool call

{
  "tool": "track_package",
  "arguments": {
    "tracking_number": "ABC1234567",
    "carrier": "mainfreight"
  }
}

Normalized TrackingResult JSON response

{
  "carrier": "mainfreight",
  "trackingNumber": "ABC1234567",
  "status": "in_transit",
  "statusDescription": "In Transit",
  "service": "AirAndOcean",
  "deliveredAt": null,
  "deliveredAtLocal": null,
  "signedBy": null,
  "destination": null,
  "events": [
    {
      "timestamp": "2026-10-25T21:30:00Z",
      "localTime": null,
      "status": "in_transit",
      "description": "In Transit",
      "location": "Auckland to Sydney",
      "code": null
    }
  ]
}

Notes

  • One event: the public tracker shows a status banner, not a list of scans, so events holds the current status.
  • Written from the page's own scripts: the empty answer for an unknown number was checked live; the field names of a found consignment come from the page's code.

On this page