cURL
curl --request GET \ --url https://api.groweasy.io/credits \ --header 'Authorization: Bearer <token>'
{ "success": true, "data": { "credits": 5000, "plan": "pro", "resetDate": "2024-02-01T00:00:00Z" } }
Check the remaining credits for your account.
curl -X GET "https://api.groweasy.io/credits" \ -H "Authorization: Bearer YOUR_API_KEY"
async function startScrapeIfCreditsAvailable(filters, requiredCredits) { // Check credits first const creditsResponse = await fetch('https://api.groweasy.io/credits', { headers: { 'Authorization': 'Bearer YOUR_API_KEY' }, }); const { data: { credits } } = await creditsResponse.json(); if (credits < requiredCredits) { throw new Error(`Insufficient credits: ${credits} available, ${requiredCredits} required`); } // Start the scrape const scrapeResponse = await fetch('https://api.groweasy.io/start', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ filters }), }); return scrapeResponse.json(); }
API key authentication. Get your API key from the GrowEasy dashboard.
Credits retrieved successfully
true
Show child attributes