A tracking number can provide clues about the shipping carrier, but its format alone does not always identify the carrier with certainty. Start with the shipping label, order record, or confirmation email; then use the number as a clue and verify the result against the shipment details.
For developers, the same principle applies: preserve the original number as a string, keep any carrier information supplied with the order, and allow an unknown or ambiguous result. A tracking API can help retrieve available shipment information without building a separate integration for every supported carrier.
Start with the shipment context
- Check the label or shipment confirmation for the carrier and service name.
- Look for carrier information in the order, fulfillment, or shipping platform record. Save it alongside the tracking number when available.
- Use the number's prefix and length as hints, then check the shipment through the carrier or a tracking service.
- Compare available details with your order before treating a match as confirmed. If the result is unclear, ask the sender or keep the carrier unknown.
Carrier handoffs complicate identification: the company that accepts a shipment may differ from the one making final delivery. Preserve both carrier and service information when your source provides them.
Tracking-number formats: useful clues, not proof
Formats vary by service and market, can change, and may overlap. The examples below are patterns rather than real shipment numbers; they are not a complete list or a validation rule.
- UPS: A number beginning with
1Zis a common UPS clue. UPS describes an 18-character 1Z tracking number in its shipping validation documentation. Other shipment identifiers exist. - FedEx: Numeric identifiers are not unique to FedEx. Its Poland service guide, for example, describes 12-digit Express and 13-digit domestic numbers. Do not apply those examples as universal rules.
- USPS and DHL: Check the carrier and service recorded on the label or order. A numeric or international-looking number alone is not enough to establish the carrier or DHL division.
- Regional carriers: For carriers such as OnTrac, UniUni, and GOFO, retain the carrier supplied by the seller or shipping system and verify it against the relevant shipment.
A syntactically plausible number does not prove a shipment exists or belongs to a particular customer. Carriers can also reuse identifiers. FedEx documents duplicate tracking-number cases that require additional information to distinguish shipments.
How carrier detection APIs work
A carrier detection service may combine number patterns with other information or carrier lookups to suggest one or more candidates. Implementations differ: some accept a carrier hint, while others return a candidate list or an uncertain result. Check the provider's documentation for the inputs, supported services, costs, and how it represents ambiguity.
Do not equate a detection failure with a lost package. A label may be new, the number may have been copied incorrectly, the service may be unsupported, or carrier data may not yet be available. Keep an unresolved state and offer a way to correct the carrier or number.
Retrieve tracking data with C2W
C2W Package Tracking API documents a single-number tracking endpoint covering UPS, USPS, FedEx, DHL Express, DHL eCommerce, OnTrac, UniUni, and GOFO. Send a number from your server using your RapidAPI credentials:
curl --get 'https://trackingpackage.p.rapidapi.com/TrackingPackage' \
--data-urlencode 'trackingNumber=YOUR_TRACKING_NUMBER' \
--header 'X-RapidAPI-Key: YOUR_RAPIDAPI_KEY' \
--header 'X-RapidAPI-Host: trackingpackage.p.rapidapi.com'
This is a placeholder request, not a live shipment. The endpoint accepts a tracking number; the public documentation does not establish a separate carrier-detection endpoint or guarantee that every number is identified. Test representative shipments and inspect the returned data before relying on it. Keep keys server-side and add an Authorization header only if one was issued for your integration.
Check the HTTP response and handle missing fields or unavailable tracking data without guessing a carrier or delivery status. The integration guide includes server-side examples and failure-handling advice. C2W uses on-demand requests rather than webhooks, so plan polling and retries against your request budget.
Build an identification workflow that handles uncertainty
- Preserve the input: Store tracking numbers as strings so leading zeroes are not lost. Retain the original value and any separately normalized value.
- Record the source: Keep the carrier supplied by the shipping platform separate from any inferred carrier, along with when it was obtained.
- Support review: Allow users or support staff to correct a candidate and keep an unknown state when the evidence is insufficient.
- Verify the match: Compare available shipment details with your order; avoid displaying another shipment's information when identifiers are reused.
- Handle failures: Distinguish network or quota errors from unavailable shipment data. Retry temporary failures deliberately and retain the last known valid status.
Frequently asked questions
Can I identify a carrier from a tracking number alone?
Sometimes the format suggests a carrier, but it may not uniquely identify one. Check the label or order record and verify the shipment when possible.
What if a tracking number is not found?
Check for typing errors and confirm the carrier and service with the sender. A recently created label may not yet have tracking events. An unavailable result alone does not prove that a shipment is lost.
Can one API track multiple carriers?
Multi-carrier APIs provide one integration for supported carriers, but service coverage and fields vary. Test your own shipment mix; see our multi-carrier integration guide and carrier guides.