# Courtyard Scraper (`mrdoe/courtyard-scraper`) Actor

Scrape Courtyard.io's graded trading card and collectible marketplace: listing title, price, fair market value, and deal percentage, by search keyword.

- **URL**: https://apify.com/mrdoe/courtyard-scraper.md
- **Developed by:** [MrDoe](https://apify.com/mrdoe) (community)
- **Categories:** E-commerce
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 listing founds

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?

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

### What it does

Courtyard Scraper reads Courtyard.io's public marketplace for vaulted, professionally-graded trading cards and collectibles (PSA, CGC, and others). For any search keyword - or the site's own default "Recently listed" feed - it returns each listing's title, asking price, Courtyard's fair market value (FMV) estimate, and how far the price sits above or below that FMV. No account needed.

### Why use it

- **Live marketplace data** - every run reads the current listings for your keyword.
- **Deal signal built in** - `percentBelowFmv` tells you at a glance whether a listing is priced below fair value (a deal) or above it, computed from Courtyard's own FMV estimate.
- **No login required** - reads only what's already public on Courtyard's marketplace.
- **Good fit for monitoring** - run it on a schedule for the cards/sets you track to catch underpriced listings as they appear.

### How to use

1. Open the Actor and go to the **Input** tab.
2. Add one or more **Search queries** - card names, sets, or grades, e.g. `"charizard"` or `"psa 10"`. Leave this empty to scrape the default "Recently listed" feed instead.
3. Set **Max listings per query** if you want more or fewer than 48.
4. Click **Start**.
5. Open the **Output** tab, then download the dataset or connect it to your tools.

### Input Parameters

| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| `searchQueries` | array | No | - | Keywords to search Courtyard's marketplace for, e.g. `"charizard"`. Leave empty for the default "Recently listed" feed. |
| `maxItemsPerQuery` | integer | No | `48` | Maximum number of listings to return per search query (or for the default feed). |
| `proxyConfiguration` | object | No | Apify Proxy | Proxy to use for the scrape. |

### Output Data

One dataset row per listing. A real row from a live run:

```json
{
    "objectId": "efc65b3a2f8730ae0e17ff68e654653ef931e31a8ac3c97660a28dfdeb73999d",
    "title": "2025 Pokémon Pfl EN-Phantasmal Flames #109 Mega Charizard X EX - Holo Ultra Rare (PSA 10 GEM MINT)",
    "url": "https://courtyard.io/asset/efc65b3a2f8730ae0e17ff68e654653ef931e31a8ac3c97660a28dfdeb73999d",
    "listingPriceUsd": 99,
    "fmvUsd": 100.6,
    "percentBelowFmv": 2,
    "listedAgo": "3m ago",
    "imageUrl": "https://static.courtyard.io/graded-cards-renders/PSA%20149644311/render_front.w600.webp",
    "searchQuery": "charizard"
}
```

#### Field reference

| Field | Type | Description |
|---|---|---|
| `objectId` | string | Courtyard's internal listing identifier. |
| `title` / `url` | string | The listing's title (includes year, set, card number, and grade) and its Courtyard URL. |
| `listingPriceUsd` | number | The current asking price, in USD. |
| `fmvUsd` | number | Courtyard's fair market value estimate for this exact graded item, in USD. |
| `percentBelowFmv` | number | How far below (positive) or above (negative) `fmvUsd` the listing is priced. A higher positive number is a better deal. |
| `listedAgo` | string | How long ago the listing was created, exactly as Courtyard shows it (e.g. `"3m ago"`). |
| `imageUrl` | string | The card/item's render image. |
| `searchQuery` | string | Which of your input search queries produced this row. `null` for the default feed. |

### Exporting to CSV / Excel

Open the dataset in the Console's Storage tab and use **Export** to download as CSV, Excel, JSON, XML, or RSS - or fetch a specific format directly via the Dataset API (`?format=csv`, `?format=xlsx`, etc.).

### Limitations

- **Marketplace listings only.** This Actor reads Courtyard's marketplace search results - it doesn't open each listing's own detail page, so fields only shown there (full attribute list, ownership/vault history) aren't included.
- **No facet filters.** Courtyard's own category/grader/set filter checkboxes aren't exposed as inputs here - run a more specific keyword instead for a narrower result set.

### FAQ

**Do I need a Courtyard account?** No - this reads Courtyard's own public marketplace.

**Can I search multiple keywords in one run?** Yes - add as many entries to `searchQueries` as you want; each gets its own search.

**Why is `percentBelowFmv` negative?** That listing is priced above Courtyard's fair market value estimate - not necessarily a bad listing, just not a discount.

**Does this place bids or purchase anything?** No. This Actor only collects publicly visible listing information.

### Running the tests

```bash
npm install
npm test
```

# Actor input Schema

## `searchQueries` (type: `array`):

Keywords to search Courtyard's marketplace for, e.g. "charizard" or "psa 10". Leave empty to scrape the default "Recently listed" feed instead.

## `maxItemsPerQuery` (type: `integer`):

Maximum number of listings to return for each search query (or for the default feed if no queries are given). Results come in pages of 48.

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

Proxy settings. Apify Proxy is enabled by default.

## Actor input object example

```json
{
  "searchQueries": [],
  "maxItemsPerQuery": 48,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `overview` (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 = {
    "searchQueries": []
};

// Run the Actor and wait for it to finish
const run = await client.actor("mrdoe/courtyard-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 = { "searchQueries": [] }

# Run the Actor and wait for it to finish
run = client.actor("mrdoe/courtyard-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 '{
  "searchQueries": []
}' |
apify call mrdoe/courtyard-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,mrdoe/courtyard-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/gbqRpHDh9F3CCFvhE/builds/sxhsdrooCngZjLEko/openapi.json
