# Barnes & Noble Intelligence Scraper (`lokki/barnes-noble-intelligence-scraper`) Actor

Scrape Barnes & Noble search, category, and product pages with pagination. Extract book/product metadata, pricing, ratings, availability, and commerce intelligence signals.

- **URL**: https://apify.com/lokki/barnes-noble-intelligence-scraper.md
- **Developed by:** [Ian Dikhtiar](https://apify.com/lokki) (community)
- **Categories:** E-commerce, Other, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## Barnes & Noble Intelligence Scraper

Scrape Barnes & Noble catalog data with pagination-aware discovery, book metadata, product URLs, ratings/prices when page access allows them, and commerce intelligence.

This actor is built for publishing, retail analytics, book-market research, catalog enrichment, and product URL discovery. It uses structured data when Barnes & Noble pages are accessible, falls back to visible product cards, follows pagination, and includes a public sitemap fallback so protected pages do not turn into empty runs.

### What It Extracts

- Product title and URL
- Author / contributor
- ISBN-13, ISBN-10, UPC, SKU when available
- Format, publisher, and publication date
- Price, list price, currency, discount percent
- Availability / stock text
- Rating and review count
- Image URL
- Product description / overview
- Search rank and source query
- Buyer signals and an intelligence score

### Intelligence Fields

Every row is enriched with:

- discountPercent: detected markdown from list price to current price
- intelligenceScore: 0-100 score based on metadata completeness, price, availability, rating, and reviews
- buyerSignals: tags such as high-rated, review-heavy, discounted, preorder, availability-risk, and book-format-detected
- opportunitySummary: compact readable summary for dashboards or alerts

The actor also writes SUMMARY and OUTPUT key-value-store records with product count, price stats, format breakdown, availability breakdown, top authors, best enriched rows, and warnings.

### Pagination

Pagination is enabled by default. The actor discovers next-page links from search/category pages and respects maxPages so runs remain predictable.

For broad market snapshots, increase maxItems and maxPages. Increase requestDelayMs if the site starts pushing back.

### Input

- queries: Barnes & Noble search terms, for example atomic habits, romantasy paperback, manga box set
- startUrls: search, category, or product URLs from barnesandnoble.com
- maxItems: maximum unique products to save
- maxPages: maximum pages to visit across search/category/detail/pagination requests
- includeProductDetails: opens detail pages for richer metadata
- includePagination: follows next-page links
- minIntelligenceScore: optional post-filter
- requestDelayMs: delay between requests
- useSitemapFallback: returns matching products from the public Barnes & Noble product sitemap when search/product pages are blocked
- maxSitemapFiles: maximum sitemap files to scan in fallback mode
- proxyConfiguration: Apify proxy configuration

Example:

{
  "queries": ["atomic habits", "manga box set"],
  "maxItems": 100,
  "maxPages": 10,
  "includeProductDetails": true,
  "includePagination": true,
  "useSitemapFallback": true
}

### Output Example

{
  "title": "Atomic Habits",
  "author": "James Clear",
  "isbn13": "9780735211292",
  "price": 16.99,
  "currency": "USD",
  "availability": "InStock",
  "rating": 4.8,
  "reviewCount": 12345,
  "url": "https://www.barnesandnoble.com/w/atomic-habits-james-clear/1129201155",
  "discountPercent": 0,
  "intelligenceScore": 86,
  "buyerSignals": ["high-rated", "review-heavy"],
  "opportunitySummary": "by James Clear | $16.99 | 4.8 rating | high-rated, review-heavy"
}

### Reliability Notes

Barnes & Noble is protected by Akamai and can deny search, category, and product HTML. This actor includes a browser fallback and a sitemap fallback. Sitemap fallback rows prioritize reliable product discovery and usually include title, inferred author, Barnes & Noble product URL, SKU, last modified date, and intelligence fields; live price/rating/availability require page access.

For best reliability:

- Keep includeProductDetails on for smaller, richer runs
- Increase requestDelayMs for large catalog runs
- Use Apify Residential Proxy
- Keep sitemap fallback enabled for smoke tests and QA runs
- Keep maxPages bounded

# Actor input Schema

## `queries` (type: `array`):

Book or product searches, such as atomic habits, romantasy paperback, manga box set, or lego.
## `startUrls` (type: `array`):

Optional Barnes & Noble search, category, or product URLs.
## `maxItems` (type: `integer`):

Maximum unique products to save. Default is smoke-test friendly; increase for deeper catalog runs.
## `maxPages` (type: `integer`):

Maximum search/category pages to visit across all inputs.
## `includeProductDetails` (type: `boolean`):

Open product detail pages from search results for richer descriptions, ISBNs, publishers, formats, and availability. Slower but better.
## `includePagination` (type: `boolean`):

Follow next-page links from search/category pages.
## `useSitemapFallback` (type: `boolean`):

When Barnes & Noble blocks search or product HTML, fall back to the public product sitemap so runs still return real Barnes & Noble product URLs.
## `maxSitemapFiles` (type: `integer`):

Maximum Barnes & Noble product sitemap files to scan when fallback mode is needed. Increase for broader keyword coverage.
## `minIntelligenceScore` (type: `integer`):

Optional post-filter from 0 to 100. Use 60+ to keep only rows with stronger metadata and commerce signals.
## `requestDelayMs` (type: `integer`):

Delay between page requests. Increase this for larger runs or if Barnes & Noble starts throttling.
## `proxyConfiguration` (type: `object`):

Barnes & Noble can block datacenter traffic. Apify Residential Proxy is recommended for cloud runs.

## Actor input object example

```json
{
  "queries": [
    "atomic habits"
  ],
  "maxItems": 25,
  "maxPages": 2,
  "includeProductDetails": true,
  "includePagination": true,
  "useSitemapFallback": true,
  "maxSitemapFiles": 2,
  "requestDelayMs": 750,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "groups": [
      "RESIDENTIAL"
    ],
    "countryCode": "US"
  }
}
````

# Actor output Schema

## `items` (type: `string`):

Default dataset containing one Barnes & Noble product/book row per item.

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

Console dataset view for extracted products, metadata, prices, ratings, and intelligence fields.

## `summary` (type: `string`):

Machine-readable SUMMARY record containing product counts, price stats, format breakdowns, availability breakdowns, top authors, best rows, and warnings.

# 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 = {
    "queries": [
        "atomic habits"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("lokki/barnes-noble-intelligence-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 = { "queries": ["atomic habits"] }

# Run the Actor and wait for it to finish
run = client.actor("lokki/barnes-noble-intelligence-scraper").call(run_input=run_input)

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

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

```

## CLI example

```bash
echo '{
  "queries": [
    "atomic habits"
  ]
}' |
apify call lokki/barnes-noble-intelligence-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=lokki/barnes-noble-intelligence-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Barnes & Noble Intelligence Scraper",
        "description": "Scrape Barnes & Noble search, category, and product pages with pagination. Extract book/product metadata, pricing, ratings, availability, and commerce intelligence signals.",
        "version": "1.0",
        "x-build-id": "f5uROHzz2tAlBljF3"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/lokki~barnes-noble-intelligence-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-lokki-barnes-noble-intelligence-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/lokki~barnes-noble-intelligence-scraper/runs": {
            "post": {
                "operationId": "runs-sync-lokki-barnes-noble-intelligence-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/lokki~barnes-noble-intelligence-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-lokki-barnes-noble-intelligence-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "queries": {
                        "title": "Search queries",
                        "type": "array",
                        "description": "Book or product searches, such as atomic habits, romantasy paperback, manga box set, or lego.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "startUrls": {
                        "title": "Barnes & Noble URLs",
                        "type": "array",
                        "description": "Optional Barnes & Noble search, category, or product URLs.",
                        "items": {
                            "type": "object",
                            "required": [
                                "url"
                            ],
                            "properties": {
                                "url": {
                                    "type": "string",
                                    "title": "URL of a web page",
                                    "format": "uri"
                                }
                            }
                        }
                    },
                    "maxItems": {
                        "title": "Maximum products",
                        "minimum": 1,
                        "maximum": 10000,
                        "type": "integer",
                        "description": "Maximum unique products to save. Default is smoke-test friendly; increase for deeper catalog runs.",
                        "default": 25
                    },
                    "maxPages": {
                        "title": "Maximum pages",
                        "minimum": 1,
                        "maximum": 500,
                        "type": "integer",
                        "description": "Maximum search/category pages to visit across all inputs.",
                        "default": 2
                    },
                    "includeProductDetails": {
                        "title": "Open product detail pages",
                        "type": "boolean",
                        "description": "Open product detail pages from search results for richer descriptions, ISBNs, publishers, formats, and availability. Slower but better.",
                        "default": true
                    },
                    "includePagination": {
                        "title": "Follow pagination",
                        "type": "boolean",
                        "description": "Follow next-page links from search/category pages.",
                        "default": true
                    },
                    "useSitemapFallback": {
                        "title": "Use sitemap fallback",
                        "type": "boolean",
                        "description": "When Barnes & Noble blocks search or product HTML, fall back to the public product sitemap so runs still return real Barnes & Noble product URLs.",
                        "default": true
                    },
                    "maxSitemapFiles": {
                        "title": "Maximum sitemap files",
                        "minimum": 1,
                        "maximum": 50,
                        "type": "integer",
                        "description": "Maximum Barnes & Noble product sitemap files to scan when fallback mode is needed. Increase for broader keyword coverage.",
                        "default": 2
                    },
                    "minIntelligenceScore": {
                        "title": "Minimum intelligence score",
                        "minimum": 0,
                        "maximum": 100,
                        "type": "integer",
                        "description": "Optional post-filter from 0 to 100. Use 60+ to keep only rows with stronger metadata and commerce signals."
                    },
                    "requestDelayMs": {
                        "title": "Delay between requests",
                        "minimum": 0,
                        "maximum": 10000,
                        "type": "integer",
                        "description": "Delay between page requests. Increase this for larger runs or if Barnes & Noble starts throttling.",
                        "default": 750
                    },
                    "proxyConfiguration": {
                        "title": "Proxy settings",
                        "type": "object",
                        "description": "Barnes & Noble can block datacenter traffic. Apify Residential Proxy is recommended for cloud runs.",
                        "default": {
                            "useApifyProxy": true,
                            "groups": [
                                "RESIDENTIAL"
                            ],
                            "countryCode": "US"
                        }
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
