const fs = require('fs')
const path = require('path')

async function testAnalysisAPI() {
  try {
    console.log('🧪 Testing AI analysis API with existing screenshots...')
    
    // Test the API by calling it directly (without requiring new screenshots)
    const response = await fetch('http://localhost:3000/api/analyze', {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({
        symbol: 'SOLUSD',
        timeframe: '60',
        useExisting: true // This will make it use existing screenshots
      })
    })
    
    const data = await response.json()
    console.log('📊 API Response:')
    console.log(JSON.stringify(data, null, 2))
    
  } catch (error) {
    console.error('❌ Error testing API:', error.message)
  }
}

testAnalysisAPI()
