TypeScript Example Code: Getting Current Business Information with Global Coverage
Whether you're enriching CRM records, powering analytics dashboards, qualifying leads, or verifying business information during onboarding, having accurate, current, globally covered company data is critical. Interzoid’s Get Business Info API provides a single endpoint that returns structured profile details about virtually any organization worldwide.
This example demonstrates how to call the Business Information API from a clean, dependency-free
TypeScript script using built-in fetch. The response includes firmographic
details such as company name, URL, location, description, revenue range, employee count, NAICS code,
and top executive information.
/get-business-info-premium/typescript-examples/example.ts
Requirements:
- Node.js 18+ (for built-in
fetch) or a modern browser runtime - An Interzoid API key: Register here
What Information You Can Retrieve
The API returns structured, normalized business intelligence fields such as:
- CompanyName – Official business name
- CompanyURL – Primary website
- CompanyLocation – Headquarters or primary address
- CompanyDescription – Business summary
- Revenue – Estimated revenue or revenue range
- NumberEmployees – Employee count range
- NAICS – Industry classification
- TopExecutive – Key contact or decision-maker
- TopExecutiveTitle – Title of the top executive
These attributes power numerous operational workflows, from lead scoring to segmentation, market profiling, risk assessment, compliance checks, and more.
The TypeScript Example Code
Below is the full example script exactly as used in the Interzoid Platform repository. It performs the API call, parses the JSON into a TypeScript interface, and prints the returned firmographic data.
// example.ts
// This example shows how to call Interzoid's Business Information API
// using TypeScript with no external libraries, in the simplest way possible.
// NOTE: This example assumes a runtime environment where `fetch` is available,
// such as Node.js 18+ or a modern browser.
// Replace this with your API key from https://www.interzoid.com/manage-api-account
const API_KEY = "YOUR_API_KEY_HERE";
// Define the expected JSON response shape
interface ApiResponse {
CompanyName: string;
CompanyURL: string;
CompanyLocation: string;
CompanyDescription: string;
Revenue: string;
NumberEmployees: string;
NAICS: string;
TopExecutive: string;
TopExecutiveTitle: string;
Code: string;
Credits: string;
}
async function main(): Promise {
// We URL-encode the lookup value for safety, so different inputs will work.
const lookup = encodeURIComponent("Cisco");
// Construct the API request URL
const apiURL =
"https://api.interzoid.com/getbusinessinfo?license=" +
encodeURIComponent(API_KEY) +
"&lookup=" +
lookup;
try {
// Perform the HTTP GET request
const response = await fetch(apiURL);
// Check the HTTP status for errors
if (!response.ok) {
console.error("Error calling API. HTTP status:", response.status);
return;
}
// Parse the response into our ApiResponse TypeScript interface
const data: ApiResponse = await response.json();
// Print the important fields
console.log("Company Name:", data.CompanyName);
console.log("Website:", data.CompanyURL);
console.log("Location:", data.CompanyLocation);
console.log("Description:", data.CompanyDescription);
console.log("Revenue:", data.Revenue);
console.log("Employees:", data.NumberEmployees);
console.log("NAICS:", data.NAICS);
console.log("Top Executive:", data.TopExecutive);
console.log("Top Executive Title:", data.TopExecutiveTitle);
console.log("Result Code:", data.Code);
console.log("Remaining Credits:", data.Credits);
} catch (error) {
// Handle any network or parsing issues
console.error("Error calling or parsing API:", error);
}
}
// Run the example
main();
How the Script Works
The script follows a straightforward flow:
- Define the structure of the JSON response using a TypeScript interface.
- Set a lookup value (e.g.,
Cisco), which can be:- a company name
- a domain
- an email address
- Construct the API request URL with your API key.
- Call the API using
fetch. - Parse the JSON response into the interface.
- Print the returned firmographic details.
This makes it easy to extend into your own TypeScript systems—loop over multiple companies, store the results in a database, enrich CRM or data warehouse records, or attach metadata for analytics.
Running the Example
-
Enter the code into your IDE, or you can clone or navigate to the example in Github:
git clone https://github.com/interzoid/interzoid-platform.git cd interzoid-platform/get-business-info-premium/typescript-examples - Edit
example.tsand insert your API key. - Run with TypeScript:
tsc example.ts node example.jsOr run directly withts-node:npx ts-node example.ts
You’ll immediately see the business intelligence fields printed in the console, providing global company data with a single API call.
This example highlights how easy it is to integrate Interzoid’s globally-covered Business Information API into a TypeScript or Node.js workflow. With just a few lines of code, you can retrieve rich, structured firmographic data that fuels downstream enrichment, segmentation, analytics, compliance, and operational intelligence.
From here, you can scale the example into batch processes, workflows, automated pipelines, or enrich thousands of company records using the same approach.