> ## Documentation Index
> Fetch the complete documentation index at: https://projectdiscovery-feat-gsoc.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Your GET endpoint for email stats

> get leaks stats for an email

## Overview

Get statistical information about leaks associated with a specific email address. This endpoint provides aggregate data for personal leak monitoring and analysis.

<Info>
  This endpoint is primarily used for personal email leak statistics. For organizational monitoring, consider using the domain stats endpoint instead.
</Info>

## Query Parameters

| Parameter      | Type    | Description                                                |
| -------------- | ------- | ---------------------------------------------------------- |
| `email`        | string  | **Required.** The email address to get leak statistics for |
| `unmask_email` | boolean | Whether to unmask email addresses in the response          |

## Response Structure

The response provides comprehensive statistics about leaks for the specified email:

```json theme={null}
{
  "email": "user@example.com",
  "total_leaks": 25,
  "open_leaks": 18,
  "fixed_leaks": 7,
  "leak_classification": {
    "personal_leaks": 15,
    "employee_leaks": 8,
    "customer_leaks": 2
  },
  "recent_activity": {
    "last_30_days": 3,
    "last_7_days": 1
  },
  "compromised_services": [
    {
      "service": "facebook.com",
      "count": 8,
      "last_seen": "2023-03-15T10:30:00Z"
    },
    {
      "service": "linkedin.com",
      "count": 5,
      "last_seen": "2023-02-28T14:20:00Z"
    }
  ],
  "risk_timeline": [
    {
      "date": "2023-03",
      "new_leaks": 3,
      "fixed_leaks": 1
    },
    {
      "date": "2023-02", 
      "new_leaks": 5,
      "fixed_leaks": 2
    }
  ]
}
```

## Data Fields Explained

| Field                  | Description                                           |
| ---------------------- | ----------------------------------------------------- |
| `email`                | The email address these statistics apply to           |
| `total_leaks`          | Total number of leaks found for this email            |
| `open_leaks`           | Number of leaks that haven't been marked as fixed     |
| `fixed_leaks`          | Number of leaks marked as remediated                  |
| `leak_classification`  | Breakdown by leak type (personal, employee, customer) |
| `recent_activity`      | New leak discovery in recent time periods             |
| `compromised_services` | Services where this email was found in leaks          |
| `risk_timeline`        | Historical trend of leak discovery and remediation    |

## Usage Examples

### Get basic email stats

```bash theme={null}
curl -X GET "https://api.projectdiscovery.io/v1/leaks/stats/email?email=user@example.com" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

### Get stats with unmasked emails

```bash theme={null}
curl -X GET "https://api.projectdiscovery.io/v1/leaks/stats/email?email=user@example.com&unmask_email=true" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

## Privacy Considerations

### Access Control

* You can only access stats for emails you're authorized to view
* Personal emails: accessible to the account owner
* Employee emails: requires domain verification

### Data Sensitivity

* Email statistics may reveal sensitive information about user behavior
* Consider data retention policies for stored statistics
* Implement appropriate access controls in your applications

## Best Practices

### Regular Monitoring

* Check email stats periodically for accounts under your management
* Set up alerts for new leak discoveries
* Track remediation progress to ensure security improvements

### Integration Tips

* Use this endpoint for summary dashboards and reports
* Combine with detailed leak endpoints for comprehensive security monitoring
* Cache results appropriately to minimize API usage

### Security Recommendations

* Encourage users to fix open leaks promptly
* Provide guidance on changing passwords for compromised services
* Monitor trends to identify systemic security issues


## OpenAPI

````yaml get /v1/leaks/stats/email
openapi: 3.1.0
info:
  title: PDCP API
  version: '1.0'
  summary: ProjectDiscovery Cloud Platform
  description: >-
    For more details, checkout
    https://docs.projectdiscovery.io/api-reference/editor/scan
servers:
  - url: https://api.projectdiscovery.io
    description: Production
  - url: https://api.dev.projectdiscovery.io
    description: Development
  - url: http://localhost:8085
    description: Localhost
security:
  - X-API-Key: []
paths:
  /v1/leaks/stats/email:
    get:
      tags:
        - leaks
      summary: Your GET endpoint for email stats
      description: get leaks stats for an email
      operationId: get-v1-leaks-stats-email
      parameters:
        - schema:
            type: string
          in: query
          name: email
          description: Email to get stats for
        - schema:
            type: boolean
          in: query
          name: unmask_email
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  leak_devices_count:
                    type: array
                    items:
                      $ref: '#/components/schemas/DevicesCount'
                  leak_customers_count:
                    type: array
                    items:
                      $ref: '#/components/schemas/CustomersCount'
                  leak_user_count:
                    type: array
                    items:
                      $ref: '#/components/schemas/UsersCount'
                  leak_employees_count:
                    type: array
                    items:
                      $ref: '#/components/schemas/EmployeesCount'
                  combolist_exposure:
                    type: array
                    items:
                      $ref: '#/components/schemas/CombolistExposureCount'
                  leak_country_stats:
                    type: array
                    items:
                      $ref: '#/components/schemas/LeakCountryStats'
                  top_used_urls_by_customers:
                    type: array
                    items:
                      $ref: '#/components/schemas/UsedUrlsCount'
                  top_used_urls_by_employees:
                    type: array
                    items:
                      $ref: '#/components/schemas/UsedUrlsCount'
                  top_used_urls_by_user:
                    type: array
                    items:
                      $ref: '#/components/schemas/UsedUrlsCount'
                  leak_customers_timeline:
                    type: array
                    items:
                      $ref: '#/components/schemas/LeaksTimeline'
                  leak_user_timeline:
                    type: array
                    items:
                      $ref: '#/components/schemas/LeaksTimeline'
                  leak_employees_timeline:
                    type: array
                    items:
                      $ref: '#/components/schemas/LeaksTimeline'
                  customers_sample_data:
                    type: array
                    items:
                      $ref: '#/components/schemas/LeaksUsersSampleData'
                  employees_sample_data:
                    type: array
                    items:
                      $ref: '#/components/schemas/LeaksUsersSampleData'
                  user_sample_data:
                    type: array
                    items:
                      $ref: '#/components/schemas/LeaksUsersSampleData'
        '400':
          $ref: '#/components/responses/MessageResponse'
        '401':
          $ref: '#/components/responses/MessageResponse'
        '403':
          $ref: '#/components/responses/MessageResponse'
        '404':
          $ref: '#/components/responses/MessageResponse'
        '500':
          $ref: '#/components/responses/MessageResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
components:
  schemas:
    DevicesCount:
      title: DevicesCount
      type: object
      properties:
        devices:
          type: number
    CustomersCount:
      title: CustomersCount
      type: object
      properties:
        customers:
          type: number
    UsersCount:
      title: UsersCount
      type: object
      properties:
        user:
          type: number
    EmployeesCount:
      title: EmployeesCount
      type: object
      properties:
        employees:
          type: number
    CombolistExposureCount:
      title: CombolistExposureCount
      type: object
      properties:
        combolist_exposure:
          type: number
    LeakCountryStats:
      title: LeakCountryStats
      type: object
      properties:
        Country:
          type: string
        CredentialsCount:
          type: number
    UsedUrlsCount:
      title: UsedUrlsCount
      type: object
      properties:
        count:
          type: number
        url:
          type: string
    LeaksTimeline:
      title: LeaksTimeline
      type: object
      properties:
        CredentialsCount:
          type: number
        Month:
          type: number
        Year:
          type: number
    LeaksUsersSampleData:
      title: LeaksUsersSampleData
      type: object
      properties:
        password:
          type: string
        username:
          type: string
        url:
          type: string
        country:
          type: string
        log_date:
          type: string
  responses:
    MessageResponse:
      description: Example response
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
            required:
              - message
    ErrorResponse:
      description: Example response
      content:
        application/json:
          schema:
            type: object
            required:
              - message
            properties:
              message:
                type: string
              kind:
                type: string
              code:
                type: string
              error:
                type: string
              error_id:
                type: string
              param:
                type: string
              status:
                type: integer
  securitySchemes:
    X-API-Key:
      name: X-API-Key
      type: apiKey
      in: header

````