Try our Interactive Data Client: a revolutionary, AI-Powered, custom data retrieval tool. Retrieve ANY data on ANY subject within seconds: Start Now!

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.

Full example file:
/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:

  1. Define the structure of the JSON response using a TypeScript interface.
  2. Set a lookup value (e.g., Cisco), which can be:
    • a company name
    • a domain
    • an email address
  3. Construct the API request URL with your API key.
  4. Call the API using fetch.
  5. Parse the JSON response into the interface.
  6. 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

  1. 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
                                
  2. Edit example.ts and insert your API key.
  3. Run with TypeScript:
    tsc example.ts
    node example.js
                                
    Or run directly with ts-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.

AI Interactive Data Client: Request and Receive Structured Data of Any Kind on Any Subject.
Also, turn your structured data requests into an API call to integrate anywhere with different input parameters.
More...
Github Code Examples
Code examples for multiple scenarios such as easy integration, appending data via files in batch, generating match reports, and much more...
More...
Generate your own Datasets: Retrieve Customized, Real-World Data on Demand as Defined by You
Get results immediately - with infinite possibilities.
More...
High-Performance Batch Processing: Call our APIs with Text Files as Input.
Perform bulk data enrichment using CSV or TSV files.
More...
Try our Pay-as-you-Go Option
Start increasing the usability and value of your data - start small and grow with success.
More...
Available in the AWS Marketplace.
Optionally add usage billing to your AWS account.
More...
Free Trial Usage Credits
Register for an Interzoid API account and receive free usage credits. Improve the value and usability of your strategic data assets now.
Check out our full list of AI-powered APIs
Easily integrate better data everywhere.
More...
Documentation and Overview
See our documentation site.
More...
Product Newsletter
Receive Interzoid product and technology updates.
More...