dtb-sdk
v1.0.1
Published
dtb-sdk
Downloads
4
Readme
DTB SDK
A TypeScript SDK for scraping German business directory data from dastelefonbuch.de.
Installation
pnpm add dtb-sdkUsage
import { scrapeBusinessData, BusinessEntry } from "dtb-sdk";
async function searchBusinesses() {
try {
const results: BusinessEntry[] = await scrapeBusinessData({
name: "Thomas",
city: "Stuttgart",
page: 5,
});
console.log("Found businesses:", results);
} catch (error) {
console.error("Error:", error);
}
}
searchBusinesses();API
scrapeBusinessData(params: SearchParams): Promise<BusinessEntry[]>
Searches for businesses on dastelefonbuch.de.
Parameters
params.name: The name to search forparams.city: The city to search inparams.page: The page number (starting from 1)
Returns
An array of BusinessEntry objects containing:
name: Business nameaddress: Address information (streetAddress, postalCode, addressLocality)telephone: Phone numbercategory: Business category
Types
interface Address {
streetAddress: string;
postalCode: string;
addressLocality: string;
}
interface BusinessEntry {
name: string;
address: Address;
telephone: string;
category: string;
}
interface SearchParams {
name: string;
city: string;
page: number;
}