Bari Karol Wojtyła Airport: Take the Ferrotramviaria airport train to Bari Centrale (about 17 minutes; roughly €5.30), then change to a Ferrotramviaria regional train for Andria/Barletta. Allow about 75–90 minutes airport-to-Andria and roughly €7–8 total. This is better value than an airport transfer or taxi; check the final destination and station name carefully, as Andria has had rail works and service arrangements can change.
Bari Centrale: Ferrotramviaria regional trains toward Barletta serve Andria; allow roughly an hour, depending on the service and station arrangement. Buy the regional ticket rather than paying for a private Bari-to-Andria transfer unless you are a group with substantial luggage.
Andria railway station: The historic centre is close enough to reach on foot in around 10–20 minutes, depending on where you are staying. For Castel del Monte, use urban bus line 6 from the station only in its April–October operating period; allow a large margin because the published timetables have been reported as unreliable.