jkeen / tracking_number_data

Shared data for cross platform tracking number detection
MIT License
113 stars 38 forks source link

Tests

Hey there tracking number enthusiast! I don't use this project in any production capacity, and really never have. I am not a tracking number expert, and I don't have inside connections to a shipping company—I'm just a guy that once tried to make a package tracking app and this gem is all that survived. When I have absolutely nothing to do it's kinda fun to tinker with, but time has become more and more of a precious resource. Anyway, maintaining this is thankless work, and if this project has been useful for you I sure would appreciate a cup or two of coffee slid my way as a token of appreciation. A PR would also be nice.

Buy Me A Coffee

About

This repository contains json files that programatically describe how to detect, validate, and decode the following types of tracking numbers:

Supported Tracking Numbers

Carrier Type Length Example Data
UPS UPS 18 1Z5R89390357567127 SerialNumber CheckDigit ShipperId ServiceType PackageId
UPS Waybill 11 K2479825491 V0490119172 ServiceType SerialNumber CheckDigit
National Postal Services (191 Countries) S10 International Standard 13 RB123456785GB SerialNumber CheckDigit CountryCode ServiceType
FedEx FedEx / Ground 15 15 0414 4176 0228 964 SerialNumber CheckDigit
FedEx / Ground (SSCC 18) 18 00 0123 4500 0000 0027 SerialNumber CheckDigit ShippingContainerType
FedEx / Ground (96) 22 9611020987654312345672 SerialNumber CheckDigit ApplicationIdentifier SCNC ServiceType ShipperID PackageId
Fedex / Ground (GSN) 34 9622 0015 6 000 123 4567 1 00 7948 0839 0594 SerialNumber CheckDigit ApplicationIdentifier SCNC GSN
FedEx / Express 12 12 986578788855 SerialNumber CheckDigit
FedEx / Express Saver 34 1001921334250001000300779017972697 SerialNumber CheckDigit DestinationZip
FedEx / SmartPost 20 61299998820821171811 ApplicationIdentifier SerialNumber CheckDigit ServiceType ShipperId PackageId
USPS USPS 20 20 0307 1790 0005 2348 3741 SerialNumber CheckDigit ServiceType MailerId PackageId
USPS 91 25-34 420 221539101026837331000039521 9361 2898 7870 0317 6337 95 7196 9010 7560 0307 7385 SerialNumber CheckDigit RoutingApplicationId DestinationZip SCNC ServiceType ShipperId PackageId
Canada Post Canada Post 20 0073938000549297 OriginId SerialNumber CheckDigit
OnTrac OnTrac (C) 15 C11031500001879 SerialNumber CheckDigit
OnTrac (D) 15 D11031500001879 SerialNumber CheckDigit
DHL DHL Express 10 3318810025 SerialNumber CheckDigit
DHL Express Air 10 73891051146 SerialNumber CheckDigit
DHL E-Commerce 18-20 GM2951173225174494 SerialNumber
Amazon Amazon Logistics 15 TBA 487064622 000 SerialNumber
Landmark Landmark Global LTN 13 LTN74207623N1 SerialNumber
LaserShip Lasership LX 10 LX17635036 SerialNumber
Lasership 1LS7 (15) 15 1LS717793482164 SerialNumber
Lasership 1LS7 (18) 18 1LS7119013618127-1 SerialNumber
DPD DPD 14 15 0998 0000 0200 34D SerialNumber
DPD 28 28 0081 827 0998 0000 0200 45 327 276 N SerialNumber DestinationZip ServiceType CountryCode

JSON Format

Making a contribution

Standard implementations of

Using this repo:

List of Libraries using this repository, by Language

We suggest you check these out before rolling your own implementation.

Ruby:

JS/TS:

Java:

Python:

Go:

I am creating a new library

If you are using this repo, it is most likely because you are writing a library to get information out of tracking numbers.

  1. Please check that your chosen programming language does not already have an implementation of a tracking number parser that uses these json files.
  2. If you are creating a new library, great! Open an issue and let us know. We're happy to help!

I found a bug or missing couriers.


Reference Documents

Located/uploaded to the wiki for preservation