Partial replacement
The replacement does not give back everything the old call did. In the registry's own words:
- Company lookup by domain: PARTIAL.
get_company_snapshotanswers with a written company snapshot (async: 202, then poll), not FullContact company fields. It is returned unchanged and no field table is claimed.
What ended and when
ended 2022-06-30 FullContact v2 Company API ended 2022-06-30.
FullContact's migration page says that on 30 June 2022 it would sunset its legacy v2 Company API. The v2 Person API is not covered: the page gives no sunset date for it.
Source notice, read 2026-11-23.
Old call and revived code
Company lookup by domain: GET /v2/company/lookup
The old call
- Method
- GET
- Host
api.fullcontact.com- Path
/v2/company/lookup- Parameters
domain
The registry records no provenance for this path.
Example call built from the registry
JavaScript
async function oldCall(domain) {
const res = await fetch(`https://api.fullcontact.com/v2/company/lookup?domain=${domain}`, { method: "GET" });
return res.json();
}
Python
def old_call(domain):
response = requests.get(f"https://api.fullcontact.com/v2/company/lookup?domain={domain}")
return response.json()
curl
curl -X GET "https://api.fullcontact.com/v2/company/lookup?domain=$DOMAIN"
Revived code
Replaces the call with FoxAPIs POST /v1/get_company_snapshot. credits per call: see https://foxapis.com/pricing (not in the catalog snapshot). This call is asynchronous: it answers with a job id and the code polls until the job is done. The key is read from the environment variable FOXAPIS_KEY.
FoxAPIs reference entry for Get company snapshot
Your example call, rewritten in place
JavaScript
// RESURRECT: replaces the FullContact v2 Company API "Company lookup by domain" call (ended 2022-06-30). It now calls FoxAPIs POST /v1/get_company_snapshot.
// Needs FOXAPIS_KEY in the environment. A free key: https://foxapis.com/trial
// PARTIAL. get_company_snapshot answers with a written company snapshot (async: 202, then poll), not FullContact company fields. It is returned unchanged and no field table is claimed.
const asResponse = (data, status = 200) => ({ ok: status < 400, status, data, json: async () => data, text: async () => JSON.stringify(data) });
async function waitForJob(jobId, headers) {
for (let i = 0; i < 90; i += 1) {
const res = await fetch("https://api.foxapis.com" + "/v1/jobs/" + encodeURIComponent(jobId), { headers });
if (!res.ok) throw new Error("FoxAPIs job poll answered " + res.status);
const job = await res.json();
if (job.status === "done") return job;
if (job.status === "failed" || job.status === "error") throw new Error("FoxAPIs job " + job.status);
await new Promise((r) => setTimeout(r, 2000));
}
throw new Error("FoxAPIs job did not finish in time; poll " + jobId + " again later");
}
async function resurrectedCompanyLookup({ domain } = {}) {
if (!domain) throw new Error("domain is required by FoxAPIs: company website domain");
const key = process.env.FOXAPIS_KEY;
if (!key) throw new Error("Set FOXAPIS_KEY (free key: https://foxapis.com/trial)");
const headers = { Authorization: `Bearer ${key}`, "Content-Type": "application/json" };
const body = {};
if (domain) body.domain = domain;
const res = await fetch("https://api.foxapis.com/v1/get_company_snapshot", { method: "POST", headers, body: JSON.stringify(body) });
if (res.status === 401 || res.status === 403) throw new Error("FoxAPIs rejected the key (status " + res.status + ")");
if (res.status !== 202 && !res.ok) throw new Error("FoxAPIs answered " + res.status);
const first = await res.json();
const job = res.status === 202 ? await waitForJob(first.job_id, headers) : first;
return job.result ?? null;
}
async function oldCall(domain) {
// RESURRECT: FoxAPIs call (FullContact v2 Company API Company lookup by domain). The value is shaped like a fetch or axios response: .ok, .status, .data and await .json() work.
const _resurrected_1 = await resurrectedCompanyLookup({
domain: domain,
});
const res = _resurrected_1 !== null ? asResponse(_resurrected_1) : asResponse({ detail: "No match found by FoxAPIs" }, 404);
return res.json();
}
Python
import json
import os
import re
import time
import urllib.error
import urllib.request
# RESURRECT: replaces the FullContact v2 Company API "Company lookup by domain" call (ended 2022-06-30). It now calls FoxAPIs POST /v1/get_company_snapshot.
# Needs FOXAPIS_KEY in the environment. A free key: https://foxapis.com/trial
# PARTIAL. get_company_snapshot answers with a written company snapshot (async: 202, then poll), not FullContact company fields. It is returned unchanged and no field table is claimed.
class ResurrectedResponse:
"""Looks like a requests response: .json(), .status_code, .ok, .text, .raise_for_status()."""
def __init__(self, data, status_code=200):
self._data = data
self.status_code = status_code
self.ok = status_code < 400
self.text = json.dumps(data)
def json(self):
return self._data
def raise_for_status(self):
if not self.ok:
raise RuntimeError("FoxAPIs answered %s" % self.status_code)
def _foxapis(method, path, headers, body=None):
data = json.dumps(body).encode() if body is not None else None
req = urllib.request.Request("https://api.foxapis.com" + path, data=data, method=method, headers=headers)
try:
with urllib.request.urlopen(req, timeout=120) as r:
raw = r.read().decode() or "null"
return r.status, json.loads(raw)
except urllib.error.HTTPError as e:
return e.code, None
def _wait_for_job(job_id, headers):
for _ in range(90):
status, job = _foxapis("GET", "/v1/jobs/" + job_id, headers)
if status >= 400:
raise RuntimeError("FoxAPIs job poll answered %s" % status)
if job.get("status") == "done":
return job
if job.get("status") in ("failed", "error"):
raise RuntimeError("FoxAPIs job " + job["status"])
time.sleep(2)
raise RuntimeError("FoxAPIs job did not finish in time; poll " + job_id + " again later")
def resurrected_company_lookup(domain=None):
if not domain:
raise ValueError("domain is required by FoxAPIs: company website domain")
key = os.environ.get("FOXAPIS_KEY")
if not key:
raise RuntimeError("Set FOXAPIS_KEY (free key: https://foxapis.com/trial)")
headers = {"Authorization": "Bearer " + key, "Content-Type": "application/json", "User-Agent": "resurrect/0.1"}
body = {}
if domain:
body["domain"] = domain
status, data = _foxapis("POST", "/v1/get_company_snapshot", headers, body)
if status in (401, 403):
raise RuntimeError("FoxAPIs rejected the key (status %s)" % status)
if status not in (200, 202):
raise RuntimeError("FoxAPIs answered %s" % status)
job = _wait_for_job(data["job_id"], headers) if status == 202 else data
return job.get("result")
def old_call(domain):
_resurrected_1 = resurrected_company_lookup(
domain="{domain}",
)
response = ResurrectedResponse(_resurrected_1, 200) if _resurrected_1 is not None else ResurrectedResponse({"detail": "No match found by FoxAPIs"}, 404)
return response.json()
curl
# RESURRECT: replaces the FullContact v2 Company API "Company lookup by domain" call (ended 2022-06-30). It now calls FoxAPIs POST /v1/get_company_snapshot.
# Needs FOXAPIS_KEY in the environment. A free key: https://foxapis.com/trial
# This call answers 202 with a job_id. Poll GET https://api.foxapis.com/v1/jobs/<job_id> with the same header until status is done.
curl -X POST https://api.foxapis.com/v1/get_company_snapshot \
-H "Authorization: Bearer $FOXAPIS_KEY" \
-H "Content-Type: application/json" \
-d '{"domain":"$DOMAIN"}'
Standalone code
JavaScript
import { pathToFileURL } from "node:url";
// RESURRECT: replaces the FullContact v2 Company API "Company lookup by domain" call (ended 2022-06-30). It now calls FoxAPIs POST /v1/get_company_snapshot.
// Needs FOXAPIS_KEY in the environment. A free key: https://foxapis.com/trial
// PARTIAL. get_company_snapshot answers with a written company snapshot (async: 202, then poll), not FullContact company fields. It is returned unchanged and no field table is claimed.
const asResponse = (data, status = 200) => ({ ok: status < 400, status, data, json: async () => data, text: async () => JSON.stringify(data) });
async function waitForJob(jobId, headers) {
for (let i = 0; i < 90; i += 1) {
const res = await fetch("https://api.foxapis.com" + "/v1/jobs/" + encodeURIComponent(jobId), { headers });
if (!res.ok) throw new Error("FoxAPIs job poll answered " + res.status);
const job = await res.json();
if (job.status === "done") return job;
if (job.status === "failed" || job.status === "error") throw new Error("FoxAPIs job " + job.status);
await new Promise((r) => setTimeout(r, 2000));
}
throw new Error("FoxAPIs job did not finish in time; poll " + jobId + " again later");
}
export async function resurrectedCompanyLookup({ domain } = {}) {
if (!domain) throw new Error("domain is required by FoxAPIs: company website domain");
const key = process.env.FOXAPIS_KEY;
if (!key) throw new Error("Set FOXAPIS_KEY (free key: https://foxapis.com/trial)");
const headers = { Authorization: `Bearer ${key}`, "Content-Type": "application/json" };
const body = {};
if (domain) body.domain = domain;
const res = await fetch("https://api.foxapis.com/v1/get_company_snapshot", { method: "POST", headers, body: JSON.stringify(body) });
if (res.status === 401 || res.status === 403) throw new Error("FoxAPIs rejected the key (status " + res.status + ")");
if (res.status !== 202 && !res.ok) throw new Error("FoxAPIs answered " + res.status);
const first = await res.json();
const job = res.status === 202 ? await waitForJob(first.job_id, headers) : first;
return job.result ?? null;
}
if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {
const arg = process.argv[2] ? JSON.parse(process.argv[2]) : {};
console.log(JSON.stringify(await resurrectedCompanyLookup(arg), null, 2));
}
Python
import json
import os
import re
import time
import urllib.error
import urllib.request
# RESURRECT: replaces the FullContact v2 Company API "Company lookup by domain" call (ended 2022-06-30). It now calls FoxAPIs POST /v1/get_company_snapshot.
# Needs FOXAPIS_KEY in the environment. A free key: https://foxapis.com/trial
# PARTIAL. get_company_snapshot answers with a written company snapshot (async: 202, then poll), not FullContact company fields. It is returned unchanged and no field table is claimed.
class ResurrectedResponse:
"""Looks like a requests response: .json(), .status_code, .ok, .text, .raise_for_status()."""
def __init__(self, data, status_code=200):
self._data = data
self.status_code = status_code
self.ok = status_code < 400
self.text = json.dumps(data)
def json(self):
return self._data
def raise_for_status(self):
if not self.ok:
raise RuntimeError("FoxAPIs answered %s" % self.status_code)
def _foxapis(method, path, headers, body=None):
data = json.dumps(body).encode() if body is not None else None
req = urllib.request.Request("https://api.foxapis.com" + path, data=data, method=method, headers=headers)
try:
with urllib.request.urlopen(req, timeout=120) as r:
raw = r.read().decode() or "null"
return r.status, json.loads(raw)
except urllib.error.HTTPError as e:
return e.code, None
def _wait_for_job(job_id, headers):
for _ in range(90):
status, job = _foxapis("GET", "/v1/jobs/" + job_id, headers)
if status >= 400:
raise RuntimeError("FoxAPIs job poll answered %s" % status)
if job.get("status") == "done":
return job
if job.get("status") in ("failed", "error"):
raise RuntimeError("FoxAPIs job " + job["status"])
time.sleep(2)
raise RuntimeError("FoxAPIs job did not finish in time; poll " + job_id + " again later")
def resurrected_company_lookup(domain=None):
if not domain:
raise ValueError("domain is required by FoxAPIs: company website domain")
key = os.environ.get("FOXAPIS_KEY")
if not key:
raise RuntimeError("Set FOXAPIS_KEY (free key: https://foxapis.com/trial)")
headers = {"Authorization": "Bearer " + key, "Content-Type": "application/json", "User-Agent": "resurrect/0.1"}
body = {}
if domain:
body["domain"] = domain
status, data = _foxapis("POST", "/v1/get_company_snapshot", headers, body)
if status in (401, 403):
raise RuntimeError("FoxAPIs rejected the key (status %s)" % status)
if status not in (200, 202):
raise RuntimeError("FoxAPIs answered %s" % status)
job = _wait_for_job(data["job_id"], headers) if status == 202 else data
return job.get("result")
if __name__ == "__main__":
import sys
arg = json.loads(sys.argv[1]) if len(sys.argv) > 1 else {}
print(json.dumps(resurrected_company_lookup(**arg), indent=2))
Notes from the rewrite engine
- FullContact v2 Company API Company lookup by domain: PARTIAL.
get_company_snapshotanswers with a written company snapshot (async: 202, then poll), not FullContact company fields. It is returned unchanged and no field table is claimed.
Fields that come back, and fields that do not
Company lookup by domain
PARTIAL. get_company_snapshot answers with a written company snapshot (async: 202, then poll), not FullContact company fields. It is returned unchanged and no field table is claimed.
Compat route: Mapped, but no compat route has been built.
Try it
There is no sample button on this page, because no compat route with a recorded sample exists for it.
- Company lookup by domain: Mapped, but no compat route has been built.