# Domain Portfolio RDAP Expiry, Status-Flag (`kingii98/domain-portfolio-rdap-expiry-status-flag-and-registrar-change`) Actor

Checks 1 to 500 domains through public RDAP. Reports expiry, missing locks, risk status, and changes since the last run.

- **URL**: https://apify.com/kingii98/domain-portfolio-rdap-expiry-status-flag-and-registrar-change.md
- **Developed by:** [kingii98](https://apify.com/kingii98) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$2.00 / 1,000 domain checkeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Domain Portfolio RDAP Expiry, Status-Flag, and Registrar-Change Ledger

This Actor checks 1 to 500 domains through public RDAP (Registration Data Access Protocol).
It is for agencies, IT teams, and brand owners. Run it each week, or after a transfer or renewal batch.

### What it reports

One dataset row for each domain (`row_type: "domain"`):

| Field | Meaning |
| --- | --- |
| `rdap_source_url` | Registry RDAP URL that the Actor queried. |
| `expiry_date`, `days_left` | Expiry date and whole days left. The value is negative after expiry. |
| `expiring_soon` | `true` when `days_left` is at or below `warningDays`. |
| `status_codes` | EPP (Extensible Provisioning Protocol) status codes, in camelCase. |
| `missing_lock` | `true` when the domain lacks `clientTransferProhibited` or `clientDeleteProhibited`. Server locks do not count. |
| `risk_status`, `risk_statuses` | `true` and the list when a status is `redemptionPeriod`, `pendingDelete`, `serverHold`, or `clientHold`. |
| `registrar`, `nameservers` | Current registrar name and sorted nameservers. |
| `delegation_signed` | DNSSEC (DNS Security Extensions) `delegationSigned` value. |
| `first_seen` | `true` when no previous state exists. |
| `changes` | List of `{field, previous, current}` for registrar, nameservers, statuses, or expiry. |
| `expectation_mismatches` | Fields that differ from your optional expected registrar or nameservers. |
| `rdap_unavailable` | `true` when the TLD (top-level domain) has no RDAP service in the IANA bootstrap file. |
| `lookup_error` | Error code when the lookup failed, for example `timeout` or `http_404`. |

One summary row (`row_type: "summary"`) gives the counts.

A bad result is data. The run ends SUCCEEDED for unavailable RDAP, lookup errors, and invalid names.

### Input

| Field | Default | Note |
| --- | --- | --- |
| `domains` | `["example.com"]` | 1 to 500 names. The Actor removes duplicates. Invalid names become rows with `lookup_error: "invalid_domain"`. |
| `warningDays` | `30` | 0 to 365. |
| `expectations` | `[]` | Objects: `{"domain": "a.com", "registrar": "Acme", "nameservers": ["ns1.a.com"]}`. |
| `stateStoreName` | `domain-rdap-ledger-state` | Named key-value store. Key `STATE` keeps the previous registrar, nameservers, status codes, and expiry. |

An empty input `{}` runs with the defaults.

### State

The Actor reads `STATE` once at the start and writes it once at the end. It updates a domain only when
the lookup succeeded. A failed lookup keeps the old record. The IANA bootstrap file
(`https://data.iana.org/rdap/dns.json`) is fetched once for each run.

### Billing (pay-per-event)

| Event | Price | When the Actor charges |
| --- | --- | --- |
| `domain-checked` | $0.002 | One call for each domain that RDAP resolved and the Actor compared to the previous run. |

The Actor does not charge for unavailable TLDs, invalid names, or failed lookups.
The Actor stops early if the charge limit is reached. The proposed default cap is $1.00 (500 domains).
This README does not change pricing. Set pricing in Apify Console.

### Limits and safety

- HTTP only. No browser, proxy, LLM, paid API, or secret.
- HTTPS targets only. The Actor rejects private, loopback, link-local, and reserved addresses, for every redirect hop.
- At most 3 redirects, 10 s timeout, 1 MB for each response.
- One request each second for each RDAP host. Domains run one at a time.
- The Actor follows the registrar `related` link once, when the registry gives it. Registrar values win.
- The Actor does not use port-43 WHOIS. Some ccTLDs have no RDAP. They show `rdap_unavailable`.
- Known gap: a DNS answer can change between the address check and the connection.

### Development

```
uv run pytest
uv run ruff check .
```

# Actor input Schema

## `domains` (type: `array`):

Domain names to check. Use 1 to 500 names. Use punycode for non-ASCII names.

## `warningDays` (type: `integer`):

Flag a domain as expiring soon when it has this number of days or fewer left.

## `expectations` (type: `array`):

Objects with a domain, and optionally registrar and nameservers. The Actor reports a mismatch.

## `stateStoreName` (type: `string`):

Named key-value store that keeps the previous registrar, nameservers, status codes, and expiry.

## Actor input object example

```json
{
  "domains": [
    "example.com"
  ],
  "warningDays": 30,
  "expectations": [],
  "stateStoreName": "domain-rdap-ledger-state"
}
```

# Actor output Schema

## `ledger` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "domains": [
        "example.com"
    ],
    "warningDays": 30,
    "expectations": [],
    "stateStoreName": "domain-rdap-ledger-state"
};

// Run the Actor and wait for it to finish
const run = await client.actor("kingii98/domain-portfolio-rdap-expiry-status-flag-and-registrar-change").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "domains": ["example.com"],
    "warningDays": 30,
    "expectations": [],
    "stateStoreName": "domain-rdap-ledger-state",
}

# Run the Actor and wait for it to finish
run = client.actor("kingii98/domain-portfolio-rdap-expiry-status-flag-and-registrar-change").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "domains": [
    "example.com"
  ],
  "warningDays": 30,
  "expectations": [],
  "stateStoreName": "domain-rdap-ledger-state"
}' |
apify call kingii98/domain-portfolio-rdap-expiry-status-flag-and-registrar-change --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,kingii98/domain-portfolio-rdap-expiry-status-flag-and-registrar-change"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/XzObKNgwAhJqIvHNK/builds/b4VtpnYF4xrWLQFu0/openapi.json
