Skip to content

API reference

Response Reference: /discover

POST /discover fetches HTML pages and extracts contact signals (email, phone number, social media links) under strict time and size budgets.

Request

POST/discover

Base URL: https://api.validatedmails.com. Send JSON with Content-Type: application/json and Authorization: Bearer YOUR_API_KEY.

Create a key, then use the free connection check before sending paid requests.

Normally 2 credits when at least one contact signal is found. Unknown, blocked, timeout, and invalid_url results are free. Your account needs enough credits before the request starts.

FieldTypeRequiredDescription
urlstringYesPublic HTTP or HTTPS URL. Internal/private addresses and disallowed ports are rejected.
crawl_depthintegerNo1–3; default 1. Fallback pages are tried only when the current page has no signals.
curl -X POST https://api.validatedmails.com/discover \
  -H "Authorization: Bearer $VALIDATEDMAILS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com","crawl_depth":1}'

Illustrative HTTP 200 response

json
{
  "status": "ok",
  "source_url": "https://example.com",
  "email": { "values": ["info@example.com"] },
  "trace_id": "..."
}

HTTP errors and retries

  • 400: fix the JSON or required input fields.
  • 401: check or replace your API key.
  • 402: add credits to your account.
  • 429: wait before retrying; honor Retry-After when provided.
  • 5xx: the service could not complete the request. Retain X-Request-Id for support.
json
{"detail":"unauthorized"}

A successful HTTP response does not imply contacts were found. Read the JSON status.

A timeout or lost response can happen after processing and charging. There is no documented server-side idempotency key; do not automatically resend paid requests after an ambiguous failure. Cache completed results where appropriate.

Overview

The /discover endpoint returns extracted contact signals plus fetch and parse diagnostics for a source URL. By default it attempts only the submitted URL.

If the upstream page is blocked or cannot be fetched within configured budgets, the API returns blocked or timeout. If HTML is fetched but no signals are found, the endpoint returns unknown. When crawl_depth is2 or 3, Discover can try the highest-confidence internal contact/about/legal page after a no-signal page.

Quick example response

This is a representative response payload.

json
{
  "trace_id": "...",
  "source_url": "https://example.com/",
  "email": { "values": ["info@example.com"] },
  "phone_number": { "values": ["+1 (212) 555-0100"] },
  "social_media": { "linkedin": "https://www.linkedin.com/company/example" },
  "status": "ok",
  "http_status": 200,
  "bytes_read": 48213,
  "response_ms": 312
}

Result statuses

  • ok: at least one signal was extracted.
  • unknown: no usable signals were extracted, or fetch/parsing/content checks failed (for example DNS failures, non-HTML responses, truncated bodies, or parser errors).
  • blocked: upstream returned 401, 403, or 429, or a block page was detected.
  • timeout: overall discover execution exceededDISCOVER_TIMEOUT_MS.
  • invalid_url: URL was rejected by input validation or SSRF policy.

http_status reflects the upstream response status when available. It may be absent for validation failures and low-level fetch failures (for example DNS/connect errors).

Top-level fields

FieldTypeMeaning & interpretation
trace_idstringTrace identifier for request-level diagnostics and support.
source_urlstringFinal URL used for extraction, after redirects or fallback crawling if present.
statusstringOutcome code: ok, unknown, blocked,timeout, or invalid_url.
http_statusinteger | nullUpstream HTTP status code when available.
response_msintegerTotal end-to-end discover latency in milliseconds.
bytes_readintegerTotal upstream bytes consumed, capped at DISCOVER_MAX_BYTES.
email.valuesstring[]Unique, normalized email addresses whose domains resolved via MX/A/AAAA DNS checks.
phone_number.valuesstring[]Unique extracted phone numbers in source-observed formatting.
social_mediaobjectMapping of supported social platforms to extracted profile/company URLs.

Empty sections are omitted. For example, responses do not include emptyemail, phone_number, or social_media objects.

Extraction model

Show details

Discovery applies bounded extraction strategies in deterministic order:

  • Strategy 1: JSON-LD extraction fromapplication/ld+json blocks for email,telephone, and sameAs links.
  • Strategy 2: DOM heuristics over static HTML, includingmailto:/tel: links, visible-text regex matching, and social anchor extraction.
  • Strategy 3: Optional fallback crawling controlled bycrawl_depth. It scores same-origin links such as contact, about, support, privacy, terms, imprint, and location pages, then fetches the best candidate only when the current page has no contact signals.

Strategies run in sequence. Fallback crawling stops immediately when any attempted page produces an email, phone number, or supported social/contact link.

Timing & budgets

Show details
  • DISCOVER_TIMEOUT_MS defines the end-to-end upstream fetch budget.
  • DISCOVER_MAX_BYTES is a hard cap on HTML bytes read.
  • DISCOVER_MAX_CONCURRENT limits concurrent discover operations with an in-process semaphore.

Budgets are strictly enforced. When limits are exceeded, the API returnstimeout or unknown without continuing fallback crawling.

Best practices

  • Treat blocked and timeout as transient classes; retry with bounded exponential backoff and respect upstream rate limits.
  • Cache discover results with a TTL to reduce repeated fetches for the same source URL.
  • Use crawl_depth: 1 for the fastest deterministic path. Usecrawl_depth: 2 or 3 when homepages often hide contact details behind contact, about, privacy, terms, imprint, or support pages.
  • Apply client-side normalization (for example, prepend https:// when missing) but rely on server-side validation for final URL acceptance.
  • Avoid submitting internal/private network URLs. SSRF protections reject them.

Credits and charging

POST /discover debits 2 credits (orDISCOVER_CREDITS_COST) only when status="ok" and at least one signal is extracted for user_key/session billing modes.

No credits are debited for unknown, timeout,blocked, or invalid_url outcomes.

FAQ / edge cases

Why do I get unknown on JavaScript-heavy sites?

Discover processes the initial HTML only. It does not execute JavaScript, so data injected client-side after page load is not available for extraction.

Does ok guarantee the extracted email is deliverable?

No. /discover performs contact extraction only. Deliverability should be evaluated separately via POST /validate.

Why can source_url differ from my submitted URL?

Upstream redirects can canonicalize or relocate the requested page. The response reports the final URL used for extraction.

Why can invalid_url happen even with a syntactically valid URL?

URLs can be rejected by SSRF policy (scheme, port, DNS target, or private/internal network resolution) even if they are RFC-compliant strings.

When does fallback crawling run?

Fallback crawling runs only when crawl_depth is greater than1 and the current page has no extracted contact signals. It stops as soon as any attempted page produces a usable signal.