This example shows how to scrape listings from Kleinanzeigen — Germany's largest classifieds platform — using the Kleinanzeigen Listings Scraper actor on Apify. No browser automation or HTML parsing required: just call the actor via the Apify API client and get structured data back.
- Calls the Kleinanzeigen Listings Scraper actor with a category URL and search terms
- Waits for the run to complete
- Fetches results from the actor's output dataset
- Prints each listing to the console
- Node.js v18 or higher
- An Apify account (free tier works)
- An Apify API token
npm installcp .env.example .envOpen .env and replace your_apify_token_here with your actual Apify API token.
npm startimport { ApifyClient } from 'apify-client';
import 'dotenv/config';
// Initialize the ApifyClient with your Apify API token
// Set APIFY_TOKEN in your .env file (copy .env.example to get started)
const client = new ApifyClient({
token: process.env.APIFY_TOKEN,
});
// Prepare Actor input
const input = {
"startUrls": [
{
"url": "https://www.kleinanzeigen.de/s-elektronik/"
}
],
"searchTerms": [
"iphone 13",
"laptop"
]
};
// Run the Actor and wait for it to finish
const run = await client.actor("piotrv1001/kleinanzeigen-listings-scraper").call(input);
// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
console.dir(item);
});
// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docsSee sample-output.json for a full example. The actor returns results in two modes:
Listing mode — fast, page-level data:
| Field | Description |
|---|---|
adId |
Unique ad identifier |
url |
Direct link to the listing |
title |
Ad title |
price |
Price string (e.g. "900 € VB") |
location |
City and postal code |
datePosted |
Posting date or relative time |
description |
Short description snippet |
shipping |
Available shipping options |
isPro |
Whether the seller is a professional |
imageCount |
Number of images attached |
scrapedAt |
ISO timestamp of when the item was scraped |
Detail mode — richer data fetched from individual listing pages:
| Field | Description |
|---|---|
sellerName |
Name of the seller |
category |
Breadcrumb category path |
attributes |
Structured key/value attributes (brand, condition, color, etc.) |
images |
Array of full-resolution image URLs |
- Price monitoring — track used electronics or car prices over time
- Market research — analyze supply/demand for specific product categories in Germany
- Competitor analysis — monitor listings from professional sellers in your niche
- Lead generation — find sellers of specific items for resale or sourcing
- Academic research — study pricing patterns, regional trends, or listing behavior on German classifieds
Open the Kleinanzeigen Listings Scraper on Apify
- Kleinanzeigen Listings Scraper — the Apify actor used in this example
- How to Scrape Kleinanzeigen Listings — full guide with walkthrough and use cases
MIT
