# Tradera Item & Category Scraper (`measured_tumbler/tradera-item-scraper`) Actor

Scrapes item data (title, price, condition, image, SKU) from Tradera.se category and item pages. Reads Tradera's own published structured product data instead of fragile page-scraping, for higher reliability than existing Tradera Actors.

- **URL**: https://apify.com/measured\_tumbler/tradera-item-scraper.md
- **Developed by:** [Adam Berup](https://apify.com/measured_tumbler) (community)
- **Stats:** 2 total users, 1 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

## Tradera Item & Category Scraper

Apify Actor. Scrapes item data (title, price, currency, condition, image, SKU, availability) from [Tradera.se](https://www.tradera.com), Sweden's largest auction/marketplace site, given category page URLs and/or direct item page URLs.

### Why this exists

The existing Tradera Actor on the Apify Store (`crawlerbros/tradera-scraper`) runs at roughly a 73.5% success rate — genuinely broken on about 1 in 4 runs. This Actor takes a different, more robust approach: instead of scraping Tradera's internal Next.js page structure (which changes silently), it reads the `schema.org/Product` JSON-LD block Tradera publishes as static, server-rendered metadata on every item page for SEO. That block is present even with JavaScript disabled and is far less likely to break silently than scraping rendered DOM text.

Verified live (23 sep 2026) against three different item categories (vintage goods, electronics, clothing): 8/8 items scraped cleanly in an end-to-end local test run.

### How it works

1. **Category pages** (`tradera.com/category/{id}`) need a real browser — item cards are rendered client-side, confirmed empty in the raw HTML response. A `PlaywrightCrawler` loads the page, scrolls a few times, and collects every `/item/...` link it finds.
2. **Item pages** (`tradera.com/item/{catId}/{itemId}/...`) are plain server-rendered HTML with the JSON-LD `Product` block always present, so a lightweight `CheerioCrawler` (no browser) fetches and parses each one directly. This is the fast, reliable, low-cost half of the run.
3. Direct item URLs passed in `startUrls` skip category discovery entirely and go straight to phase 2.

### Legal / robots.txt

Checked live 23 sep 2026: `tradera.com/robots.txt` disallows `/search?*`, `/ajax/*`, and every legacy `/category/*.asp*` path. This Actor never touches any of those — it only requests plain `/category/{id}` pages (not disallowed) and plain `/item/{catId}/{itemId}/...` pages (not disallowed; only `/item/bidding/*` and `/item/*/bidhistory` are excluded, and this Actor doesn't touch those either).

### Known limitations (v0.1)

- **No multi-page category pagination.** Live testing found no numbered pager or "load more" control on any sampled category — item lists appear to load fully on one page (with scrolling). The `maxCategoryPages` input field is reserved for this but currently has no effect.
- **No bid count / auction end time / seller name.** These exist in Tradera's internal React payload but only as a messy, repeated, hard-to-target blob (not a clean JSON block like the Product data) — deliberately left out of v0.1 rather than shipping a fragile regex guess. Worth revisiting once there's a specific paying use case that needs it.
- **`offers.price` is whatever price Tradera's own JSON-LD reports** — for an active auction this is typically the current bid, not a guaranteed final sale price. Not verified against every possible listing state (e.g. ended auctions, buy-it-now-only listings).

### Local development

```
npm install
npx playwright install chromium
APIFY_LOCAL_STORAGE_DIR="$(pwd)/storage" node src/main.js
```

Put a test input at `storage/key_value_stores/default/INPUT.json`, e.g.:

```json
{
  "startUrls": ["https://www.tradera.com/category/1001026"],
  "maxItems": 10
}
```

### Deploying (not yet done — needs an Apify account)

1. `npm install -g apify-cli` (or `npx apify-cli`)
2. `apify login` — needs an Apify account + API token from [console.apify.com](https://console.apify.com). Account creation, KYC (ID + payout details) and ToS acceptance are a personal step, not something to automate.
3. From this directory: `apify push` — builds and publishes this Actor to your Apify account.
4. In the Apify Console, set pricing to Pay-Per-Event using `.actor/pay_per_event.json` (already defined: $0.01 flat per run + $0.004 per item scraped) and publish to the Store.

### Pricing (`.actor/pay_per_event.json`)

- `actorStartGb` — $0.01, charged once per run.
- `item-scraped` — $0.004, charged once per item successfully scraped and returned.

# Actor input Schema

## `startUrls` (type: `array`):

Tradera category pages (e.g. https://www.tradera.com/category/1001026) or direct item pages (e.g. https://www.tradera.com/item/344557/751922905/...) to scrape. Category pages are crawled for item links; item pages are scraped directly. Search-result URLs (tradera.com/search?...) are not supported -- disallowed by Tradera's robots.txt.

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

Stop after this many item pages have been scraped (across all start URLs combined). Keeps a single run's cost bounded.

## `maxCategoryPages` (type: `integer`):

Reserved for future multi-page category support. v0.1 loads each category start URL once (with scrolling) and does not paginate -- no numbered pager or 'load more' control was found on any sampled category during development, so pagination wasn't built blind. Currently has no effect.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.tradera.com/category/1001026"
    }
  ],
  "maxItems": 100,
  "maxCategoryPages": 1
}
```

# Actor output Schema

## `title` (type: `string`):

No description

## `price` (type: `string`):

No description

## `condition` (type: `string`):

No description

## `url` (type: `string`):

No description

## `image` (type: `string`):

No description

# 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 = {
    "startUrls": [
        {
            "url": "https://www.tradera.com/category/1001026"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("measured_tumbler/tradera-item-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 = { "startUrls": [{ "url": "https://www.tradera.com/category/1001026" }] }

# Run the Actor and wait for it to finish
run = client.actor("measured_tumbler/tradera-item-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 '{
  "startUrls": [
    {
      "url": "https://www.tradera.com/category/1001026"
    }
  ]
}' |
apify call measured_tumbler/tradera-item-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,measured_tumbler/tradera-item-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/Ub7IeRwskkIcaYZqe/builds/uy5iSMrBdKuERVk4a/openapi.json
