Which region/country are you referring to? What's the use case?
IANAL, but I used to work at one of the large transportation providers. For the high-volume tracking use cases, web site scraping probably won't cut it (too slow, probably get blocked by the carrier). Most high-volume trackers used the carriers' APIs. It was sort of a love-hate relationship and my carrier would sometimes block high-volume carriers who ran refund services on behalf of other customers.
In short, whether it's "legal" or not, if you are doing a high volume of tracking for refunds you will be at the mercy of the carrier who could cut you off at anytime. A firewall against that is to have a bunch of high-volume paying customers of that carrier who would pitch a fit if your service was turned off.
[Edited for clarification]