Installeer apify-client via npm of pnpm
Voeg het officiële Apify client pakket toe aan je project.
npm install apify-client
Integratiegids — Node.js / TypeScript
Gebruik de officiële npm apify-client om geodata-actors aan te roepen vanuit je backend of serverless functies.
Voeg het officiële Apify client pakket toe aan je project.
npm install apify-client
Importeer de client en maak een instantie aan met je API token.
import { ApifyClient } from 'apify-client';
const client = new ApifyClient({
token: process.env.APIFY_TOKEN,
});
Voorbeeld voor de PDOK Locatieserver geocoding actor (`codeclouds/pdok-locatieserver`).
import { ApifyClient } from 'apify-client';
const client = new ApifyClient({
token: process.env.APIFY_TOKEN,
});
async function geocodeAddress(query: string) {
const runInput = {
query,
includeCbsStats: true,
};
// Start actor en wacht op afronding
const run = await client.actor('codeclouds/pdok-locatieserver').call(runInput);
// Ophalen gegenereerde dataset items
const { items } = await client.dataset(run.defaultDatasetId).listItems();
return items;
}
// Voorbeeld aanroep
geocodeAddress('Dam 1, Amsterdam').then(console.log);
Aanroep zonder externe libraries via de Apify REST API `run-sync-get-dataset-items` endpoint.
const token = process.env.APIFY_TOKEN;
const url = `https://api.apify.com/v2/acts/codeclouds~pdok-locatieserver/run-sync-get-dataset-items?token=${token}`;
const response = await fetch(url, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ query: 'Spui 1, Den Haag' }),
});
const items = await response.json();
console.log(items);
Zoek een NL adres, postcode of coördinaat op — geocoding, reverse geocoding en lookup in 1 call via de gratis PDOK-API. Output: WGS84+RD-coördinaten, BAG-ID's, optioneel CBS-buurtdata. Bespaart 3 API-integraties + RD-conversie. Bulk-verwerking, retries. Vanaf $1,50/1.000 (PPE).
Vanaf $0,0015 per adres ($1,50 per 1.000)
Bekijk op ApifyCheck de netcongestiestatus van het Nederlandse elektriciteitsnet per postcode of adres — afname- en invoedstatus, wachtrijgrootte (MW) — rechtstreeks van de officiële landelijke Capaciteitskaart (Netbeheer Nederland + TenneT).
Vanaf $0,01 per locatie
Bekijk op ApifyActuele tarieven en real-time vrije-plekken-tellingen voor Nederlandse parkeergarages, rechtstreeks uit RDW's landelijke Open Parkeerdata-feed. Detecteert wijzigingen in de livestatus van een garage tussen runs.
Vanaf $0,003 per garage
Bekijk op ApifyAbsoluut! Zowel `apify-client` als de native `fetch` aanpak werken uitstekend in serverless Node.js / Next.js environments.
Bij `client.actor(...).call(input, { timeout: 60 })` kun je de maximale wachttijd in seconden opgeven.
Alle actors draaien op Apify onder je eigen account. Start meteen met je gratis Apify API token.
Bekijk alle GeoFetch actors →