The MyTSA Web Service API supports several features, some of which include: Security Checkpoint Wait Times, TSA Pre-Check locations, and Sunrise/Sunset times for all locations. Data can be queried by state and/or airport. The TSA provides XML files of data in addition to the API with documentation. Example in Python
import requests # Returns JSON file of today’s sunset time for DCA airport response = requests.get('http://apps.tsa.dhs.gov/MyTSAWebService/GetEventInfo.ashx?eventtype=sunset&airportcode=DCA&output=json') data = response.json()
Example in R
library(jsonlite) # Returns JSON file of today’s sunset time for DCA airport data <- fromJSON('http://apps.tsa.dhs.gov/MyTSAWebService/GetEventInfo.ashx?eventtype=sunset&airportcode=DCA&output=json')