# Guloggratis.dk Scraper — Free Classifieds, Prices & Alerts (`lupine_humerus/guloggratis-dk-scraper`) Actor

Track new listings and price drops on Guloggratis.dk, Denmark's free classifieds, with incremental webhook, Slack and Telegram alerts.

- **URL**: https://apify.com/lupine_humerus/guloggratis-dk-scraper.md
- **Developed by:** [Lupine](https://apify.com/lupine_humerus) (community)
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-usage

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Guloggratis.dk Scraper — Free Classifieds, Prices & Alerts

**In one line:** a monitoring interface for Guloggratis.dk (GulogGratis.dk A/S, Odense), Denmark's free classifieds site with ~472,000 live ads — built for Danish resellers, dealers, and price analysts who want new listings and price drops from the market DBA.dk does not cover, ready to act on, not a pile of raw pages.

**Not "a Guloggratis crawler" — a "new listings & price drop alerts" feed for the Danish free-classifieds market.** Incremental mode + webhook are the product, not extras: run it on a schedule and only get the ads that are actually new or changed in price.

### Why this tech route (measured, not guessed)

Probed 2026-11-18 with plain `requests` from a datacenter egress:

| Probe | Result |
|---|---|
| API | `POST https://api.guloggratis.dk/graphql` — **200, ~0.4–1 s, no login, no auth, no Cloudflare challenge** |
| Search query | `search(filters: SearchFiltersInput!, pagination: PaginationInput!)`; keyword field is `filters.term` (found after 5 wrong guesses — the server's "Did you mean ...?" errors guided the discovery); category is `"/kategori/<slug>"`; price bounds are `priceFrom`/`priceTo` (DKK, server-side) |
| Pagination | `{page, perPage}`; **perPage capped at 60** (100 is rejected: "Page size limit exceeded") |
| Detail query | `listing(id: "<uuid>")` (`$id: UUID!`) |
| Prices | `price { text, raw }`, `raw` in **øre** — divide by 100 for DKK (`850000` → `8500`); `originalPrice` is a bare Float, also øre |
| Images | `url(size: Listing640x640)` (enum: `Listing320` / `Listing640x640` / `Listing1280x1280`, recovered from the SSR page's `__INITIAL_STATE_GRAPHQL__`) |
| Categories | List rows carry only `categoryUrl` (e.g. `"/elektronik/telefon"`); titles come from the detail query's `categories` or a static slug→title map. Detail `listingFields` carry no slug — it lives on the nested `field { slug title }` (bare slug, e.g. `"maerke"`, vs the list payload's `"cf-maerke"`) |
| Sorting | Roughly newest first (`createdAt` descending, with occasional older rows mixed in) |

**Conclusion: direct GraphQL POST is the lightest route that works.** No browser, no fingerprinting, no residential proxies; datacenter IPs are enough. Same family as DBA.dk — the opposite of Boat24 (Cloudflare + Camoufox), so do not copy Boat24's browser stack here.

### Input

Only one of `searchTerms` or `searchUrls` is required; everything else is optional.

| Group | Field | Notes |
|---|---|---|
| Search | `searchTerms`, `searchUrls`, `category` | category: 13 top-level slugs (default "" = whole site); `searchUrls` wins and its category path + `?term=` are parsed out of the URL |
| Filters | `priceMin` / `priceMax` (DKK), `sellerType` (private/business) | Price bounds go to the server (`priceFrom`/`priceTo`); a `priceMin` drops free (0 kr., "Gratis") ads — see below. `sellerType` is applied after fetching (`user.isBusiness`); listings whose seller type the site does not state are kept |
| Limits | `maxItems` (default 100), `maxPagesPerSearch` (0 = unlimited) | Multiple terms are merged and deduplicated by `listingId`; `maxItems` counts after filtering and de-duplication |
| Details | `fetchDetails` (default off) | On: calls `listing(id)` per ad for the full description, the real category path, all listing fields (richer `fullValue`, e.g. `"512 GB"` vs `"512"`) and `viewsCount` |
| Proxy | `proxyConfiguration` | Apify Proxy on by default; Guloggratis.dk does not block datacenter IPs, so it also runs without it |
| Alerts / incremental | `incremental`, `resetState`, `webhookUrl`, `webhookHeaders`, `slackWebhookUrl`, `telegramBotToken`, `telegramChatId` | A named key-value store (`guloggratis-state`) keeps `listingId → last price`; only new listings and price changes are pushed. Slack/Telegram push only four fields per listing (listingId, title link, URL, status 新/价格变动), no item cap; a run that exceeds the platform message limit (Slack 40,000 chars, Telegram 4,096) is split into several messages, nothing dropped; the webhook payload carries the full new/changed list. A notification failure never breaks the main run. |

Search semantics: `term` is the site's own loose/semantic search — it mainly matches titles but can also match descriptions/brands, and **"wanted" ads come back mixed in** (title contains "søger", often priced 1 kr.); there is no listing-type field that separates them (`listingType` is `"Normal"` for both). The code does no title-only filtering. A term with no matches returns 0 rows (verified: a nonsense term returns `total 0`, no filler).

Price filter note: bounds are server-side, so a `priceMin` is enforced by the site, not by the Actor. Measured 2026-11-18: in the `iphone` + `elektronik` set the only sub-1-kr. ad is a free ("Gratis", `raw: 0`) phone cover, and `priceFrom: 1` drops exactly that one ad (total 817 → 816). If you set a price minimum, free ads are excluded — that is the site's behaviour, not a filter bug.

### Output (24 fields, order is the contract)

`listingId`, title, category, subCategory, brand, listingUrl, imageUrl, images, imageCount, **price, currency, priceText**, **originalPrice, originalCurrency**, condition, location, sellerType, postedDate, description, specs, isNew, searchUrl, scrapedAt.

- Related fields stay adjacent: price → currency → priceText; originalPrice → originalCurrency.
- Price: numeric `price` (DKK) + verbatim `priceText` (`8.500 kr.` — the dot is a thousands separator, not a decimal point). A free ad has `price: 0`, `priceText: "Gratis"`.
- `category` is the top-level category title, `subCategory` the leaf title (e.g. `Elektronik` / `Telefon`; three levels: `Elektronik` / `TV` with `specs.categoryPath` `"Elektronik > Lyd & billede > TV"`) — the same convention as the DBA.dk Actor. In list mode they come from the row's `categoryUrl` via a slug→title map (known slugs use the site's own Danish titles; unknown leaf slugs are prettified); `fetchDetails` overwrites them with the real titles from the detail query, and puts the full path in `specs.categoryPath` (`"Elektronik > Telefon"`).
- `brand` is the `cf-maerke` listing field; `condition` is the `cf-varens-stand` text verbatim (e.g. `Aldrig brugt`, `Næsten som ny`). Some fields are empty because the seller never provided them — empty means "no data on the site", not a scrape miss.
- `specs` is a non-fixed object: keys differ per listing (`cf-maerke`, `cf-hukommelse`, `cf-farve`, …); treat it as "use it when present, empty otherwise". With `fetchDetails` on, values are the richer `fullValue` and `specs` also gains `categoryPath` and `viewsCount`.
- `description` is only filled when `fetchDetails` is on.
- `listingId` is the site UUID, the unique dedup/join key for dataset, webhook, Slack and Telegram alike.

See `sample-output.json` for real run data (2 items, `fetchDetails` on, 2026-11-18).

Example record (real run, 2026-11-18):

```json
{
  "listingId": "ebd636f4-03ec-4872-8168-ca17a74bc2db",
  "title": "iPhone 18 Pro 512 GB.",
  "category": "Elektronik",
  "subCategory": "Telefon",
  "brand": "Apple",
  "listingUrl": "https://www.guloggratis.dk/annonce/ebd636f4-03ec-4872-8168-ca17a74bc2db/iphone-18-pro-512-gb",
  "imageUrl": "https://assets.guloggratis.dk/images/6d6944c3-9916-4650-b60e-d352845b853e/6d6944c3-9916-4650-b60e-d352845b853e-640x480.webp",
  "images": ["https://assets.guloggratis.dk/images/6d6944c3-9916-4650-b60e-d352845b853e/6d6944c3-9916-4650-b60e-d352845b853e-640x480.webp"],
  "imageCount": 4,
  "price": 8500,
  "currency": "DKK",
  "priceText": "8.500 kr.",
  "originalPrice": 12999,
  "originalCurrency": "DKK",
  "condition": "Aldrig brugt",
  "location": "4220 Korsør",
  "sellerType": "private",
  "postedDate": "2026-11-18T11:20:20.676Z",
  "description": "Helt ny iPhone 18 Pro 512 GB sælges. Den er kun lige åbnet aldrig taget i brug. ...",
  "specs": {"cf-hukommelse": "512 GB", "cf-maerke": "Apple", "cf-farve": "Hvid", "cf-produkttype": "Mobiltelefon", "cf-varens-stand": "Aldrig brugt", "cf-forsendelse": "Op til 1 kg", "categoryPath": "Elektronik > Telefon", "viewsCount": 3},
  "isNew": true,
  "searchUrl": "https://www.guloggratis.dk/kategori/elektronik?term=iphone",
  "scrapedAt": "2026-11-18T16:29:14.797973Z"
}
```

(`images` truncated to 1 of 4 URLs and `description` shortened here; the full record is in `sample-output.json`.)

### How it compares

| | This Actor (v0.1.0) | DBA.dk Actor (santamaria, already on Apify) |
|---|---|---|
| Market | Guloggratis.dk — free classifieds, private sellers | DBA.dk — Denmark's largest marketplace |
| Details (description / condition / category path) | Yes (`fetchDetails`) | No (list-only) |
| New-listing / price-change alerts | Yes (incremental + webhook/Slack/Telegram) | Not seen |
| Tech | Direct GraphQL, datacenter IPs are enough | Plain HTTP, datacenter IPs are enough |
| Apify Store competition for Guloggratis | **None found** (site:apify.com, 0 results, 2026-11-18) — blank market | — |

### Baselines (recorded for later comparison)

Measured 2026-11-18, see `TEST_REPORT.md`:

- `term:"iphone"` + `elektronik`: **total 817**, first row `ebd636f4` iPhone 18 Pro 512GB, 8,500 DKK (orig. 12,999 DKK), posted 2026-11-18T11:20:20Z.
- `term:"iphone"` + `elektronik` + 5000–6000 DKK: **44 rows**, all prices within the band.
- `term:"iphone"` whole site: total 887. Whole site: ~472,029 ads; `elektronik` category page: 22,822 ads.
- Functional tests 9/9 + notification unit tests all pass on AWS (see `TEST_REPORT.md`).

First rows shift as new ads are posted; totals are the stable reference.

### Run locally

```bash
python3 -m venv .venv && .venv/bin/pip install -r requirements.txt
.venv/bin/python test_functional.py        # list/category/price/pagination/details/incremental
.venv/bin/python test_notifications.py     # Slack/Telegram/webhook message builders + POST mechanics
## Apify way: apify run (or build the Actor in Console)
```

# Actor input Schema

## `category` (type: `string`):

Which top-level category Search terms search in. '' = whole site. Ignored when Search URLs are given.

## `fetchDetails` (type: `boolean`):

When true, calls listing(id) for each ad for the full description, the real category path, all listing fields (richer fullValue, e.g. '512 GB') and viewsCount. Slower and more requests — leave off for fast list scraping. The list payload already has price, specs, images and seller type.

## `incremental` (type: `boolean`):

When true, the Actor remembers listingId -> last price in a named Key-Value Store and the webhook only reports new listings and price changes. Default off (every run reports the full set).

## `maxItems` (type: `integer`):

Maximum listings to collect across all searches, counted AFTER filtering and de-duplication. Default 100. The site returns at most 60 rows per page; broad queries page through until this limit.

## `maxPagesPerSearch` (type: `integer`):

Maximum result pages per search term/URL. 0 = unlimited (until the site reports no next page). Set to 1 for the first page only.

## `priceMax` (type: `integer`):

Maximum price in DKK. Leave empty for no maximum. Applied server-side (priceTo).

## `priceMin` (type: `integer`):

Minimum price in DKK. Leave empty for no minimum. Applied server-side (priceFrom).

## `proxyConfiguration` (type: `object`):

Guloggratis.dk does NOT block datacenter IPs (verified 2026-11-18: plain GraphQL POSTs return 200, no Cloudflare). Apify Proxy is on by default and works out of the box; set useApifyProxy to false to run without a proxy, or give your own proxyUrls.

## `requestDelayMs` (type: `integer`):

Polite delay between API requests. Default 300 ms.

## `resetState` (type: `boolean`):

When true (with Incremental on), clears the remembered prices first, so the next run treats everything as new. Default off.

## `searchTerms` (type: `array`):

Keywords, e.g. 'iPhone 15', 'Volvo V60', 'Brio'. Each term is searched separately (the site's term search: mainly matches title, may also match description/brand — the Actor does no title-only filtering). 'Wanted' ads (title contains 'søger', often priced 1 kr.) come back mixed in; there is no site field that separates them. Leave empty if you use Search URLs instead.

## `searchUrls` (type: `array`):

Paste Guloggratis.dk category URLs straight from the browser, e.g. https://www.guloggratis.dk/kategori/elektronik or https://www.guloggratis.dk/kategori/elektronik/telefon?term=iphone . When given, Search terms and Category are ignored for these URLs. The category path and ?term= are parsed out of each URL.

## `sellerType` (type: `string`):

Filter by seller: '' = All, 'private' = private sellers, 'business' = business sellers. Applied after fetching (user.isBusiness); listings whose seller type the site does not state are kept.

## `slackWebhookUrl` (type: `string`):

Optional: posts a Slack message per run (summary + every new/price-changed listing; splits into multiple messages when too long) when Incremental is on and there is something new/changed. Needs a Slack Incoming Webhook URL. Without Incremental it is not used. Notification failure never fails the run.

## `telegramBotToken` (type: `string`):

Optional: Telegram bot token (from @BotFather). Needs Telegram chat ID too. Sends a Telegram message per run (every new/price-changed listing; splits into multiple messages when too long) when Incremental is on and there is something new/changed. Without Incremental it is not used. Notification failure never fails the run.

## `telegramChatId` (type: `string`):

Optional: Telegram chat ID to send alerts to (the channel, group or user ID). Needs Telegram bot token too.

## `webhookHeaders` (type: `object`):

Extra HTTP headers for the webhook, e.g. {"Authorization": "Bearer <redacted>"}. Webhook only; Slack and Telegram use their own fields.

## `webhookUrl` (type: `string`):

Optional: POSTs one JSON message per run (all new/price-changed items, no item cap) when Incremental is on and there is something new/changed. Without Incremental it is not used. Notification failure never fails the run.

## Actor input object example

```json
{
  "category": "",
  "fetchDetails": false,
  "incremental": false,
  "maxItems": 100,
  "maxPagesPerSearch": 0,
  "requestDelayMs": 300,
  "resetState": false,
  "sellerType": ""
}
```

# Actor output Schema

## `dataset` (type: `string`):

Dataset containing all scraped Guloggratis.dk listings

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "category": "",
    "fetchDetails": false,
    "incremental": false,
    "maxItems": 100,
    "maxPagesPerSearch": 0,
    "requestDelayMs": 300,
    "resetState": false,
    "sellerType": ""
};

// Run the Actor and wait for it to finish
const run = await client.actor("lupine_humerus/guloggratis-dk-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/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "category": "",
    "fetchDetails": False,
    "incremental": False,
    "maxItems": 100,
    "maxPagesPerSearch": 0,
    "requestDelayMs": 300,
    "resetState": False,
    "sellerType": "",
}

# Run the Actor and wait for it to finish
run = client.actor("lupine_humerus/guloggratis-dk-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "category": "",
  "fetchDetails": false,
  "incremental": false,
  "maxItems": 100,
  "maxPagesPerSearch": 0,
  "requestDelayMs": 300,
  "resetState": false,
  "sellerType": ""
}' |
apify call lupine_humerus/guloggratis-dk-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,lupine_humerus/guloggratis-dk-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/ZfDDnjuWgdpec0uqF/builds/MWxd1vK2pSUkcJZbn/openapi.json
