> ## Documentation Index
> Fetch the complete documentation index at: https://docs.groweasy.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Credits

> Check the remaining credits for your account.

## Example

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET "https://api.groweasy.io/credits" \
    -H "Authorization: Bearer YOUR_API_KEY"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api.groweasy.io/credits', {
    headers: {
      'Authorization': 'Bearer YOUR_API_KEY',
    },
  });

  const data = await response.json();
  console.log(data.data.credits); // 5000
  console.log(data.data.plan); // "pro"
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      "https://api.groweasy.io/credits",
      headers={"Authorization": "Bearer YOUR_API_KEY"},
  )

  data = response.json()
  print(data["data"]["credits"])  # 5000
  print(data["data"]["plan"])  # "pro"
  ```
</CodeGroup>

## Response

```json theme={null}
{
  "success": true,
  "data": {
    "credits": 5000,
    "plan": "pro",
    "resetDate": "2024-02-01T00:00:00Z"
  }
}
```

## Check Credits Before Scraping

It's good practice to check your credit balance before starting a large scrape:

```javascript theme={null}
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();
}
```


## OpenAPI

````yaml GET /credits
openapi: 3.1.0
info:
  title: GrowEasy API
  description: >-
    The GrowEasy API allows you to programmatically start scrapes, check status,
    manage credits, and find/verify emails.
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.groweasy.io
security:
  - bearerAuth: []
paths:
  /credits:
    get:
      summary: Get Credits
      description: Check the remaining credits for your account.
      operationId: getCredits
      responses:
        '200':
          description: Credits retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreditsResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    CreditsResponse:
      type: object
      properties:
        success:
          type: boolean
          example: true
        data:
          type: object
          properties:
            credits:
              type: integer
              description: Remaining credits
              example: 5000
            plan:
              type: string
              description: Current subscription plan
              example: pro
            resetDate:
              type: string
              format: date-time
              description: When credits will reset
              example: '2024-02-01T00:00:00Z'
    Error:
      type: object
      required:
        - success
        - error
      properties:
        success:
          type: boolean
          example: false
        error:
          type: object
          properties:
            code:
              type: string
              description: Error code
              example: INVALID_REQUEST
            message:
              type: string
              description: Human-readable error message
              example: The request body is missing required fields
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API key authentication. Get your API key from the GrowEasy dashboard.

````