TSA wait times come from airport data feeds, sampled every 60 seconds. Immigration figures come from U.S. Customs and Border Protection arrival records. All waits are estimates — leave yourself a margin.
The full history behind these numbers is published as a free open dataset — download it here.