# n8n-nodes-betterenrich

![n8n-nodes-betterenrich](https://img.shields.io/npm/v/n8n-nodes-betterenrich.svg)
![License](https://img.shields.io/npm/l/n8n-nodes-betterenrich.svg)
![Downloads](https://img.shields.io/npm/dt/n8n-nodes-betterenrich.svg)

This is an n8n community node that integrates with [BetterEnrich](https://betterenrich.com) API for data enrichment operations. It allows you to find work emails, personal emails, mobile phone numbers, and perform various other data enrichment tasks within your n8n workflows.

[n8n](https://n8n.io/) is a [fair-code licensed](https://docs.n8n.io/reference/license/) workflow automation platform.

## Installation

Follow the [installation guide](https://docs.n8n.io/integrations/community-nodes/installation/) in the n8n community nodes documentation.

### Community Nodes (Recommended)

1. Go to **Settings > Community Nodes** in your n8n instance
2. Select **Install**
3. Enter `n8n-nodes-betterenrich` as the npm package name
4. Agree to the risks of using community nodes
5. Select **Install**

After installation restart n8n to register the node.

### Manual Installation

To get started install the package in your n8n root directory:

```bash
npm install n8n-nodes-betterenrich
```

For Docker-based deployments add the following line before the font installation command in your [n8n Dockerfile](https://github.com/n8n-io/n8n/blob/master/docker/images/n8n/Dockerfile):

```dockerfile
RUN cd /usr/local/lib/node_modules/n8n && npm install n8n-nodes-betterenrich
```

## Configuration

Before using this node, you need to configure your BetterEnrich API credentials:

1. Create a new credential of type **BetterEnrich API**
2. Enter your API key from your [BetterEnrich dashboard](https://app.betterenrich.com)
3. Test the connection to verify your credentials

## Operations

This node supports the following BetterEnrich operations:

### Work Email
- **Find**: Create a task to find work email addresses
- **Get Result**: Retrieve results from a find work email task

### Personal Email
- **Find**: Create a task to find personal email addresses
- **Get Result**: Retrieve results from a find personal email task

### Personal Email Bulk
- **Find Bulk**: Process multiple LinkedIn URLs for personal email finding
- **Get Bulk Result**: Retrieve results from bulk personal email tasks

### Mobile Phone Number
- **Find**: Create a task to find mobile phone numbers
- **Get Result**: Retrieve results from a find mobile phone task

### Google Ads Check
- **Check**: Verify if a website is running Google Ads

### Facebook Ads Check
- **Check**: Verify if a Facebook page is running Facebook Ads

### Social Media URLs
- **Find**: Extract social media URLs from a company website

### Normalize Company Name
- **Normalize**: Standardize company name formatting

### Normalize Person Name
- **Normalize**: Standardize person name formatting

### Find Website from Company
- **Find**: Discover company websites from company names

### Find LinkedIn Profile by Email
- **Find**: Locate LinkedIn profiles using email addresses

### Find LinkedIn Profile by Name
- **Find**: Locate LinkedIn profiles using names and company information

### Check ESP
- **Check**: Identify Email Service Provider from website or email

### Check DNC List
- **Check**: Verify if US phone numbers are on Do Not Call lists

### Verify Catch-all Email
- **Verify**: Validate catch-all email addresses
- **Get Result**: Retrieve verification results

### Verify Normal Email
- **Verify**: Validate normal email addresses using Million Verifier

### Check Gender
- **Check**: Determine gender from full names

## Usage Examples

### Find Work Email

```json
{
  "nodes": [
    {
      "parameters": {
        "resource": "workEmail",
        "operation": "find",
        "full_name": "John Smith",
        "company_domain": "example.com"
      },
      "type": "n8n-nodes-betterenrich.betterEnrich",
      "typeVersion": 1,
      "position": [250, 300]
    }
  ]
}
```

### Check Gender from Name

```json
{
  "nodes": [
    {
      "parameters": {
        "resource": "checkGender",
        "operation": "check",
        "FullName": "Alex Johnson"
      },
      "type": "n8n-nodes-betterenrich.betterEnrich",
      "typeVersion": 1,
      "position": [250, 300]
    }
  ]
}
```

### Verify Email Address

```json
{
  "nodes": [
    {
      "parameters": {
        "resource": "verifyNormalEmail",
        "operation": "verify",
        "email": "test@example.com"
      },
      "type": "n8n-nodes-betterenrich.betterEnrich",
      "typeVersion": 1,
      "position": [250, 300]
    }
  ]
}
```

## Error Handling

The node provides comprehensive error handling with descriptive messages:

- **Authentication Errors**: Invalid API key or permissions
- **Rate Limiting**: API quota exceeded
- **Validation Errors**: Invalid input parameters
- **Network Errors**: Connection timeouts or failures
- **API Errors**: Service-specific error responses

## Async Operations

Many BetterEnrich operations are asynchronous. For these operations:

1. Use the **Find** operation to create a task (returns a task ID)
2. Use the **Get Result** operation with the task ID to retrieve results
3. Check the `status` field in the response:
   - `pending`: Task is queued
   - `processing`: Task is being processed
   - `completed`: Results are available
   - `failed`: Task failed (check error message)

## Webhook Support

For asynchronous operations, you can provide a webhook URL to receive notifications when tasks complete, eliminating the need to poll for results.

## Rate Limits

BetterEnrich API has rate limits. The node handles rate limiting gracefully and provides appropriate error messages when limits are exceeded.

## Compatibility

- **n8n version**: 0.198.0 or later
- **Node.js version**: 18.10 or later

## Resources

- [BetterEnrich API Documentation](https://app.betterenrich.com/api/docs)
- [BetterEnrich Dashboard](https://app.betterenrich.com)
- [n8n Community Nodes Documentation](https://docs.n8n.io/integrations/community-nodes/)

## Version History

### 0.1.0
- Initial release
- Support for all BetterEnrich API operations
- Comprehensive error handling and validation
- Async operation support with webhooks

## License

[MIT](https://github.com/ai0703/n8n-nodes-BetterEnrich/blob/main/LICENSE.md)

## Support

For issues related to this node:
- [GitHub Issues](https://github.com/ai0703/n8n-nodes-BetterEnrich/issues)

For BetterEnrich API support:
- [BetterEnrich Support](https://betterenrich.com/support)

For n8n support:
- [n8n Community Forum](https://community.n8n.io/)