# BarnesAndNoble.com Scraper (Pay Per Result) (`123webdata/barnesandnoble-scraper`) Actor

A scraper for Barnes & Noble to extract book and product data from both individual product URLs and category pages. Good for AI training, pricing, analytics, integrations. Results in JSON, CSV, XLSX etc.

Pricing: $0.005/result. 10 results on free plan.

- **URL**: https://apify.com/123webdata/barnesandnoble-scraper.md
- **Developed by:** [Milán Vásárhelyi](https://apify.com/123webdata) (community)
- **Categories:** E-commerce, AI, Integrations
- **Stats:** 17 total users, 0 monthly users, 89.7% runs succeeded, 1 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

$5.00 / 1,000 books

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/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — 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 Scraper

This actor scrapes book and product data from [Barnes & Noble](https://www.barnesandnoble.com/), a leading retailer of books and digital media.

### Issues and feature requests

If you encounter any issue, or you'd like us to change or add anything, please open an issue in the actor page or write to us directly at hello@123webdata.com

### Output Example (simplified)

The actor provides a convenient overview mode that displays the most important book information in a tabular format. Here's an example of how the data looks in the overview mode:

| Image | Product URL | Product Name | Current Price | Regular Price | Currency | Description | Scraped At |
|-------|-------|-------|-------|-------|-------|-------|-------|
| <img src="https://prodimage.images-bn.com/pimages/9780316565103_p0_v1_s600x595.jpg" style="max-width: 100px; max-height: 100px; object-fit: contain;"> | https://www.barnesandnoble.com/w/the-first-gentleman-james-patterson/1146664728 | The First Gentleman: A Thri... | 22.40 | 32 | USD | Notes From Your Bookseller ... | 2025-07-21 |
|  | https://www.barnesandnoble.com/noresults/the-running-grave-robert-galbraith/1144250924 | BN No Results Page | 0.00 | 0 |  |  | 2025-07-21 |
| <img src="https://prodimage.images-bn.com/pimages/9781368102988_p0_v3_s600x595.jpg" style="max-width: 100px; max-height: 100px; object-fit: contain;"> | https://www.barnesandnoble.com/w/murder-by-cheesecake-rachel-ekstrom-courage/1146010256?ean=9781368102988 | Murder by Cheesecake: A Gol... | 16.99 | 16.99 | USD | Notes From Your Bookseller ... | 2025-07-21 |

### Features

- Scrapes detailed book and product information from Barnes & Noble pages
- Extracts data from both individual product URLs and category pages
- Follows pagination links on category pages with custom pagination logic (optional)
- Preserves all URL parameters like 'Nrpp' (items per page) and 'Ns' (sorting)
- Captures book-specific information such as ISBN, authors, publisher, and publication date

### Input

The actor accepts the following input parameters:

| Field | Type | Description |
|-------|------|-------------|
| `productUrls` | array | List of Barnes & Noble product URLs to scrape |
| `categoryUrls` | array | List of Barnes & Noble category URLs to scrape |
| `maxResultsPerScrape` | integer | Maximum number of results to extract (default: 1000) |
| `usePagination` | boolean | Whether to follow pagination links on category pages (default: true) |

### Output Example (full)

The actor outputs data in the following structure:

```json
{
	"url": "https://www.barnesandnoble.com/w/the-first-gentleman-james-patterson/1146664728",
	"name": "The First Gentleman: A Thriller",
	"price": 22.4,
	"regular_price": 32,
	"currency": "USD",
	"in_stock": true,
	"sku": "0316565105",
	"mpn": null,
	"gtin": "9780316565103",
	"brand": "Little, Brown and Company",
	"breadcrumbs": [
		"Home",
		"1",
		"Books",
		"2"
	],
	"main_image": "https://prodimage.images-bn.com/pimages/9780316565103_p0_v1_s600x595.jpg",
	"images": [
		"https://prodimage.images-bn.com/pimages/9780316565103_p0_v1_s600x595.jpg"
	],
	"description": "Notes From Your Bookseller\n\nThere’s a killer at large and all eyes are looking to the White House. With unrelenting tension, political intrigue and insight into the presidency you can only get from a former commander-in-chief, The First Gentleman is a thrilling, action-packed ride.\n\nInstant New York Times Bestseller!\n“Bill Clinton reveals key White House details in murderous new political thriller… It's a twisty thriller with plenty of inside jobs, political sabotage and many, many deaths.” – USA Today\n\nAmerica has a powerful new president... And her husband's on trial for murder.\nClinton and Patterson are back. And they’re better than ever.\nThe President of the United States is up for reelection.\nHer husband is on trial for murder.\nIs the First Gentleman a killer?\nA pair of brilliant investigative journalists set out to answer that burning question about the NFL star-turned-political spouse.\nThe First Gentleman has all the twists and turns, and the authenticity, one expects from the #1 bestselling authors of The President Is Missing and The President’s Daughter.",
	"color": null,
	"size": "6.30(w) x 9.20(h) x 1.70(d)",
	"material": null,
	"style": null,
	"features": [],
	"attributes": {
		"isbn-13": "9780316565103",
		"publisher": "Little, Brown and Company",
		"publication date": "06/02/2025",
		"pages": "480",
		"product dimensions": "6.30(w) x 9.20(h) x 1.70(d)",
		"hometown": "Palm Beach, Florida",
		"date of birth": "March 22, 1947",
		"place of birth": "Newburgh, New York",
		"education": "B.A., Manhattan College, 1969; M.A., Vanderbilt University, 1971",
		"website": "http://www.jamespatterson.com/"
	},
	"rating_value": null,
	"review_count": null,
	"canonical_url": "https://www.barnesandnoble.com/w/the-first-gentleman-james-patterson/1146664728",
	"scraped_at": "2025-07-21T12:10:50.339Z"
}
```

# Actor input Schema

## `productUrls` (type: `array`):

List of Barnes & Noble product URLs to scrape.

## `categoryUrls` (type: `array`):

List of Barnes & Noble category URLs to scrape. The scraper will extract all product URLs from these pages.

## `maxResultsPerScrape` (type: `integer`):

Maximum number of results to extract. Default is 20.

## `usePagination` (type: `boolean`):

Whether to follow pagination links on category pages.

## Actor input object example

```json
{
  "productUrls": [
    "https://www.barnesandnoble.com/w/the-first-gentleman-james-patterson/1146664728"
  ],
  "categoryUrls": [
    "https://www.barnesandnoble.com/b/books/mystery-thrillers/_/N-1fZ29Z8q8Z16g4?Ns=P_Sales_Rank"
  ],
  "maxResultsPerScrape": 20,
  "usePagination": true
}
```

# 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 = {
    "productUrls": [
        "https://www.barnesandnoble.com/w/the-first-gentleman-james-patterson/1146664728"
    ],
    "categoryUrls": [
        "https://www.barnesandnoble.com/b/books/mystery-thrillers/_/N-1fZ29Z8q8Z16g4?Ns=P_Sales_Rank"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("123webdata/barnesandnoble-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 = {
    "productUrls": ["https://www.barnesandnoble.com/w/the-first-gentleman-james-patterson/1146664728"],
    "categoryUrls": ["https://www.barnesandnoble.com/b/books/mystery-thrillers/_/N-1fZ29Z8q8Z16g4?Ns=P_Sales_Rank"],
}

# Run the Actor and wait for it to finish
run = client.actor("123webdata/barnesandnoble-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 '{
  "productUrls": [
    "https://www.barnesandnoble.com/w/the-first-gentleman-james-patterson/1146664728"
  ],
  "categoryUrls": [
    "https://www.barnesandnoble.com/b/books/mystery-thrillers/_/N-1fZ29Z8q8Z16g4?Ns=P_Sales_Rank"
  ]
}' |
apify call 123webdata/barnesandnoble-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,123webdata/barnesandnoble-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/7D9eymDurmkMFj83h/builds/NlPjWBS0AL8epTm5O/openapi.json
