Closed ramchennuru closed 5 months ago
While using TavilySearch API, some times it is throwing 502 error(Bad Gateway)
Code: try { const response = await fetch('https://api.tavily.com/search', { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ api_key: apiKey, query: query, search_depth: 'basic', max_results: 4, include_domains: [domain], }), }); const data = await response.json(); console.log(data.results); return data; } catch (error) { throw new Error(Error fetching data: ${error.message}); }
Error fetching data: ${error.message}
This should be resolved by now
While using TavilySearch API, some times it is throwing 502 error(Bad Gateway)
Code: try { const response = await fetch('https://api.tavily.com/search', { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ api_key: apiKey, query: query, search_depth: 'basic', max_results: 4, include_domains: [domain], }), }); const data = await response.json(); console.log(data.results); return data; } catch (error) { throw new Error(
Error fetching data: ${error.message}
); }