async function verify() {
  const keyword = 'cafe';
  const location = 'New York';
  const url = `http://localhost:3000/api/search?keyword=${encodeURIComponent(keyword)}&location=${encodeURIComponent(location)}`;
  
  console.log(`Testing URL: ${url}`);
  try {
    const res = await fetch(url);
    console.log(`Status: ${res.status}`);
    const data = await res.json();
    if (data.error) {
      console.error('API Error:', data.error);
    } else {
      console.log(`Found ${data.leads?.length || 0} leads.`);
      if (data.leads && data.leads.length > 0) {
        console.log('Sample Lead:', data.leads[0].name);
      }
    }
  } catch (error) {
    console.error('Fetch Error:', error.message);
  }
}

verify();
