@uniquedomains/registrar-prices
v0.2.1
Published
Registrar price comparison for Node.js: what nine registrars charge for a domain ending, each confirmed price change and over 300 renewal traps. Read daily, free, no key.
Maintainers
Readme
Registrar price comparison for Node.js
The first-year price is not the price you keep paying: .agency costs $3.50 for the first year at Dynadot and $28.04 a year after that. This package reads what nine registrars charge for an ending, the endings whose renewal is a trap (over 300 today) and each price change, served only once the new price read the same on the next morning. All of that is free and needs no key. The cheapest registrar across many endings needs a key, and an ending's price history needs a key on the Investor plan. The nine price lists and the traps are also a page: unique.domains/registrars.
npx @uniquedomains/registrar-prices ionpm install @uniquedomains/registrar-pricesNode 20 or later. ESM and CommonJS. Built on @uniquedomains/sdk.
Every registrar's price for an ending
import { pricesForTld } from '@uniquedomains/registrar-prices';
const prices = await pricesForTld('io');
for (const row of prices) console.log(row.name, row.purchasePrice, row.renewalPrice);.io and io read the same ending. Each row also carries the transfer price, the currency, and the marks cheapest, cheapestRenewal, cheapestTransfer, isPromo and renewalTrap. The free tier answers every ending of the public set, the short list that GET /tlds?publicSet=true gives; outside it, one ending a UTC day.
Renewal traps
A trap is an ending whose cheapest first year renews at a much higher price. Free, you read eight rows, and the whole count is in the answer's meta:
import { renewalTraps } from '@uniquedomains/registrar-prices';
const { data, meta } = await renewalTraps().withMeta();
console.log(meta.trapCount, data[0].tld, data[0].multiple);Price changes
Confirmed changes across the registrars, newest first. Free, you read the ten newest.
import { priceChanges } from '@uniquedomains/registrar-prices';
const changes = await priceChanges();
for (const change of changes) console.log(change.extension, change.registrarName, change.oldPrice, change.newPrice);With a key, priceChanges and renewalTraps read every row, and a for await loop walks the pages. priceChanges also takes the filters ending, registrar, field and since.
With a key
The cheapest registrar for each of up to 100 endings:
import { cheapest } from '@uniquedomains/registrar-prices';
const rows = await cheapest(['ai', 'io'], { apiKey: process.env.UD_API_KEY });
for (const row of rows) console.log(row.ending, row.cheapestYear1?.registrar ?? 'no price', row.cheapestYear1?.price ?? '');How an ending's prices changed, newest first, on the Investor plan. A loop walks the pages:
import { priceHistory } from '@uniquedomains/registrar-prices';
for await (const row of priceHistory('io', { apiKey: process.env.UD_API_KEY, maxRows: 50 })) {
console.log(row.registrar, row.purchasePrice, row.firstSeenAt);
}Without a key, both throw a PlanRequiredError:
import { cheapest, PlanRequiredError } from '@uniquedomains/registrar-prices';
try {
await cheapest(['ai', 'io']);
} catch (error) {
if (error instanceof PlanRequiredError) console.log('Needs a key:', error.product);
else throw error;
}The command
ud-prices io
ud-prices --traps
ud-prices --changes
ud-prices --cheapest ai,io --key ud_live_...
ud-prices io --history --key ud_live_...A table on a terminal, JSON in a pipe. ud-prices --help lists the flags.
Keys and limits
Without a key you read the free calls, within a limit per hour and per day from one address. Every function also takes a key, and reads UD_API_KEY from the environment when you pass none. Keep a key on a server: a page a visitor loads shows it to everyone.
- A member key. The Founder and Investor plans include the API with a key of your own, and the price history needs the Investor plan. See the plans.
- A paid RapidAPI plan. Domain Price Comparison on RapidAPI serves everything here but the history: pass
{ rapidApi: { key, listing: 'price-comparison' } }. The history is on Registrar Prices, withlisting: 'registrars'. RapidAPI's free Basic plan reads the free calls only.
The Domain price comparison API page shows the answer and its fields, and you can run the call there.
License
MIT
