import * as dotenv from "dotenv"; import axios from "axios"; dotenv.config({ path: "../../.env" }); dotenv.config({ path: "../../apps/web/.env" }); async function testSerper() { const query = "Mittelspannungskabel"; const apiKey = process.env.SERPER_API_KEY || ""; if (!apiKey) { console.error("Missing SERPER_API_KEY"); return; } try { const response = await axios.post( "https://google.serper.dev/search", { q: query, gl: "de", hl: "de", }, { headers: { "X-API-KEY": apiKey, "Content-Type": "application/json", }, }, ); console.log(JSON.stringify(response.data, null, 2)); } catch (error) { console.error("Error:", error); } } testSerper();