// Grab registrars from the inline ng-state JSON and save as CSV.
// Falls back to the page's CSV download link if none found in state.
(async () => {
const dl = (filename, text, type='text/csv') => {
const blob = new Blob([text], {type});
const a = document.createElement('a');
a.href = URL.createObjectURL(blob);
a.download = filename;
document.body.appendChild(a);
a.click(); a.remove();
};
const csvEscape = v => `"${String(v ?? '').replace(/"/g,'""')}"`;
const toCSV = (rows, keys, labels) => {
const head = labels.map(csvEscape).join(',');
const body = rows.map(r => keys.map(k => csvEscape(r[k])).join(',')).join('\n');
return head + '\n' + body;
};
// 1) Try to parse registrars from ng-state (works even if the dropdown/table is hidden)
const stateEl = document.querySelector('#ng-state');
let rows = [];
if (stateEl?.textContent) {
try {
const state = JSON.parse(stateEl.textContent);
const seen = new WeakSet();
const found = [];
const pull = (obj) => {
if (!obj || typeof obj !== 'object' || seen.has(obj)) return;
seen.add(obj);
if (Array.isArray(obj) && obj.length && typeof obj[0] === 'object') {
for (const it of obj) {
const name = it.name || it.registrarName || it.registrar || it.title;
const iana = it.ianaNumber || it.iana || it.ianaId || it.IANANumber;
const country = it.country || it.countryOrTerritory || it.country_territory;
const website = it.website || it.url || it.webSite || it.homepage;
const pc = it.publicContact || it.contact || {};
const publicContactName = it.publicContactName || pc.name;
const publicContactPhone = it.publicContactPhone || pc.phone;
const publicContactEmail = it.publicContactEmail || pc.email;
if (name && iana) {
found.push({name, iana, country, website, publicContactName, publicContactPhone, publicContactEmail});
}
}
}
for (const k in obj) if (Object.prototype.hasOwnProperty.call(obj,k)) pull(obj[k]);
};
pull(state);
// de-dupe by (iana|name)
const uniq = new Map();
for (const r of found) {
const key = `${String(r.iana).toLowerCase()}|${String(r.name).toLowerCase()}`;
if (!uniq.has(key)) uniq.set(key, r);
}
rows = [...uniq.values()];
} catch (e) {
console.warn('Could not parse ng-state:', e);
}
}
const keys = ['name','iana','country','website','publicContactName','publicContactPhone','publicContactEmail'];
const labels = ['Registrar','IANA','Country/Territory','Website','Public Contact Name','Public Contact Phone','Public Contact Email'];
if (rows.length > 0) {
dl('icann-registrars-from-ngstate.csv', toCSV(rows, keys, labels));
console.log(`Exported ${rows.length} registrars from ng-state.`);
return;
}
// 2) Fallback: pull the page’s CSV (respects current filters)
let csvURL = document.querySelector('a[data-testid="csv-download"]')?.href
|| 'https://www.icann.org/en/contracted-parties/accredited-registrars/list-of-accredited-registrars/csvdownload';
const resp = await fetch(csvURL, { credentials: 'include' });
if (!resp.ok) throw new Error(`CSV download failed: ${resp.status}`);
const raw = await resp.text();
dl('icann-registrars-raw.csv', raw);
console.log('Downloaded icann-registrars-raw.csv from the page link.');
})();
Want me to also group by families (e.g., Gname ### Inc, DropCatch.com #### LLC, Sav.com shards) and auto-export each as its own CSV?
Key terms in plain language
Open a term for a concise explanation of language used on this page.
VoIP
Voice over Internet Protocol carries phone calls over an IP network instead of a traditional analog phone line. Call quality depends on network stability, latency, and traffic management.
Unified Communications (UCaaS)
A cloud-based combination of business calling, messaging, meetings, presence, and collaboration tools managed as one communications service.
SIP Trunking
A service that connects a business phone system to the public telephone network using Internet Protocol, replacing or supplementing traditional phone lines.
Bandwidth
The amount of data a connection can carry in a given time, usually measured in Mbps or Gbps. More bandwidth supports more users, devices, and simultaneous applications.
Latency
The time it takes data to travel between two points. Lower latency improves voice, video meetings, cloud applications, gaming, and other real-time services.
Service-Level Agreement (SLA)
A provider’s written commitment covering service targets such as availability, response time, repair time, and sometimes financial credits when commitments are missed.