If you are going to travel to or in transit through the United States, be advised that citizens of the countries included in the Visa Waiver Programme "ESTA" must apply for an electronic travel authorisation. It is best to complete the registration procedure a minimum of 72 hours before the flight departs in order to get official authorisation in time. We recommend that you carry a printed copy of the authorisation together with all the other necessary documents for your trip.
If you have been to Cuba since 12 January 2021 and therefore have a Cuban stamp in your passport, you will not be able eligible to use the ESTA scheme and will have to apply for a B1 or B2 visa at the Consulate General or Consular Section of the Embassy of the United States in your place of residence.
The number on Spanish passports consists of 9 characters: 3 letters followed by 6 digits. Due to the typography used, the number 0 (zero) is sometimes confused with the letter O, and vice versa. Make sure that you enter all the characters correctly when you fill in the ESTA application.
Here you can get detailed information about ESTA
Airlines are required by law to provide the US authorities with the details of passengers on flights to the US through the Advance Passenger Information (API) system. You can do it any time prior to your flight at Manage your booking.