# ContrastAPI API reference

> ContrastAPI offers REST lookups for domains, IPs and email addresses, among other security data: DNS records, WHOIS/RDAP registration data, subdomain enumeration from certificate logs and DNS, IP network, cloud and list membership, and an email domain check. Every REST data endpoint except POST…

Source: https://osinttools.io/apis/contrastapi/ (Markdown view of an OSINTtools.io page; append `.md` to any page URL for this format).

Compiled by OSINTtools.io editors from the vendor's docs, updated Nov 29, 2026. Listing: https://osinttools.io/tools/contrastapi/

- Base URL: https://api.contrastcyber.com
- Authentication: API key in the `X-API-Key` header. Get a key: https://api.contrastcyber.com Optional; without a key the free tier applies. Authorization: Bearer also works.
- Free tier: yes
- Rate limits: Free (no key): 30 credits per hour per IPv4 address or IPv6 /64. Pro key: 500 credits per hour per key. Over budget returns 429.
- Vendor docs: https://github.com/UPinar/contrastapi/blob/main/docs/API_Documentation.md

## Overview

ContrastAPI offers REST lookups for domains, IPs and email addresses, among other security data: DNS records, WHOIS/RDAP registration data, subdomain enumeration from certificate logs and DNS, IP network, cloud and list membership, and an email domain check. Every REST data endpoint except `POST /image_inspect` is also available as an MCP tool at `/mcp`. This reference covers five of the REST lookups; the docs list more (certificate search, SSL, headers, redirect chain, Wayback, ASN and others).

Calls go to `https://api.contrastcyber.com`. A key is optional: requests without one use the free tier (30 credits per hour per IPv4 address or IPv6 /64) and a Pro key gives 500 credits per hour. Send the key in `X-API-Key` or `Authorization: Bearer`. Over budget returns 429, and endpoints that take payment return 402 to a keyless request, which can pay per call with x402. Responses include an `X-Credits-Charged` header and a `credits` object.

The email check makes no SMTP connection, so it cannot confirm that a mailbox exists. Domain parameters must be public domain names; IPs must be globally reachable.

## Errors

| Status | Meaning |
| --- | --- |
| 400 | Invalid or missing input (not a public domain, not a globally reachable IP, bad address) |
| 402 | Payment required on a keyless request to a paid endpoint |
| 404 | Domain does not exist or is not registered |
| 429 | Credit budget exceeded |
| 502 | Upstream lookup gave no usable answer |
| 503 | Server busy; retry after Retry-After; costs nothing |

## Domain

### DNS records for a domain with TXT-based service hints.

`GET /dns_lookup/{domain}`

- Takes: Domain
- Footprint: passive (the target is not contacted)
- Cost: 1 credit

Refuses special-use names, IPs, URLs and ports; internationalised names must use the xn-- form. An empty array means no records of that type; null means the lookup failed. A 404 or 502 also costs 1 credit.

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `domain` | path | string | yes | Public domain, at most 253 bytes, at least two labels Example: example.com |

Response fields:

- `domain` (string): Lower-case domain
- `records.a[]` (string): A records
- `records.mx[]` (object): MX records with priority and host
- `records.ns[]` (string): Name servers
- `records.txt[]` (string): TXT records
- `unavailable[]` (object): Record types whose lookup failed, with reasons
- `services[].name` (string): Service whose verification word appears in a TXT record
- `summary` (string): Text count of each record type
- `credits.remaining` (integer): Credits left in the window

```bash
curl 'https://api.contrastcyber.com/dns_lookup/example.com' \
  -H 'X-API-Key: YOUR_API_KEY'
```

Example response (200):

```json
{
  "domain": "example.com",
  "records": {
    "a": [
      "203.0.113.7"
    ],
    "mx": [
      {
        "priority": 10,
        "host": "mail.example.com"
      }
    ],
    "ns": [
      "ns1.example.com"
    ],
    "txt": [
      "v=spf1 -all"
    ]
  },
  "unavailable": [],
  "services": [],
  "summary": "1 A, 1 MX, 1 NS, 1 TXT",
  "credits": {
    "charged": 1,
    "remaining": 29
  }
}
```

### Registration data for a domain from RDAP or WHOIS.

`GET /whois_lookup/{domain}`

- Takes: Domain
- Footprint: passive (the target is not contacted)
- Cost: 1 credit

A name under a registered domain is looked up as that registered domain; a public suffix such as co.uk is refused.

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `domain` | path | string | yes | Domain to look up Example: example.com |

Response fields:

- `domain` (string): Domain looked up
- `registered` (boolean): Whether the domain is registered
- `available` (boolean): Whether the domain appears available
- `rdap_server` (string): RDAP server used
- `registrar_name` (string): Registrar name
- `registrar_iana_id` (integer): Registrar IANA ID
- `created_at` (string): Creation date
- `updated_at` (string): Last update date
- `expires_at` (string): Expiry date
- `status[]` (string): First 16 status values
- `name_servers[]` (string): First 16 name servers
- `dnssec_signed` (boolean): Whether DNSSEC is signed

```bash
curl 'https://api.contrastcyber.com/whois_lookup/example.com' \
  -H 'X-API-Key: YOUR_API_KEY'
```

Example response (200):

```json
{
  "domain": "example.com",
  "available": false,
  "registered": true,
  "rdap_server": "https://rdap.example.org/",
  "registrar_name": "Example Registrar, Inc.",
  "registrar_iana_id": 9999,
  "created_at": "2001-03-29T05:00:00Z",
  "updated_at": "2025-01-15T10:00:00Z",
  "expires_at": "2030-03-30T04:00:00Z",
  "status": [
    "clientTransferProhibited"
  ],
  "name_servers": [
    "ns1.example.com",
    "ns2.example.com"
  ],
  "dnssec_signed": true,
  "credits": {
    "charged": 1,
    "remaining": 29
  }
}
```

### Subdomains found from certificate logs and DNS.

`GET /subdomain_enum/{domain}`

- Takes: Domain
- Footprint: passive (the target is not contacted)
- Cost: 2 credits

Uses Cert Spotter, 94 common-name A questions and MX/NS/SPF records. Returns at most 50 names, DNS-confirmed first; the count goes up to 1000. Past the hourly Cert Spotter limit it still returns DNS names with certificate_logs_available false.

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `domain` | path | string | yes | Domain; a subdomain is treated as its registrable domain Example: example.com |

Response fields:

- `domain` (string): Registrable domain
- `subdomain_count` (integer): Number of subdomains found, up to 1000
- `subdomains[].hostname` (string): Subdomain
- `subdomains[].sources[]` (string): Where it was found
- `subdomains[].has_ipv4_address` (boolean): Whether it resolves to an IPv4 address
- `wildcard_dns` (string): absent, present or undetermined
- `certificate_logs_available` (boolean): False when Cert Spotter gave no usable answer

```bash
curl 'https://api.contrastcyber.com/subdomain_enum/example.com' \
  -H 'X-API-Key: YOUR_API_KEY'
```

Example response (200):

```json
{
  "domain": "example.com",
  "subdomain_count": 1,
  "subdomains": [
    {
      "hostname": "www.example.com",
      "sources": [
        "dns"
      ],
      "has_ipv4_address": true
    }
  ],
  "wildcard_dns": "absent",
  "certificate_logs_available": true,
  "credits": {
    "charged": 2,
    "remaining": 28
  }
}
```

## IP

### Network, cloud, Tor, crawler and list membership for one IP.

`GET /ip_lookup/{ip_address}`

- Takes: IP address
- Footprint: passive (the target is not contacted)
- Cost: 1 credit

Refuses private, loopback, link-local, documentation, multicast and reserved addresses, hostnames and CIDR prefixes. An address held by no list still returns 200. The reputation (AbuseIPDB) and internet_exposure (Shodan) slots are filled only for a Pro key with stored vendor keys. Because the documentation ranges are refused, use a real public address when trying it.

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `ip_address` | path | string | yes | Globally reachable IPv4 or IPv6 address Example: 203.0.113.7 |

Response fields:

- `ip_address` (string): Canonical form of the address
- `asn` (integer): Autonomous system number
- `asn_name` (string): AS name
- `asn_country` (string): AS country
- `geo_country` (string): Country from DB-IP Lite
- `cloud_provider` (string): Cloud provider range holding the address
- `is_cdn` (boolean): Whether the range is a CDN
- `is_datacenter` (boolean): In a cloud range or a known hosting AS
- `is_tor_exit` (boolean): Whether the address is a Tor exit
- `crawler` (string): Crawler list holding the address
- `listed_on[]` (object): DROP prefixes holding the address
- `ptr` (string): PTR name, or null
- `is_ptr_forward_confirmed` (boolean): Whether the PTR name resolves back to the address

```bash
curl 'https://api.contrastcyber.com/ip_lookup/203.0.113.7' \
  -H 'X-API-Key: YOUR_API_KEY'
```

Example response (200):

```json
{
  "ip_address": "203.0.113.7",
  "asn": 64496,
  "asn_name": "Example Net",
  "asn_country": "XX",
  "geo_country": "XX",
  "cloud_provider": null,
  "is_cdn": false,
  "is_datacenter": false,
  "is_tor_exit": false,
  "crawler": null,
  "listed_on": [],
  "ptr": "host.example.com",
  "is_ptr_forward_confirmed": true
}
```

## Email

### Mail route and disposable-domain check for an email address, without SMTP.

`GET /email_address_check/{email}`

- Takes: Email
- Footprint: passive (the target is not contacted)
- Cost: 1 credit

Percent-decodes the path segment; + stays +. Up to 254 bytes, ASCII dot-atom local part; quoted local parts are refused. Makes no SMTP connection, so it cannot confirm that a mailbox exists.

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `email` | path | string | yes | Email address Example: jane@example.com |

Response fields:

- `email` (string): Address checked
- `domain` (string): Domain part
- `domain_exists` (boolean): Whether the domain exists
- `accepts_mail` (boolean): Whether the domain accepts mail
- `mail_route` (string): How mail is routed, for example null_mx
- `mx_hosts[]` (string): MX hosts
- `disposable` (boolean): Whether the domain is a known disposable provider
- `dangling` (boolean): Dangling CNAME flag

```bash
curl 'https://api.contrastcyber.com/email_address_check/jane%40example.com' \
  -H 'X-API-Key: YOUR_API_KEY'
```

Example response (200):

```json
{
  "email": "jane@example.com",
  "domain": "example.com",
  "domain_exists": true,
  "accepts_mail": true,
  "mail_route": "mx",
  "mx_hosts": [
    "mail.example.com"
  ],
  "disposable": false,
  "dangling": false,
  "credits": {
    "charged": 1,
    "remaining": 29
  }
}
```

---

Listings on OSINTtools.io are reviewed by editors and re-verified on a schedule; check pricing and availability on the vendor's site before relying on them, and use OSINT tools only with a lawful basis.
Site index for agents: https://osinttools.io/llms.txt · Full catalog: https://osinttools.io/llms-full.txt · MCP server (Streamable HTTP, no auth): https://osinttools.io/mcp/
