'https://api.ujeebu.com/scrape?' . http_build_query([ 'url' => $url ]), CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPHEADER => [ 'ApiKey: ' . $apiKey ] ]); // Execute request $response = curl_exec($ch); $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); // Check if successful if ($httpCode === 200) { $data = json_decode($response, true); $html = $data['html'] ?? $data['text'] ?? ''; echo "✅ Successfully scraped " . strlen($html) . " characters\n"; echo substr($html, 0, 500) . "...\n"; } else { echo "❌ Error: HTTP $httpCode\n"; echo $response . "\n"; } ?>