# Amazon Category Tree & Browse Node Mapper (`crawlyth-forge/amazon-category-tree-mapper`) Actor

Export Amazon's department and category taxonomy per marketplace: real browse-node IDs, names, breadcrumbs, parents, depth, child counts, leaf flags, chart and search URLs.

- **URL**: https://apify.com/crawlyth-forge/amazon-category-tree-mapper.md
- **Developed by:** [crawlyth forge](https://apify.com/crawlyth-forge) (community)
- **Categories:** E-commerce, Automation, Developer tools
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.49 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## 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

## Amazon Category Tree & Browse Node Mapper

Export Amazon's public department and category taxonomy for any supported marketplace. One row per category node gives you the real browse-node ID, the full breadcrumb, the parent node, the depth, how many children it has, whether it is a leaf, and ready-to-use Best Sellers, New Releases, Most Wished For, Most Gifted, Movers & Shakers and search URLs.

This actor reads Amazon's own Best Sellers left-navigation tree. It does not need cookies, a login, an API key or any proxy setup.

### What you get

- **Marketplace-wide maps** — every root department in a marketplace, then as many child levels as you ask for.
- **Department maps** — start from `Electronics`, `Books`, `Home & Kitchen` or any other root department name, slug or URL.
- **Node maps** — start from numeric browse-node IDs, bestsellers URLs or slug paths such as `electronics/172541`.
- **Real browse-node IDs** — every non-root node carries Amazon's numeric node ID from the category links. Root departments carry it whenever Amazon exposes it.
- **Breadcrumb + parent chain** — localized names, slugs, node IDs, parent name and parent key, so the rows load straight into a tree, a picker or a database.
- **Leaf detection** — `childCount` and `isLeaf` come from the live navigation, not from a guess.
- **Working links** — chart URLs for five Amazon charts plus a marketplace search URL scoped to the node, with the department `search-alias` (`i=`).
- **Optional depth** — product counts and English names are opt-in because they cost extra page loads.

### Supported marketplaces

United States, United Kingdom, Germany, France, Italy, Spain, Netherlands, Sweden, Poland, Belgium, Turkey, United Arab Emirates, Saudi Arabia, Egypt, India, Singapore, Australia, Japan, Brazil, Mexico, Canada, South Africa and Ireland.

Each marketplace has its own taxonomy. The same department can have a different slug, node ID and localized name in each one, and this actor reports the marketplace's own values.

### Modes

| Mode | What it does |
|---|---|
| `marketplace` | Walks every root department of each selected marketplace down to `maxDepth`. |
| `roots` | Saves only the root departments (cheapest useful map). |
| `department` | Starts from the root departments listed in `rootDepartments`. |
| `node` | Starts from the IDs, category URLs or slug paths listed in `nodeIds`. |

`maxDepth` counts child levels below the start: `0` is the start only, `1` adds its children, `2` adds grandchildren, and so on.

### Inputs

| Input | Type | Default | Notes |
|---|---|---|---|
| `mode` | select | `marketplace` | `marketplace`, `roots`, `department` or `node`. |
| `marketplaces` | array | `["amazon.com"]` | One or more supported Amazon marketplaces. |
| `rootDepartments` | array | – | Department names, slugs or URLs. Empty means every root department. |
| `nodeIds` | array | – | Numeric IDs, bestsellers/chart URLs or slug paths for `node` mode. |
| `maxDepth` | integer | `2` | Child levels to follow, 0–6. |
| `maxNodes` | integer | `500` | Hard cap on saved rows. |
| `includeChartUrls` | boolean | `true` | Add five chart URLs per node. |
| `includeSearchUrl` | boolean | `true` | Add a node-scoped search URL. |
| `includeSearchAlias` | boolean | `true` | Add the department `search-alias` (`i=`). |
| `includeProductCounts` | boolean | `false` | Fetch approximate counts from search result bars. |
| `maxProductCounts` | integer | `25` | Cap on count lookups. |
| `includeEnglishNames` | boolean | `false` | Add `englishName` on non-English marketplaces. |
| `resolveRootIds` | boolean | `true` | Recover missing root IDs with a bounded search lookup. |
| `maxRootIdLookups` | integer | `25` | Cap on those root-ID lookups. |
| `requestDelayMs` | integer | `400` | Extra wait after each page load. |
| `proxyConfiguration` | proxy | AUTO datacenter | Optional; the default needs no setup and is pinned to the marketplace country. |

`mode` and `marketplaces` are required. Every other input has a safe default.

### Output fields

| Field | Description |
|---|---|
| `recordType` | Always `categoryNode`. |
| `marketplace` | Marketplace domain, e.g. `amazon.de`. |
| `marketplaceCountryCode` | ISO country code of the marketplace. |
| `marketplaceCurrency` | Marketplace currency. |
| `marketplaceLanguage` | Marketplace locale. |
| `browseNodeId` | Amazon numeric browse-node ID when Amazon exposes it. |
| `nodeKey` | Stable unique key for the node in this marketplace. |
| `name` | Category name in the marketplace's localized UI. |
| `englishName` | English name, only when `includeEnglishNames` is on and Amazon translates it. |
| `depth` | Levels below the run's start node (0 = start). |
| `taxonomyDepth` | Absolute depth from the marketplace root (0 = root department). |
| `path` | Full breadcrumb names, root first. |
| `breadcrumb` | Breadcrumb joined with `>`. |
| `pathSlugs` | URL path segments, root slug first. |
| `pathNodeIds` | Numeric node IDs known along the path. |
| `rootDepartment` | Top-level department name. |
| `rootSlug` | Top-level department slug. |
| `rootNodeId` | Top-level department browse-node ID when exposed. |
| `parentNodeId` | Parent node's numeric ID when known. |
| `parentName` | Parent category name. |
| `parentKey` | Parent `nodeKey`. |
| `childCount` | Direct children visible in the live navigation. |
| `isLeaf` | `true` when `childCount` is 0. |
| `chartUrls` | Best Sellers, New Releases, Most Wished For, Most Gifted and Movers & Shakers URLs. |
| `searchUrl` | Marketplace search URL for the node. |
| `searchAlias` | Department `i=` alias inherited from the root department. |
| `productCount` | Approximate product count, only with `includeProductCounts`. |
| `productCountText` | The exact result-bar text behind `productCount`. |
| `sourceUrl` | Amazon page the node was read from. |
| `scrapedAt` | UTC ISO timestamp. |

Empty fields are omitted from the row; there are no nulls.

### Examples

List the top departments of Amazon US:

```json
{
  "mode": "roots",
  "marketplaces": ["amazon.com"],
  "maxNodes": 10
}
```

Map Electronics two levels deep in Germany:

```json
{
  "mode": "department",
  "marketplaces": ["amazon.de"],
  "rootDepartments": ["Elektronik & Foto"],
  "maxDepth": 2,
  "maxNodes": 200
}
```

Map one node by ID in the United States:

```json
{
  "mode": "node",
  "marketplaces": ["amazon.com"],
  "nodeIds": ["172541"],
  "maxDepth": 1
}
```

The default daily run is the cheapest useful map: `roots` mode, `amazon.com`, three nodes, no extra lookups.

### Use cases

- **Seller and vendor tooling** — build a browse-node picker or validate that a listing is filed in the right category.
- **Advertising and catalog teams** — map an internal product taxonomy to Amazon's, per marketplace, with real node IDs.
- **Feed other scrapers** — take the chart or search URLs from this dataset and hand them to an Amazon product or bestsellers actor.
- **Market research** — compare category structures and department naming across countries.
- **Taxonomy monitoring** — run it on a schedule and diff the tree to see when Amazon adds, renames or removes categories.

### FAQ

**Does it need cookies or a login?** No. It loads public Amazon pages, lets Amazon's own browser challenge finish, and never asks you for credentials.

**Where do the node IDs come from?** From Amazon's category links and department navigation. A small number of top-level chart roots do not publish a numeric ID on their own page; those rows keep a stable `nodeKey` and omit `browseNodeId`. Every deeper node has its real numeric ID.

**Are product counts exact?** No. They are approximate and opt-in. Amazon only renders a result bar for some nodes; when it is missing the count is omitted rather than fabricated.

**Why is `englishName` missing on some rows?** English names are optional and only appear where Amazon actually serves an English version of that marketplace. Some locales (for example Poland, Turkey, Brazil and Mexico in our tests) keep localized names only.

**Is `isLeaf` permanent?** It reflects the live navigation at `scrapedAt`. Amazon can add children later, so re-run for a fresh map.

**How large can a map get?** A full marketplace is thousands of nodes. Use `maxDepth` and `maxNodes` to keep runs small; Amazon rate limits aggressive walks.

**What if a page is blocked?** The actor retries with a fresh browser session, skips the page if it stays blocked, and reports failed/blocked fetches in the run status message. It never writes placeholder categories.

# Actor input Schema

## `mode` (type: `string`):

What to map. `marketplace` walks every root department of each selected marketplace to `maxDepth`; `roots` lists only the root departments; `department` starts from the root departments named in `rootDepartments`; `node` starts from the IDs/URLs in `nodeIds`.

## `marketplaces` (type: `array`):

Amazon marketplaces to map. Each marketplace has its own taxonomy and localized department names. In `node` mode a full category URL sets its own marketplace.

## `rootDepartments` (type: `array`):

Limit `marketplace` or `department` mode to these top-level departments. Accepts department names (localized or English), bestsellers slugs, or department URLs. Empty means every root department.

## `nodeIds` (type: `array`):

Start nodes for `node` mode: numeric browse-node IDs, bestsellers/chart URLs, or slug paths such as `electronics/172541`. Each entry is mapped downward to `maxDepth`.

## `maxDepth` (type: `integer`):

How many child levels to follow below each start. 0 = only the start category (root departments in marketplace/department mode). Each deeper level costs one page per category.

## `maxNodes` (type: `integer`):

Hard cap on category rows saved in this run. The run stops cleanly at this limit.

## `includeChartUrls` (type: `boolean`):

Add Best Sellers, New Releases, Most Wished For, Most Gifted and Movers & Shakers URLs for every node.

## `includeSearchUrl` (type: `boolean`):

Add a marketplace search URL for every node, scoped to its browse node where possible.

## `includeSearchAlias` (type: `boolean`):

Add the department `search-alias` (the `i=` value) inherited from the root department, plus a search URL that uses it.

## `includeProductCounts` (type: `boolean`):

Fetch each node's search results bar for an approximate product count. Slower; Amazon does not render a count for every node, so missing counts are omitted rather than guessed.

## `maxProductCounts` (type: `integer`):

Cap on extra search-page fetches used for product counts when `includeProductCounts` is on.

## `includeEnglishNames` (type: `boolean`):

For non-English marketplaces, fetch each node's English page and add `englishName` when Amazon translates the category. Unsupported locales keep the localized name only.

## `resolveRootIds` (type: `boolean`):

Some top-level chart roots do not expose a numeric browse-node ID on their own page. When enabled, make one bounded search-page lookup per unresolved root to recover it.

## `maxRootIdLookups` (type: `integer`):

Cap on extra search-page fetches used to resolve missing root browse-node IDs.

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

Extra wait after each page load. A small delay keeps long taxonomy walks polite.

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

Apify proxy used to load Amazon pages. AUTO datacenter is used by default, pinned to the marketplace country; no proxy setup is needed.

## Actor input object example

```json
{
  "mode": "roots",
  "marketplaces": [
    "amazon.com"
  ],
  "rootDepartments": [],
  "nodeIds": [],
  "maxDepth": 0,
  "maxNodes": 3,
  "includeChartUrls": true,
  "includeSearchUrl": true,
  "includeSearchAlias": true,
  "includeProductCounts": false,
  "maxProductCounts": 0,
  "includeEnglishNames": false,
  "resolveRootIds": true,
  "maxRootIdLookups": 2,
  "requestDelayMs": 200,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `categories` (type: `string`):

Dataset containing one row per Amazon category node.

# 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 = {
    "mode": "roots",
    "marketplaces": [
        "amazon.com"
    ],
    "rootDepartments": [],
    "nodeIds": [],
    "maxDepth": 0,
    "maxNodes": 3,
    "includeChartUrls": true,
    "includeSearchUrl": true,
    "includeSearchAlias": true,
    "includeProductCounts": false,
    "maxProductCounts": 0,
    "includeEnglishNames": false,
    "resolveRootIds": true,
    "maxRootIdLookups": 2,
    "requestDelayMs": 200,
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("crawlyth-forge/amazon-category-tree-mapper").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 = {
    "mode": "roots",
    "marketplaces": ["amazon.com"],
    "rootDepartments": [],
    "nodeIds": [],
    "maxDepth": 0,
    "maxNodes": 3,
    "includeChartUrls": True,
    "includeSearchUrl": True,
    "includeSearchAlias": True,
    "includeProductCounts": False,
    "maxProductCounts": 0,
    "includeEnglishNames": False,
    "resolveRootIds": True,
    "maxRootIdLookups": 2,
    "requestDelayMs": 200,
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("crawlyth-forge/amazon-category-tree-mapper").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 '{
  "mode": "roots",
  "marketplaces": [
    "amazon.com"
  ],
  "rootDepartments": [],
  "nodeIds": [],
  "maxDepth": 0,
  "maxNodes": 3,
  "includeChartUrls": true,
  "includeSearchUrl": true,
  "includeSearchAlias": true,
  "includeProductCounts": false,
  "maxProductCounts": 0,
  "includeEnglishNames": false,
  "resolveRootIds": true,
  "maxRootIdLookups": 2,
  "requestDelayMs": 200,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call crawlyth-forge/amazon-category-tree-mapper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,crawlyth-forge/amazon-category-tree-mapper"
        }
    }
}
```

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/DjaKnYfaaJc7Sth6E/builds/xh0UrFbhpYnRMvhgN/openapi.json
