๐Ÿ”
Check-in
Check-out
๐Ÿ‘ฅ
2 Adults ยท 0 Child
1 room

Adults

Ages 18 or above

2

Children

Ages 0 to 17

0

Rooms

Total rooms

1

Loading verified properties...

๐Ÿ›ก๏ธ Best Price Guarantee
๐Ÿ‘ค
You could be seeing lower prices
Register or Login and save with our member prices
Searching live accommodations...
Fetching verified real-time rates via TripAdvisor API

Choose Departing Flight

18 flights from New Delhi (DEL) to John F. Kennedy International (JFK)
Don't have an account? Register here

Property Locations Map View

document.addEventListener('DOMContentLoaded', () => { const searchInput = document.querySelector('input[name="origin"], input[type="text"], #flight-origin, .search-input-field'); // Adjust selector above to match your actual search input ID or class if (!searchInput) return; // Create dropdown container dynamically if it doesn't exist let dropdown = document.getElementById('custom-autocomplete-dropdown'); if (!dropdown) { dropdown = document.createElement('div'); dropdown.id = 'custom-autocomplete-dropdown'; dropdown.style.cssText = ` position: absolute; background: #ffffff; border: 1px solid #e2e8f0; border-radius: 8px; box-shadow: 0 10px 25px rgba(0,0,0,0.1); max-height: 350px; overflow-y: auto; z-index: 9999; width: ${searchInput.offsetWidth}px; display: none; margin-top: 4px; `; searchInput.parentNode.style.position = 'relative'; searchInput.parentNode.appendChild(dropdown); } let debounceTimer; // Listen to typing events searchInput.addEventListener('input', (e) => { const query = e.target.value.trim(); clearTimeout(debounceTimer); if (query.length < 2) { dropdown.style.display = 'none'; return; } debounceTimer = setTimeout(async () => { try { // Call your FastAPI backend autocomplete endpoint const response = await fetch(`https://flight-backend-production.up.railway.app/api/destinations/autocomplete?q=${encodeURIComponent(query)}`); const data = await response.json(); const items = data.data || data.results || data; // Adjust based on your API response structure if (!items || items.length === 0) { dropdown.style.display = 'none'; return; } // Render suggestions with badges dropdown.innerHTML = items.map(item => `
๐Ÿ“
${item.name || item.city}
${item.country || ''}
${item.type || 'City'}
`).join(''); dropdown.style.display = 'block'; // Handle click on suggestion dropdown.querySelectorAll('.autocomplete-item').forEach(el => { el.addEventListener('click', () => { searchInput.value = el.getAttribute('data-value'); dropdown.style.display = 'none'; }); }); } catch (err) { console.error("Autocomplete fetch error:", err); } }, 300); // 300ms debounce delay }); // Hide dropdown when clicking outside document.addEventListener('click', (e) => { if (!searchInput.contains(e.target) && !dropdown.contains(e.target)) { dropdown.style.display = 'none'; } }); });