import { tavily } from "@tavily/core"; import { writeFileSync } from "fs"; const client = tavily({ apiKey: process.env.TAVILY_API_KEY }); const OUTPUT_DIR = "/Users/treyt/Desktop/code/claude_marketing/pipeline/outputs/task_management_feature_launch_20260323"; const queries = [ { query_id: 1, query_name: "Industry Trends & Market Landscape", search_terms: "home maintenance app market trends 2025 2026 property management software homeowners smart home task tracking reminders growth", options: { searchDepth: "advanced", maxResults: 10, topic: "news", days: 30, excludeDomains: ["pinterest.com", "etsy.com"] } }, { query_id: 2, query_name: "Competitor Analysis", search_terms: "Centriq app vs HomeZada vs Thumbtack home maintenance tracking app features pricing reviews marketing 2025 2026", options: { searchDepth: "advanced", maxResults: 10, topic: "general", includeDomains: ["centriq.com", "homezada.com", "thumbtack.com", "techcrunch.com", "producthunt.com", "g2.com", "capterra.com"], excludeDomains: ["pinterest.com"] } }, { query_id: 3, query_name: "Audience Pain Points & Conversations", search_terms: "homeowner forgot HVAC filter change maintenance tasks overwhelmed home upkeep checklist first time homebuyer maintenance schedule busy parents household chores", options: { searchDepth: "advanced", maxResults: 10, topic: "general", includeDomains: ["reddit.com", "twitter.com", "quora.com", "houzz.com"], excludeDomains: ["pinterest.com"] } }, { query_id: 4, query_name: "High-Performing Hooks & Ad Copy", search_terms: "best performing mobile app ad hooks 2025 2026 home productivity app Instagram TikTok ad copy examples high engagement task management app marketing download conversion", options: { searchDepth: "advanced", maxResults: 10, topic: "general", excludeDomains: ["pinterest.com", "etsy.com"] } }, { query_id: 5, query_name: "Viral Content & Cultural Moments", search_terms: "viral home maintenance TikTok homeowner hack spring cleaning 2026 home organization trending content adulting homeownership meme cleaning routine", options: { searchDepth: "advanced", maxResults: 10, topic: "news", days: 14, excludeDomains: ["pinterest.com"] } } ]; async function runQueries() { const results = []; for (const q of queries) { console.log(`Executing query ${q.query_id}: ${q.query_name}...`); try { const response = await client.search(q.search_terms, q.options); results.push({ query_id: q.query_id, query_name: q.query_name, search_terms: q.search_terms, results_count: response.results ? response.results.length : 0, results: response.results || [], answer: response.answer || null }); console.log(` -> Got ${response.results ? response.results.length : 0} results`); } catch (err) { console.error(` -> Error on query ${q.query_id}: ${err.message}`); results.push({ query_id: q.query_id, query_name: q.query_name, search_terms: q.search_terms, results_count: 0, results: [], error: err.message }); } } writeFileSync(`${OUTPUT_DIR}/raw_research_results.json`, JSON.stringify(results, null, 2)); console.log(`\nRaw results saved to ${OUTPUT_DIR}/raw_research_results.json`); } runQueries();