Lightweight client for the TechDetect Technology Detection API. Detect the tech stack of any website with a single function call.
Works in Node.js (18+) and modern browsers. Ships with TypeScript types. Supports both CommonJS and ESM.
npm install techdetectimport { TechDetect } from "techdetect";
const td = new TechDetect({ apiKey: "YOUR_KEY" });
const result = await td.detect("https://shopify.com");
console.log(result.technologies);
// [
// { name: "Shopify", categories: ["ecommerce"], confidence: 1, version: null, detected_by: ["http","html"] },
// ...
// ]const { TechDetect } = require("techdetect");
const td = new TechDetect({ apiKey: "YOUR_KEY" });
td.detect("https://github.com").then((result) => {
console.log(result.technologies);
});Instead of passing the API key directly, you can set the TECHDETECT_API_KEY environment variable:
export TECHDETECT_API_KEY=your_key_hereconst td = new TechDetect(); // key read from env
const result = await td.detect("https://example.com");| Option | Type | Default | Description |
|---|---|---|---|
apiKey |
string |
process.env.TECHDETECT_API_KEY |
API key for authentication |
baseUrl |
string |
https://techdetect.dapdev.tech |
Base URL of the API |
timeout |
number |
30000 |
Request timeout in ms |
Scans a URL and returns the detected technologies.
Parameters:
| Parameter | Type | Description |
|---|---|---|
url |
string |
The website URL to scan |
options.apiKey |
string |
Override the API key for this request |
options.timeout |
number |
Override timeout for this request |
options.params |
Record<string, string> |
Additional query parameters |
Returns: Promise<DetectResult>
interface DetectResult {
url: string;
technologies: Technology[];
meta: ScanMeta;
}
interface Technology {
name: string;
categories: string[];
confidence: number;
version: string | null;
detected_by: string[];
}
interface ScanMeta {
scan_time_ms: number;
layers_used: string[];
}All errors are instances of TechDetectError:
import { TechDetect, TechDetectError } from "techdetect";
const td = new TechDetect({ apiKey: "YOUR_KEY" });
try {
const result = await td.detect("https://example.com");
} catch (err) {
if (err instanceof TechDetectError) {
console.error(err.message); // Human-readable message
console.error(err.status); // HTTP status code (if applicable)
console.error(err.body); // Raw error response body
}
}MIT