{
  "openapi": "3.0.1",
  "info": {
    "title": "Sports Card Comps - Like-for-Like Sold Prices",
    "description": "Value sports cards from real eBay sold comps matched like-for-like: same year, set, card number, parallel, serial run, autograph and grade. Base never mixes with Silver, /25 never with /99, PSA 10 never with raw.",
    "version": "0.1",
    "x-build-id": "o32mgIyDPheAMgRaC"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/connorbroberts~sports-card-comps/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-connorbroberts-sports-card-comps",
        "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/connorbroberts~sports-card-comps/runs": {
      "post": {
        "operationId": "runs-sync-connorbroberts-sports-card-comps",
        "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/connorbroberts~sports-card-comps/run-sync": {
      "post": {
        "operationId": "run-sync-connorbroberts-sports-card-comps",
        "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": [
          "cards"
        ],
        "properties": {
          "cards": {
            "title": "Cards to value",
            "minItems": 1,
            "maxItems": 500,
            "uniqueItems": true,
            "type": "array",
            "description": "One card per line, written the way you would search for it: year, set, player, card number, parallel, serial number and grade. Example: 2023 Prizm Victor Wembanyama #136 Silver PSA 10. Leave the grade out for a raw card. Up to 500 cards per run.",
            "items": {
              "type": "string"
            }
          },
          "listingsPerCard": {
            "title": "Sold listings to check per card",
            "minimum": 10,
            "maximum": 240,
            "type": "integer",
            "description": "How many recent eBay sold listings to fetch for each card before filtering down to the exact same card. More listings find more comps but cost more in the sold-listings Actor. Ignored when you bring your own listings or dataset.",
            "default": 30
          },
          "daysBack": {
            "title": "Sold within the last",
            "minimum": 1,
            "maximum": 365,
            "type": "integer",
            "description": "Only use sales from this many days back. eBay keeps about 90 days of sold history.",
            "default": 90
          },
          "minComps": {
            "title": "Minimum comps for a value",
            "minimum": 1,
            "maximum": 25,
            "type": "integer",
            "description": "A card only gets a market value (and is only charged) when at least this many like-for-like sold comps are found. Cards below it come back as insufficient_comps, free of charge.",
            "default": 3
          },
          "listings": {
            "title": "Your own sold listings (optional)",
            "type": "array",
            "description": "Paste sold listings you already have and nothing is fetched. Each item needs a title and a price; a date and URL are optional. Field names from common eBay scrapers are recognised (title, soldPrice or price, endedAt or soldDate, url)."
          },
          "datasetId": {
            "title": "Dataset with sold listings (optional)",
            "type": "string",
            "description": "A dataset from an earlier sold-listings run, for example the output of an eBay sold listings scraper. Used instead of a live fetch."
          },
          "includeComps": {
            "title": "Include the matching comps",
            "type": "boolean",
            "description": "Attach the sold listings behind each value (title, price, date, link) so every number can be checked.",
            "default": true
          },
          "includeRejected": {
            "title": "Include rejected listings and why",
            "type": "boolean",
            "description": "Attach the listings that were thrown out and the reason for each, for example 'grade PSA 9 is not PSA 10' or 'Base is not Silver'. Useful for auditing.",
            "default": false
          },
          "includeBestOfferSales": {
            "title": "Count Best Offer sales",
            "type": "boolean",
            "description": "eBay hides the accepted price on Best Offer sales and shows the asking price instead, so they are left out by default. Turn on to count them anyway.",
            "default": false
          },
          "includeShipping": {
            "title": "Add shipping to sold prices",
            "type": "boolean",
            "description": "Value cards on sold price plus shipping instead of sold price alone.",
            "default": false
          },
          "broadenSearch": {
            "title": "Widen the search when comps are thin",
            "type": "boolean",
            "description": "When the exact search finds too few comps, run one wider search (without grade and serial number) and filter it just as strictly. Costs one more search in the sold-listings Actor for those cards only.",
            "default": true
          },
          "ebaySite": {
            "title": "eBay site",
            "enum": [
              "ebay.com",
              "ebay.co.uk",
              "ebay.ca",
              "ebay.de",
              "ebay.fr",
              "ebay.it",
              "ebay.es"
            ],
            "type": "string",
            "description": "Which eBay marketplace to pull sold listings from.",
            "default": "ebay.com"
          },
          "maxSourceChargeUsd": {
            "title": "Spending cap for fetching sold listings",
            "minimum": 0.01,
            "type": "number",
            "description": "Maximum the sold-listings Actor may charge per fetch, in US dollars. Leave empty for no cap beyond listings per card."
          },
          "sourceActorId": {
            "title": "Sold-listings Actor",
            "type": "string",
            "description": "The Actor used to fetch eBay sold listings. It must accept 'keywords' and 'count' and return a title and sold price per listing.",
            "default": "caffein.dev/ebay-sold-listings"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}