# Textbook Arbitrage (`vaunted/textbook-arbitrage`) Actor

Find profitable textbook flips in seconds! This Actor compares AbeBooks prices with BookScouter buyback offers to uncover arbitrage opportunities. Includes strict condition filtering and top-3 results per ISBN.

- **URL**: https://apify.com/vaunted/textbook-arbitrage.md
- **Developed by:** [Sage](https://apify.com/vaunted) (community)
- **Categories:** E-commerce, Lead generation, Other
- **Stats:** 8 total users, 0 monthly users, 100.0% runs succeeded, 2 bookmarks
- **User rating**: No ratings yet

## Pricing

from $100.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 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

## Textbook Arbitrage Actor

Find profitable textbook flip opportunities by comparing **AbeBooks** and **ThriftBooks** prices with **BookScouter** buyback offers from 30+ vendors.

### ⚡ Fast & Efficient

- Process hundreds of ISBNs in minutes
- Sub-second price lookups per source
- Smart filtering saves time by checking buyback value first

**Real results:** 5 ISBNs → 6 profitable opportunities with up to **628% ROI**

### 🎯 What It Does

1. **Checks buyback prices** from 30+ vendors (BooksRun, Chegg, TextbookRush, etc.)
2. **Finds cheap copies** on AbeBooks and ThriftBooks
3. **Calculates profit** including shipping costs
4. **Filters by condition** (only "Good" or better)
5. **Returns top opportunities** sorted by profit

### 📥 Input

```json
{
    "isbns": ["9780321982384", "9780134093413"],
    "minProfit": 10,
    "minBuyback": 5,
    "maxResultsPerIsbn": 3
}
```

| Field | Type | Default | Description |
|-------|------|---------|-------------|
| `isbns` | array | required | List of ISBN-10 or ISBN-13 codes |
| `minProfit` | number | 10 | Minimum profit in USD to include |
| `minBuyback` | number | 5 | Minimum buyback price to search sources |
| `maxResultsPerIsbn` | integer | 3 | Top N opportunities per ISBN |

### 📤 Output

Each result in the dataset:

```json
{
    "isbn": "9780321982384",
    "bookTitle": "Linear Algebra and Its Applications",
    "rank": 1,
    "source": {
        "site": "ThriftBooks",
        "price": 5.99,
        "shipping": 3.99,
        "totalCost": 9.98,
        "condition": "Good",
        "sellerName": "ThriftBooks",
        "sellerRating": "98%",
        "url": "https://www.thriftbooks.com/..."
    },
    "buyback": {
        "site": "BookScouter",
        "vendor": "Chegg",
        "price": 35.00,
        "url": "https://bookscouter.com/sell/..."
    },
    "profit": 25.02,
    "roiPercentage": "250.7%",
    "timestamp": "2025-12-12T10:00:00Z"
}
```

### 📈 Example Results

From a test batch (ISBN `9780134753119` - "A First Course in Probability"):

| Source | Buy | Sell To | Profit | ROI |
|--------|-----|---------|--------|-----|
| ThriftBooks | $9.48 | BooksRun $69.01 | **$59.53** | **628%** |
| AbeBooks | $23.31 | BooksRun $69.01 | $45.70 | 196% |
| AbeBooks | $32.88 | BooksRun $69.01 | $36.13 | 110% |

### ⚙️ Configuration Tips

#### Find More Opportunities

```json
{
    "minProfit": 5,
    "minBuyback": 3,
    "maxResultsPerIsbn": 5
}
```

#### High-Value Only

```json
{
    "minProfit": 25,
    "minBuyback": 10,
    "maxResultsPerIsbn": 1
}
```

### 💡 Tips

- **Most books (~95%) have $0 buyback** - Focus on textbooks, not novels
- **Buyback quotes expire in 7 days** - Act fast on opportunities
- **Condition matters** - Only "Good" or better conditions are accepted by buyback vendors
- **US sellers preferred** - Ensures delivery within quote window

### 🐛 Troubleshooting

#### No Results Found

Most books have no buyback value. Try:

- Lowering `minBuyback` to 3
- Lowering `minProfit` to 5
- Using textbook ISBNs (not fiction/general books)

#### Missing a Source

Some ISBNs may not have listings on all sites. The actor searches all available sources and returns what it finds.

# Actor input Schema

## `isbns` (type: `array`):

List of ISBN-13 or ISBN-10 codes to search for arbitrage opportunities

## `minProfit` (type: `number`):

Only save results where potential profit exceeds this amount in USD

## `minBuyback` (type: `number`):

Only check AbeBooks if BookScouter buyback exceeds this amount (saves proxy costs)

## `maxResultsPerIsbn` (type: `integer`):

Number of top opportunities to save per ISBN (sorted by profit)

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

RESIDENTIAL proxies are REQUIRED for BookScouter. Datacenter IPs will be blocked.

## Actor input object example

```json
{
  "isbns": [
    "9780321982384"
  ],
  "minProfit": 10,
  "minBuyback": 5,
  "maxResultsPerIsbn": 3,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# 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 = {
    "isbns": [
        "9780321982384"
    ],
    "minProfit": 10,
    "minBuyback": 5,
    "maxResultsPerIsbn": 3,
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("vaunted/textbook-arbitrage").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 = {
    "isbns": ["9780321982384"],
    "minProfit": 10,
    "minBuyback": 5,
    "maxResultsPerIsbn": 3,
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("vaunted/textbook-arbitrage").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 '{
  "isbns": [
    "9780321982384"
  ],
  "minProfit": 10,
  "minBuyback": 5,
  "maxResultsPerIsbn": 3,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call vaunted/textbook-arbitrage --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=vaunted/textbook-arbitrage",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/mVbq3fSp1E5Q1tjkg/builds/75eoEwbLWY3rOfARl/openapi.json
