How to get a company name from a domain

Most company websites state their own name in machine-readable tags. Reading those tags turns a domain into a company name without any paid API.

Where the name is

  1. schema.org Organization data (JSON-LD in a <script type="application/ld+json"> block): the most deliberate source, since it is written for search engines.
  2. og:site_name, the Open Graph tag used for link previews.
  3. The page title, usually "Page – Company": a fallback that needs trimming.

WHOIS and RDAP rarely help: since GDPR most registrars redact the owner, and the organization field, when present, is often a hosting or privacy service.

Python script (standard library only)

import json, re, sys, urllib.request
from html.parser import HTMLParser

class Head(HTMLParser):
    def __init__(self):
        super().__init__(); self.meta, self.ld, self.title, self._in = {}, [], "", None
    def handle_starttag(self, tag, attrs):
        a = dict(attrs)
        if tag == "meta" and a.get("content"):
            self.meta[(a.get("property") or a.get("name") or "").lower()] = a["content"]
        self._in = tag if tag == "title" or (tag == "script" and a.get("type") == "application/ld+json") else None
    def handle_data(self, data):
        if self._in == "title": self.title += data
        elif self._in == "script": self.ld.append(data)
    def handle_endtag(self, tag):
        self._in = None

def org_names(node):
    if isinstance(node, list):
        for n in node: yield from org_names(n)
    elif isinstance(node, dict):
        types = node.get("@type", [])
        if isinstance(types, str): types = [types]
        if any(t in ("Organization", "Corporation", "OnlineBusiness") for t in types) and isinstance(node.get("name"), str):
            yield node["name"]
        for v in node.values(): yield from org_names(v)

def company_name(domain):
    req = urllib.request.Request("https://" + domain, headers={"User-Agent": "Mozilla/5.0 (company lookup)"})
    html = urllib.request.urlopen(req, timeout=15).read().decode("utf-8", "replace")
    p = Head(); p.feed(html)
    for block in p.ld:
        try:
            for name in org_names(json.loads(block)):
                return name, "schema.org"
        except ValueError:
            pass
    if p.meta.get("og:site_name"):
        return p.meta["og:site_name"], "og:site_name"
    return re.split(r"\s[|\-–·:]\s", p.title.strip())[0], "title"

for d in sys.argv[1:]:
    try:
        print(d, *company_name(d), sep="\t")
    except Exception as e:
        print(d, "error: " + str(e), sep="\t")

Run it as python3 company_name.py stripe.com notion.so example.com. Our test run:

stripe.com     Stripe          schema.org
notion.so      Notion          og:site_name
github.com     GitHub          og:site_name
shopify.com    Shopify         schema.org
hubspot.com    HubSpot         schema.org
atlassian.com  Atlassian       schema.org
example.com    Example Domain  title

The third column says where the name came from. Rows from title deserve a look: example.com has no company tags, so the title is all there is. Sites that build their page with JavaScript may send almost empty HTML; the script then falls back to the title or fails.

A list of domains, with logos and social links

Our Company Website Enrichment actor on Apify takes domains or URLs and returns one row per company: name, description, logo, official social pages (LinkedIn, X, Facebook, Instagram, YouTube and more), contact details from structured data, and optionally tech stack, domain age and email provider, as CSV, Excel or JSON. Billed per company.

Frequently asked questions

Is there a free API to get a company name from a domain?

The company's own website is the free source: schema.org Organization data, og:site_name or the page title. The script on this page reads them in that order.

Can WHOIS tell me who owns a domain?

Rarely, today. Most registrars redact owner details for privacy, so the organization field is usually empty or a proxy service.

How do I get a company name from an email address?

Take the part after @ and look up that domain, but skip free email providers like gmail.com or outlook.com: they say nothing about the sender's employer.

Written with AI assistance. The script was run on 2026-10-01 for stripe.com, notion.so, github.com, shopify.com, hubspot.com, atlassian.com and example.com; the output shown is from that run. The Apify tool is ours; the APIs are free to call directly.