Skip to main content

Python bindings for the Encrata email intelligence API

Project description

Encrata Python Library

PyPI version Python License: MIT

The Encrata Python library provides convenient access to the Encrata API from applications written in Python. Look up any person by their email address — get their name, company, job title, social profiles, breach history, and more.

API Documentation

See the Encrata API docs.

Installation

pip install encrata

Requirements

  • Python 3.9+
  • No external dependencies (uses urllib from the standard library)

Usage

The library needs to be configured with your account's API key, available in your Encrata Dashboard.

from encrata import Encrata

client = Encrata("enc_live_...")

Look up a person by email

person = client.lookup("elon@tesla.com")

print(person.name)        # "Elon Musk"
print(person.company)     # "Tesla"
print(person.role)        # "CEO"
print(person.location)    # "Austin, Texas"
print(person.validity)    # "valid"

Each lookup costs 1 credit. Cached results within 24 hours are served from cache.

Select specific fields

Only return the fields you need to minimize response size:

person = client.lookup("satya@microsoft.com", fields=["name", "company", "role", "socials"])

print(person.name)             # "Satya Nadella"
print(person.socials.linkedin) # "https://linkedin.com/in/satyanadella"

Available fields: name, email, company, role, industry, location, bio, age, gender, education, phone, photo, validity, socials, breaches, registered_services, news, publications.

Validate an email address (free)

Check if an email is deliverable without using any credits:

result = client.validate("test@example.com")

print(result.validity)  # "valid", "invalid", "disposable", or "unknown"
print(result.message)   # "Email is deliverable and valid."

Check data breaches (free)

See if an email has been exposed in known data breaches:

report = client.breaches("user@example.com")

print(report.count)         # 3
print(report.services)      # ["Adobe", "LinkedIn", "Dropbox"]
print(report.exposed_data)  # ["email", "password", "username"]

Handling exceptions

from encrata import Encrata, AuthenticationError, InsufficientCreditsError

client = Encrata("enc_live_...")

try:
    person = client.lookup("someone@example.com")
except AuthenticationError:
    print("Invalid API key")
except InsufficientCreditsError:
    print("No credits remaining — top up at encrata.com/settings/billing")
Exception Cause
AuthenticationError Invalid or missing API key
InsufficientCreditsError Account has 0 credits remaining
InvalidRequestError Malformed request (e.g. invalid email)
RateLimitError Too many requests
APIConnectionError Network connectivity issue
APIError Unexpected server error

Configuration options

client = Encrata(
    "enc_live_...",
    base_url="https://api.encrata.com",  # default
    timeout=30,                           # request timeout in seconds
)

Force fresh lookup

Bypass the 24-hour cache to get the latest data:

person = client.lookup("elon@tesla.com", nocache=True)

MCP (Model Context Protocol)

Encrata also provides an MCP server for AI agent frameworks like Claude, Cursor, and Windsurf. Add this to your MCP configuration:

{
  "mcpServers": {
    "encrata": {
      "url": "https://api.encrata.com/mcp",
      "headers": {
        "Authorization": "Bearer enc_live_..."
      }
    }
  }
}

Support

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

encrata-0.1.0.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

encrata-0.1.0-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file encrata-0.1.0.tar.gz.

File metadata

  • Download URL: encrata-0.1.0.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for encrata-0.1.0.tar.gz
Algorithm Hash digest
SHA256 76a320be3383bae32156650cd280fc1e15442fb55f5706c1f5cc2ee6052797c9
MD5 750e59ddbfce7f3099166e9846135bad
BLAKE2b-256 f635937fa1fe35b3ef6f5b7fd7a40bb6b17db5efdcf899b434be0c37404b4505

See more details on using hashes here.

File details

Details for the file encrata-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: encrata-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for encrata-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c4b7ad97a2c51de6d6749ab6e78c7d02fc04622478f64649d3de005c5ac9c11a
MD5 30eedce2f6cb03c8e4e722763e7170cd
BLAKE2b-256 b18ed8b0f03221fa5e2bc282859afe8d5d303c9bafaeb2620b12f7a1dcf2d958

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page