{
  "openapi": "3.0.1",
  "info": {
    "title": "PSA Card Grade Population Lookup",
    "description": "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.",
    "version": "1.0",
    "x-build-id": "eVG52NtepK7T0cyPV"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/dataspryva~psa-card-grade-population-lookup/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-dataspryva-psa-card-grade-population-lookup",
        "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/dataspryva~psa-card-grade-population-lookup/runs": {
      "post": {
        "operationId": "runs-sync-dataspryva-psa-card-grade-population-lookup",
        "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/dataspryva~psa-card-grade-population-lookup/run-sync": {
      "post": {
        "operationId": "run-sync-dataspryva-psa-card-grade-population-lookup",
        "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",
        "required": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "What to look up",
            "enum": [
              "searchCards",
              "setPopulation",
              "cardPopulation",
              "searchBySet",
              "recentGrades"
            ],
            "type": "string",
            "description": "Search cards by keyword, fetch a full set population report, or look up specific spec numbers.",
            "default": "searchCards"
          },
          "query": {
            "title": "Search query",
            "type": "string",
            "description": "Player, card, set or year to search, for example \"1952 Topps Mickey Mantle\" or \"Charizard\".",
            "default": "1952 Topps Mickey Mantle"
          },
          "setUrls": {
            "title": "Population set URLs",
            "type": "array",
            "description": "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.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "headingIds": {
            "title": "Set heading IDs",
            "type": "array",
            "description": "Numeric PSA set IDs from a population URL's last path segment. Use when you already store set IDs.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "specNumbers": {
            "title": "Spec numbers",
            "type": "array",
            "description": "PSA spec IDs to pick out of the supplied set (mode=cardPopulation). Also accepts comma-separated values.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "category": {
            "title": "Collectible category",
            "enum": [
              "all",
              "baseball-cards",
              "basketball-cards",
              "football-cards",
              "hockey-cards",
              "soccer-cards",
              "tcg-cards",
              "non-sport-cards",
              "golf-cards",
              "boxing-wrestling-cards-mma",
              "minor-league-cards",
              "misc-cards",
              "multi-sport-cards",
              "packs",
              "tickets",
              "pins",
              "baseball-coins",
              "basketball-coins",
              "football-coins",
              "hockey-coins",
              "multi-sport-coins",
              "non-sport-coins"
            ],
            "type": "string",
            "description": "Limit search results and label records with the collectible category. Choose All to search every category.",
            "default": "all"
          },
          "subjectContains": {
            "title": "Subject contains",
            "type": "string",
            "description": "Keep only cards whose player, character or subject contains this text."
          },
          "varietyContains": {
            "title": "Variety contains",
            "type": "string",
            "description": "Keep only cards whose variety, parallel or pedigree contains this text."
          },
          "minTotal": {
            "title": "Minimum total graded",
            "minimum": 0,
            "maximum": 10000000,
            "type": "integer",
            "description": "Keep cards with at least this many graded copies."
          },
          "maxTotal": {
            "title": "Maximum total graded",
            "minimum": 0,
            "maximum": 10000000,
            "type": "integer",
            "description": "Keep cards with at most this many graded copies."
          },
          "minGrade10": {
            "title": "Minimum PSA 10 population",
            "minimum": 0,
            "maximum": 10000000,
            "type": "integer",
            "description": "Keep cards with at least this many PSA 10 copies."
          },
          "maxGrade10": {
            "title": "Maximum PSA 10 population",
            "minimum": 0,
            "maximum": 10000000,
            "type": "integer",
            "description": "Keep cards with at most this many PSA 10 copies."
          },
          "isPsaDna": {
            "title": "PSA/DNA certified tab",
            "type": "boolean",
            "description": "Use the PSA/DNA certified population line instead of the standard card population.",
            "default": false
          },
          "includeSetTotal": {
            "title": "Include set total",
            "type": "boolean",
            "description": "Emit one extra row with the set-wide grade census (mode=setPopulation).",
            "default": false
          },
          "maxItems": {
            "title": "Maximum records",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Stop after this many records.",
            "default": 20
          },
          "maxSearchPages": {
            "title": "Maximum search pages",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Maximum keyword-search pages to walk when matching sets need population enrichment.",
            "default": 5
          },
          "maxEnrichSets": {
            "title": "Maximum sets to enrich",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Maximum matching sets to fetch when keyword results need population counts (mode=searchCards).",
            "default": 10
          },
          "maxSetPages": {
            "title": "Maximum set pages for spec lookup",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Maximum 500-card pages to walk per set when resolving spec numbers.",
            "default": 20
          },
          "requestDelaySecs": {
            "title": "Delay between requests (seconds)",
            "minimum": 0,
            "maximum": 5,
            "type": "number",
            "description": "Pause between PSA requests to stay inside its rate limits.",
            "default": 0.8
          }
        }
      },
      "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}