I noticed there are several shipment tracking sites. Does anyone know how tracking parcels is done from different post offices? Post offices don't have public API
s (at least not all). Do post offices perhaps use means that don't use the Internet?
Going through your post, I find two questions embedded in it:
Let me answer the second question first:
2) How are parcels from different post offices tracked?
Every postal network worth its salt will be using some kind of technological solution to track packages - capturing information like where they originated from, which intermediate hop they are currently at, and where will they be delivered. You can get this information only for packages which have a tracking number, so a registered post or equivalent is trackable, but a simple stamped post may not be trackable.
For example, India Post allows you to track by consignment number. A tracking number is essentially linked to a bar code, which is physically implanted on the parcel (think barcode stickers). A group of parcels at any stage could be collectively referred to as a shipment (probably within a container of their own), each shipment having a barcode. As such, every time shipments are moving between hops, the tracking information is getting updated based on either the shipment barcode or the parcel barcode. At every stage up to actual delivery, the successive hops are thus identified.
Just like banks and ATMs are connected to centralized infrastructure and so you don't get to withdraw all your money from different bank branches many times over; Every post office doesn't have its own tracking solution, they are all connected to centralized servers when they are part of the same postal network.
Sometimes these postal network may expose their APIs, while at other times, independent hackers may write wrappers around their UI features that were exposed for retail consumers to track packages. For example, here is a github project which helps get the tracking information from India Post, in API format.
Now, coming back to the first question:
1) How do websites track couriers across multiple sites and delivery partners
Many delivery partners may provide their package track API's, while others may do it via a custom form on their website. For example, Delhivery in India have their APIs to track packages.
Thus, every generic courier tracking site has to either integrate APIs from a courier agency, or has to put Iframe
s where it is loading the delivery partner's tracking mechanism.
A simple google search for track courier
could give you a list of many such sites. Selecting one at random, TrackCourier.in, it is easy to see that they have written one PHP page per courier partner they have, embedding iframe for the courier agency within their site.
OP says in comments,
I don't think 17track or trackitonline.ru use iframes... Then these tracking sites only need to partner with a singel post office to get access to the entire tracking system.
Sadly, that is not the case. Going through the multiple sites mentioned by OP, the sites clearly mention that they integrate newer channels on their own, and this usually happens via API.
So trackitonline mentions on its about page: Track It generally aggregate information provided by official deliverer companies using their public or internal syatems and databases, except some transport companies, which have no such systems.
And 17track has this on its website: Started from dozens of postal carriers and integrated 100's of cross border logistics provider.
(I've emphasised in Italics the relevant information)
Essentially, all such sites either have preferential access to the systems of postal companies, or have developed means to integrate their functionality via iframes and other UI hacks.