All posts
Engineering

Why every job carries its company

Most jobs APIs hand you an employer name and leave you to resolve it. Here is what changes when the company object is already attached.

HyperJobs Team6 min read

Every jobs API returns a posting with an employer on it. Almost all of them return that employer as a string.

JSON
{ "title": "Senior C++ Engineer", "company": "Stripe" }

That string is where the work starts. You wanted senior C++ roles at fintechs with more than 200 employees, and what you have is a title and a word. The employer's size, industry, domain, funding and headquarters are all somewhere else, behind a second system you now have to own.

The shape of the problem

The naive fix is a lookup. Search returns 200 postings, you extract 200 employer names, and you resolve each one against a firmographics source. That is the classic N+1, except worse than the database version, because the join key is a human-typed string.

Three things go wrong, and they compound:

The key is unstable. "Stripe", "Stripe, Inc.", "Stripe Inc" and "STRIPE" are one company and four strings. You end up writing normalisation rules, then exceptions to the rules, then a manual override table.

The lookups cost. 200 postings is 200 resolutions per page, on top of the search itself. You cache to survive it, and now you own a cache with an invalidation policy for data that changes.

You filter after the fact. "More than 200 employees" cannot be part of the search, because the search does not know about employees. You over-fetch, resolve everything, discard most of it, and page again because your filtered page came back half empty.

None of that is your problem. It's a missing join, pushed downstream.

What the join does

On /v1/jobs, company is an object, not a string. It is already there, on every posting, in the same response:

JSON
{
  "id": "j_0f2c9a41d7e3b685",
  "title": "Senior C++ Engineer",
  "company": {
    "id": "co_St4rp3Qe",
    "name": "Stripe",
    "domain": "stripe.com",
    "industry": "Financial Services",
    "employee_count": 8000,
    "hq": { "country": "United States", "region": "California", "locality": "South San Francisco" }
  },
  "locations": [
    {
      "label": "New York, New York, United States",
      "city": "New York",
      "country": "United States",
      "country_code": "US"
    }
  ],
  "salary": { "annual_min": 180000, "annual_max": 240000, "currency": "USD" },
  "key_skills": [{ "skill": "C++", "importance": "required" }]
}

That payload is illustrative: a real response carries more fields, and the Job object lists all of them. The structure is the point. One request, and the employer arrives resolved.

So the query at the top of this post is one request. The firmographic predicate can go into the query itself (company_industry, company_size), or run client-side over data you already hold:

JS
const qs = new URLSearchParams({
  skill: "cpp",
  seniority: "senior",
  time_frame: "7d",
  limit: "200",
});
 
const { data } = await fetch(`https://api.hyperjobs.io/v1/jobs?${qs}`, {
  headers: { Authorization: `Bearer ${process.env.HYPERJOBS_KEY}` },
}).then((r) => r.json());
 
// No second request. `company` came with the row.
const matches = data.filter((j) => {
  const c = j.company;
  // `id` proves this is a resolved company; see "The three shapes" below.
  if (c?.id == null) return false;
  return c.employee_count != null && c.employee_count > 200 && c.industry === "Financial Services";
});

No resolution step. No name matching. No cache. The quickstart gets you to that response in about two minutes.

The three shapes

Here is the first ugly part, and it matters more than its frequency suggests. job.company is not always the summary. It has three shapes:

ShapeWhenHow to detect
SummaryThe posting resolved to a companycompany.id is present
Minimal fallbackNothing matched. Four fields, taken from the posting itselfcompany is non-null, company.id is absent
nullThe posting names no employer at allcompany === null

The fallback carries name, domain, industry and description: a structural subset of the summary. That subset is exactly what makes it dangerous. Your code path that reads company.name works. Your code path that reads company.employee_count gets undefined, and undefined > 200 is false, so the row silently drops out of a filter instead of raising anything.

Detect the fallback with `id`, not with field presence

Every other candidate (industry, logo, description) is nullable on the summary too, so its absence proves nothing. id is the only field guaranteed on a summary and impossible on a fallback.

JS
const isEnriched = job.company?.id != null;

A fallback has no id, so there is nothing to fetch from /v1/companies/{id} either. Guard the lookup rather than building a URL with undefined in it.

The unresolved case is rare. Handle it anyway. A null dereference on a path that almost never fires is a bug you find in production, months later, in a stack trace nobody can reproduce.

The seams the join does not hide

An embedded join is not a merged record, and pretending otherwise costs you.

Country names match; codes live on places. company.hq.country is a full name ("United States"), spelled the way a job place's country is, so place.country === job.company.hq.country works. The ISO-2 code is on the place only, as country_code; there is none on hq. See the Company object.

HQ is not where the work is. A US-headquartered company posts roles everywhere. Filter jobs by the job's location; use hq to describe the employer, not to locate the job.

The two halves refresh independently. Jobs change far more often than companies do. A posting that went live an hour ago can carry a profile that was last refreshed months ago; the full profile's updated_at, from /v1/companies/{id}, tells you when. That is expected behaviour, not staleness to report.

What the job carries is the summary. company on a job is the company summary: identity, industry, size, HQ. The deeper fields (specialties, funding, stock, updated_at) are on the full profile only, and coverage inside a profile is uneven: name and id are dependable, so treat everything else as optional and guard nested objects.

There are firmographic filters, from two directions. /v1/companies is a real search (q, industry, country (HQ), size, employee_count_gte/_lt, has_jobs), with offset paging. And /v1/jobs has a company axis: company_industry, company_size, employee_count_gte/_lt, company_country, domain, company_id.

The join covers the rest. A field with no filter (founded_year, followers, stock) is a client-side predicate over data the job already carried, and the job side answers a slightly different question than a company search does:

Filter jobs, read the embedded company.

"Fintechs in Germany with 200+ employees" via job filters for taxonomies=finance_accounting and location=Germany reaches those employers through their postings, and only the ones actively hiring. For most questions that start with "which companies", the hiring qualifier was implied anyway. Company data has the pattern in full.

What this actually buys

The join removes a system. Not a request, a system: the resolver, its normalisation rules, its override table, its cache, and the invalidation policy for that cache. That code is never interesting, it is never done, and it is wrong in a long tail of ways you discover one employer at a time.

Start with the quickstart, then read filtering: it has two behaviours that will otherwise cost you an afternoon.