# PSA Card Grade Population Lookup (`dataspryva/psa-card-grade-population-lookup`) Actor

Look up PSA grading population counts for trading cards: search by keyword, fetch by spec number, browse a set, or see recently graded cards, each with grade 1-10 counts and total graded.

- **URL**: https://apify.com/dataspryva/psa-card-grade-population-lookup.md
- **Developed by:** [Dataspryva](https://apify.com/dataspryva) (community)
- **Categories:** E-commerce, Automation, Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.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/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

## PSA Card Grade Population Lookup

PSA's population report tells you how many copies of a card exist at each grade. This actor turns that report into clean records: search a player or set, pull a whole set's census, or pick out specific spec numbers. Every row carries the card identity, the grade 1–10 ladder, half grades, qualifiers, total graded and gem rate.

No PSA account, API key or cookie is needed.

### Modes

| Mode | What it does | Main inputs |
|---|---|---|
| `searchCards` | Searches PSA's population report by keyword. Exact matches come back with full grade counts; other matching sets are enriched with their matching cards. | `query`, `category`, filters |
| `setPopulation` | Returns every card in a set, with pagination and an optional set-wide total row. | `setUrls` or `headingIds`, `includeSetTotal`, filters |
| `cardPopulation` | Finds specific spec numbers inside a set. | `specNumbers` plus a set URL or heading ID |

### Examples

Search for a card:

```json
{
  "mode": "searchCards",
  "query": "1952 Topps Mickey Mantle",
  "maxItems": 5
}
```

Pull a set census with the set total:

```json
{
  "mode": "setPopulation",
  "setUrls": ["https://www.psacard.com/pop/baseball-cards/1933/goudey/39868"],
  "includeSetTotal": true,
  "maxItems": 500
}
```

Find a specific spec number:

```json
{
  "mode": "cardPopulation",
  "setUrls": ["https://www.psacard.com/pop/baseball-cards/1952/topps/49722"],
  "specNumbers": ["178927"]
}
```

### Output

Each card record includes:

- `specId` and `specNumber` — PSA's spec identifier
- `subject`, `cardName`, `description`, `cardNumber`, `variety`
- `setName`, `setYear`, `setCategory`, `headingId`, `categoryId`
- `grade1Count` through `grade10Count`
- `grade1_5Count` through `grade9_5Count`
- `grade1QualifiedCount` through `grade10QualifiedCount`
- `authenticCount`
- `gradeTotal`, `halfGradeTotal`, `qualifiedTotal`, `popTotal`
- `totalGraded` and `gemRate` (PSA 10 share of all graded copies)
- `pop` — the complete nested ladder
- `popUrl`, `recordType`, `scrapedAt`

Set-total rows use `recordType: "setTotal"`. If a lookup cannot be completed, the actor emits an `error` row with a reason instead of a blank record.

### Filters

- `category` — one of 21 collectible categories, or All
- `subjectContains` / `varietyContains` — case-insensitive text filters
- `minTotal` / `maxTotal` — total graded bounds
- `minGrade10` / `maxGrade10` — PSA 10 population bounds
- `isPsaDna` — use the PSA/DNA certified population line
- `includeSetTotal` — add a set-wide census row in `setPopulation`

### Limits and pacing

- `maxItems` caps the dataset (1–5000).
- `maxSearchPages` caps keyword-search pages.
- `maxEnrichSets` caps how many matching sets are fetched in `searchCards`.
- `maxSetPages` caps 500-card pages walked for spec-number lookup.
- `requestDelaySecs` defaults to 0.8 seconds to stay inside PSA's request limits.

### Notes

- The population pages themselves ask for a Collectors login, so the actor reads PSA's public population JSON used by the report table.
- PSA rate-limits bursts. Lower `maxItems` or raise `requestDelaySecs` if a run reports repeated retries.
- `recentGrades` was removed because PSA does not expose a public recently-graded feed. Older saved tasks using that value receive a clear status message.
- A bare `headingId` returns correct population counts but cannot supply the set name/year; use `setUrls` when you need set metadata.
- Output is omit-empty: fields the source does not publish are left out, never sent as `null` or an empty string.

### Data source

Population data comes from PSA's public population-report JSON endpoints at `psacard.com`. This actor is unofficial and is not affiliated with PSA or Collectors.

# Actor input Schema

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

Search cards by keyword, fetch a full set population report, or look up specific spec numbers.

## `query` (type: `string`):

Player, card, set or year to search, for example "1952 Topps Mickey Mantle" or "Charizard".

## `setUrls` (type: `array`):

PSA population set links, for example https://www.psacard.com/pop/baseball-cards/1952/topps/49722. Used by setPopulation and as the set context for cardPopulation.

## `headingIds` (type: `array`):

Numeric PSA set IDs from a population URL's last path segment. Use when you already store set IDs.

## `specNumbers` (type: `array`):

PSA spec IDs to pick out of the supplied set (mode=cardPopulation). Also accepts comma-separated values.

## `category` (type: `string`):

Limit search results and label records with the collectible category. Choose All to search every category.

## `subjectContains` (type: `string`):

Keep only cards whose player, character or subject contains this text.

## `varietyContains` (type: `string`):

Keep only cards whose variety, parallel or pedigree contains this text.

## `minTotal` (type: `integer`):

Keep cards with at least this many graded copies.

## `maxTotal` (type: `integer`):

Keep cards with at most this many graded copies.

## `minGrade10` (type: `integer`):

Keep cards with at least this many PSA 10 copies.

## `maxGrade10` (type: `integer`):

Keep cards with at most this many PSA 10 copies.

## `isPsaDna` (type: `boolean`):

Use the PSA/DNA certified population line instead of the standard card population.

## `includeSetTotal` (type: `boolean`):

Emit one extra row with the set-wide grade census (mode=setPopulation).

## `maxItems` (type: `integer`):

Stop after this many records.

## `maxSearchPages` (type: `integer`):

Maximum keyword-search pages to walk when matching sets need population enrichment.

## `maxEnrichSets` (type: `integer`):

Maximum matching sets to fetch when keyword results need population counts (mode=searchCards).

## `maxSetPages` (type: `integer`):

Maximum 500-card pages to walk per set when resolving spec numbers.

## `requestDelaySecs` (type: `number`):

Pause between PSA requests to stay inside its rate limits.

## Actor input object example

```json
{
  "mode": "searchCards",
  "query": "1952 Topps Mickey Mantle",
  "setUrls": [],
  "headingIds": [],
  "specNumbers": [],
  "category": "all",
  "isPsaDna": false,
  "includeSetTotal": false,
  "maxItems": 3,
  "maxSearchPages": 5,
  "maxEnrichSets": 10,
  "maxSetPages": 20,
  "requestDelaySecs": 0.8
}
```

# Actor output Schema

## `results` (type: `string`):

Dataset containing card population, set total, and error records.

# 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": "searchCards",
    "query": "1952 Topps Mickey Mantle",
    "setUrls": [],
    "headingIds": [],
    "specNumbers": [],
    "category": "all",
    "isPsaDna": false,
    "includeSetTotal": false,
    "maxItems": 3,
    "maxSearchPages": 5,
    "maxEnrichSets": 10,
    "maxSetPages": 20,
    "requestDelaySecs": 0.8
};

// Run the Actor and wait for it to finish
const run = await client.actor("dataspryva/psa-card-grade-population-lookup").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": "searchCards",
    "query": "1952 Topps Mickey Mantle",
    "setUrls": [],
    "headingIds": [],
    "specNumbers": [],
    "category": "all",
    "isPsaDna": False,
    "includeSetTotal": False,
    "maxItems": 3,
    "maxSearchPages": 5,
    "maxEnrichSets": 10,
    "maxSetPages": 20,
    "requestDelaySecs": 0.8,
}

# Run the Actor and wait for it to finish
run = client.actor("dataspryva/psa-card-grade-population-lookup").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": "searchCards",
  "query": "1952 Topps Mickey Mantle",
  "setUrls": [],
  "headingIds": [],
  "specNumbers": [],
  "category": "all",
  "isPsaDna": false,
  "includeSetTotal": false,
  "maxItems": 3,
  "maxSearchPages": 5,
  "maxEnrichSets": 10,
  "maxSetPages": 20,
  "requestDelaySecs": 0.8
}' |
apify call dataspryva/psa-card-grade-population-lookup --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,dataspryva/psa-card-grade-population-lookup"
        }
    }
}
```

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/1ennyVQZLn9izzqcM/builds/eVG52NtepK7T0cyPV/openapi.json
