{
  "openapi": "3.1.0",
  "info": {
    "title": "Apprised prediction-market metadata API",
    "version": "2026-10-31",
    "description": "Metadata only. Official Polymarket widgets display live odds on market pages. Kalshi is paused pending written authorization."
  },
  "servers": [
    {
      "url": "https://apprised.news"
    }
  ],
  "paths": {
    "/api/get-market": {
      "get": {
        "operationId": "getMarket",
        "summary": "Get Polymarket metadata and official embed URL",
        "description": "Kalshi IDs return 404: unavailable pending publication permission.",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Publication-cleared market metadata. No price, probability, volume, snapshots or history.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Market"
                }
              }
            }
          },
          "404": {
            "description": "Market not found or unavailable pending publication permission."
          }
        }
      }
    },
    "/api/list-markets": {
      "get": {
        "operationId": "list_markets",
        "summary": "List permitted market metadata and source links",
        "responses": {
          "200": {
            "description": "Publication-cleared market metadata. No price, probability, volume, snapshots or history.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "markets": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Market"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/list-archived-markets": {
      "get": {
        "operationId": "list_archived_markets",
        "summary": "List permitted market metadata and source links",
        "responses": {
          "200": {
            "description": "Publication-cleared market metadata. No price, probability, volume, snapshots or history.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "archivedMarkets": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Market"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/bulk-archived-markets": {
      "get": {
        "operationId": "bulk_archived_markets",
        "summary": "List permitted market metadata and source links",
        "responses": {
          "200": {
            "description": "Publication-cleared market metadata. No price, probability, volume, snapshots or history.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "markets": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Market"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Market": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "platform",
          "question",
          "display"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "platform": {
            "type": "string",
            "enum": [
              "polymarket"
            ]
          },
          "question": {
            "type": "string"
          },
          "slug": {
            "type": [
              "string",
              "null"
            ]
          },
          "expiry": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": [
              "string",
              "null"
            ]
          },
          "sourceUrl": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "embedUrl": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "display": {
            "type": "string",
            "enum": [
              "embed"
            ]
          },
          "policyDomains": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      }
    }
  }
}
