{
  "openapi": "3.0.1",
  "info": {
    "title": "PSA Population Report Scraper — Set Pop, PSA 10 & Gem Rate",
    "description": "Scrape PSA population report by set name or pop URL — a PSA pop API alternative for card flippers. Export per-card grade census, PSA 10 pop, gem rate, and set-monitor deltas as JSON.",
    "version": "1.0",
    "x-build-id": "o7bzvBumde1k1zjYv"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/crawloop~psa-pop-report-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-crawloop-psa-pop-report-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/crawloop~psa-pop-report-scraper/runs": {
      "post": {
        "operationId": "runs-sync-crawloop-psa-pop-report-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/crawloop~psa-pop-report-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-crawloop-psa-pop-report-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": {
          "setNames": {
            "title": "Set names",
            "type": "array",
            "description": "PSA pop set search (e.g. Surging Sparks, 2023 Topps Chrome). Aliases resolve instantly; other names search public pop URLs. Prefer startUrls when a name matches several years / languages.",
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "Set pop URLs",
            "type": "array",
            "description": "Direct PSA Population Report set pages. Example: https://www.psacard.com/pop/tcg-cards/2024/pokemon-ssp-en-surging-sparks/285178",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "headingIds": {
            "title": "Heading IDs",
            "type": "array",
            "description": "Numeric PSA pop heading IDs from the set URL (last path segment). Use when you already store IDs from a previous run.",
            "items": {
              "type": "string"
            }
          },
          "maxItems": {
            "title": "Max cards",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum dataset rows across all sets. 0 = unlimited. Default 500 covers a typical TCG set (Surging Sparks is ~412). Large baseball sets such as Topps Chrome can exceed 60k rows — raise this only when you want the full census.",
            "default": 500
          },
          "maxSets": {
            "title": "Max sets per name",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "When a set name matches several pop URLs, how many to scrape (best match first). URLs and heading IDs are always scraped.",
            "default": 1
          },
          "isPsaDna": {
            "title": "PSA/DNA (autograph) pop",
            "type": "boolean",
            "description": "Request the PSA/DNA certified line instead of standard PSA card grades.",
            "default": false
          },
          "includeSetTotal": {
            "title": "Include set total row",
            "type": "boolean",
            "description": "Emit one set_total row (SpecID 0) with the set-wide grade census before card rows.",
            "default": true
          },
          "subjectContains": {
            "title": "Subject contains",
            "type": "string",
            "description": "Keep cards whose subject / player / Pokémon name contains this text (case-insensitive). Set totals always pass."
          },
          "varietyContains": {
            "title": "Variety contains",
            "type": "string",
            "description": "Keep cards whose variety contains this text (e.g. Special Illustration Rare, Refractor). Set totals always pass."
          },
          "minPop10": {
            "title": "Min PSA 10 pop",
            "minimum": 0,
            "type": "integer",
            "description": "Drop cards with fewer PSA 10s than this."
          },
          "maxPop10": {
            "title": "Max PSA 10 pop",
            "minimum": 0,
            "type": "integer",
            "description": "Drop cards with more PSA 10s than this (scarce gem filter)."
          },
          "minGemRate": {
            "title": "Min gem rate",
            "minimum": 0,
            "maximum": 1,
            "type": "number",
            "description": "Keep cards whose PSA 10 / total is at least this (0–1). Example: 0.3 = 30% gem."
          },
          "maxGemRate": {
            "title": "Max gem rate",
            "minimum": 0,
            "maximum": 1,
            "type": "number",
            "description": "Keep cards whose PSA 10 / total is at most this (hard-to-gem filter)."
          },
          "minTotal": {
            "title": "Min total graded",
            "minimum": 0,
            "type": "integer",
            "description": "Drop cards with fewer total graded copies than this."
          },
          "monitorMode": {
            "title": "Monitor mode",
            "type": "boolean",
            "description": "On a schedule, attach prevPop10 / deltaPop10 / gemRateChange from the last snapshot. First run is a full baseline. Pair with an Apify Schedule and a stable monitorStoreName. Unlike listing monitors, this re-emits the set census every run unless emitChangedOnly is on.",
            "default": false
          },
          "emitChangedOnly": {
            "title": "Emit changed cards only",
            "type": "boolean",
            "description": "With monitorMode, push and charge only spec IDs whose pop10, total, or gem rate moved since the last snapshot. First run still delivers the full match set.",
            "default": false
          },
          "monitorStoreName": {
            "title": "Monitor store name",
            "type": "string",
            "description": "Named Key-Value store for pop snapshots across scheduled runs. Use a distinct name per watch (e.g. ssp-en vs chrome-2023).",
            "default": "psa-pop-report-monitor"
          },
          "resetMonitorState": {
            "title": "Reset monitor state",
            "type": "boolean",
            "description": "Clear the pop snapshot before this run (next run becomes a new baseline).",
            "default": false
          },
          "requestDelaySecs": {
            "title": "Request delay (seconds)",
            "minimum": 0,
            "type": "number",
            "description": "Pause between GetSetItems pages.",
            "default": 0.25
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Recommended on Apify: RESIDENTIAL. Datacenter IPs can 429 GetSetItems. Local runs can leave proxy off.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ]
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}