{
  "openapi": "3.0.1",
  "info": {
    "title": "Prophed Common Markets",
    "description": "Fetch cross-platform prediction-market matches from Prophed Common Markets and output normalized arbitrage, liquidity, spread, and platform-comparison rows.",
    "version": "0.1",
    "x-build-id": "zVHAQ7iNGXesfIU3b"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/prophed~prophed-common-markets/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-prophed-prophed-common-markets",
        "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/prophed~prophed-common-markets/runs": {
      "post": {
        "operationId": "runs-sync-prophed-prophed-common-markets",
        "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/prophed~prophed-common-markets/run-sync": {
      "post": {
        "operationId": "run-sync-prophed-prophed-common-markets",
        "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": {
          "apiBaseUrl": {
            "title": "API base URL",
            "type": "string",
            "description": "Base URL for the Prophed API. The default is a Cloudflare Access protected Prophed export route used by this Actor.",
            "default": "https://v1.prophed.com"
          },
          "apiPath": {
            "title": "API path",
            "type": "string",
            "description": "Path that returns the common markets JSON array.",
            "default": "/api/common-markets"
          },
          "apiKey": {
            "title": "API key",
            "type": "string",
            "description": "Optional private Prophed API key. Store secrets in Apify secret input values."
          },
          "apiKeyHeaderName": {
            "title": "API key header",
            "type": "string",
            "description": "Header name used for the optional API key.",
            "default": "apikey"
          },
          "cfAccessClientId": {
            "title": "Cloudflare Access client ID",
            "type": "string",
            "description": "Optional Cloudflare Access service-token client ID for a protected Prophed export route. Store this as an Apify secret."
          },
          "cfAccessClientSecret": {
            "title": "Cloudflare Access client secret",
            "type": "string",
            "description": "Optional Cloudflare Access service-token client secret for a protected Prophed export route. Store this as an Apify secret."
          },
          "limit": {
            "title": "Source limit",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Number of common markets requested from Prophed. The Prophed endpoint currently caps this at 500.",
            "default": 100
          },
          "maxItems": {
            "title": "Max dataset rows",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Hard cap for emitted Apify dataset rows after filtering.",
            "default": 100
          },
          "minPlatformCount": {
            "title": "Minimum platform count",
            "minimum": 1,
            "maximum": 8,
            "type": "integer",
            "description": "Only emit common markets that are matched across at least this many platforms.",
            "default": 2
          },
          "minTotalVolume": {
            "title": "Minimum total volume",
            "minimum": 0,
            "type": "integer",
            "description": "Only emit markets with at least this total matched volume.",
            "default": 0
          },
          "platforms": {
            "title": "Required platforms",
            "type": "array",
            "description": "Optional platform filter. If set, each emitted common market must include at least one of these platforms.",
            "items": {
              "type": "string"
            }
          },
          "categories": {
            "title": "Categories",
            "type": "array",
            "description": "Optional category filter, matched case-insensitively.",
            "items": {
              "type": "string"
            }
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "total_volume",
              "platform_count",
              "average_spread",
              "best_price",
              "average_similarity"
            ],
            "type": "string",
            "description": "Client-side sorting for the emitted rows.",
            "default": "total_volume"
          },
          "includePlatforms": {
            "title": "Include platforms",
            "type": "boolean",
            "description": "Include normalized per-platform market details in each dataset row.",
            "default": true
          },
          "includeOutcomes": {
            "title": "Include outcomes",
            "type": "boolean",
            "description": "Include per-platform outcome arrays. Disable for smaller output rows.",
            "default": true
          },
          "maxOutcomesPerPlatform": {
            "title": "Max outcomes per platform",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Caps the number of outcomes copied into each platform object.",
            "default": 20
          },
          "includeRawMarket": {
            "title": "Include raw market",
            "type": "boolean",
            "description": "Attach the raw Prophed market object for debugging or archival use.",
            "default": false
          },
          "timeoutSecs": {
            "title": "Request timeout seconds",
            "minimum": 5,
            "maximum": 120,
            "type": "integer",
            "description": "Timeout for the Prophed API request.",
            "default": 30
          },
          "failOnSourceError": {
            "title": "Fail on source error",
            "type": "boolean",
            "description": "Fail the Actor instead of emitting an error row when the Prophed API cannot be fetched.",
            "default": true
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}