{
  "openapi": "3.0.1",
  "info": {
    "title": "PSA Population Report Lookup & Change Tracker",
    "description": "Get PSA population reports by set, card or cert. Track a card watchlist over repeated runs with changes in total population, PSA 10, PSA 9 and gem rate. Export grade breakdowns and timestamped comparisons to JSON, CSV or Excel.",
    "version": "2.5",
    "x-build-id": "8VfigIyqAx8jRxBpe"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/lulzasaur~psa-pop-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-lulzasaur-psa-pop-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/lulzasaur~psa-pop-scraper/runs": {
      "post": {
        "operationId": "runs-sync-lulzasaur-psa-pop-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/lulzasaur~psa-pop-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-lulzasaur-psa-pop-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": {
          "setName": {
            "title": "Set Name (Search)",
            "type": "string",
            "description": "Search for a set by name and get ALL cards with grade breakdowns. Examples: 'Surging Sparks', '2023 Topps Chrome', 'Prizm Basketball'."
          },
          "setUrl": {
            "title": "Set URL (Direct)",
            "type": "string",
            "description": "Direct PSA Pop set page URL. Use this if set name search doesn't find your set. Example: https://www.psacard.com/pop/tcg-cards/2024/pokemon-ssp-en-surging-sparks/285178"
          },
          "certNumbers": {
            "title": "Cert Numbers (Batch)",
            "type": "array",
            "description": "Array of PSA cert numbers. Cached records are checked first; missing or older records may queue a browser refresh. The run waits up to 120 seconds per distinct certificate within its time limit. Refreshes can remain pending or unavailable. Population figures may reflect earlier observations. Normal Actor result charges apply to returned records."
          },
          "certNumber": {
            "title": "Cert Number (Single)",
            "type": "string",
            "description": "Single PSA cert number (e.g. '10000001'). Checks cached records first and may wait for a browser refresh within the run's time limit; a result is not guaranteed. For multiple certs, use 'Cert Numbers (Batch)' above."
          },
          "specID": {
            "title": "Spec ID",
            "type": "integer",
            "description": "Spec ID for direct population lookup (advanced). You can get this from a cert lookup result. A cache miss requires a PSA API token you are authorized to use."
          },
          "apiToken": {
            "title": "PSA API Token (optional)",
            "type": "string",
            "description": "Optional PSA API token for uncached direct specID population lookups. Access depends on your PSA plan. Certificate lookups do not use this token; set reports and population tracking do not require it."
          },
          "trackPopulationChanges": {
            "title": "Track population changes",
            "type": "boolean",
            "description": "Compare a direct setUrl with your previous successful snapshot. Repeat runs return net population changes by card. Each returned card is billed at the Actor’s current result price.",
            "default": false
          },
          "watchlistName": {
            "title": "Watchlist name",
            "type": "string",
            "description": "Separate baselines by watchlist. Use the same name and card selection on repeat runs. Do not overlap runs for the same watchlist.",
            "default": "default"
          },
          "watchSpecIds": {
            "title": "Specific cards to track (optional)",
            "type": "array",
            "description": "Array of PSA spec IDs from this set. Example: [12168745]. Leave empty to return and bill every card in the set. Changing the selection starts a new baseline."
          },
          "cacheDurationHours": {
            "title": "Maximum observation age (hours)",
            "minimum": 0,
            "type": "number",
            "description": "Ordinary lookups default to observations up to 168 hours (7 days) old. Set reports never exceed 168 hours. Certificate lookups honor shorter limits, including 0 to require a new observation for your queued request; queued refreshes return observations no older than 7 days. Refreshes may remain pending or unavailable. Original scrapedAt is retained; servedAt is delivery time. Direct specID overrides retain their existing behavior. Population tracking always requires a fresh complete observation.",
            "default": 168
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}