{"schemaVersion":1,"resourceType":"connector","slug":"kalshi","name":"Kalshi","catalog":"kalshi","description":"Kalshi prediction markets — markets, order books, candlesticks, trades and events","language":"Python","categories":["finance"],"repository":"https://github.com/Query-farm/vgi-kalshi","license":"MIT","generatedAt":"2026-12-01T18:22:16+00:00","runtime":{"engineVersion":"2.0.1","protocolVersion":"3.4"},"release":{"tag":"v1.5.1","publishedAt":"2026-11-29T20:30:59Z","url":"https://github.com/Query-farm/vgi-kalshi/releases/tag/v1.5.1"},"links":{"html":"https://query.farm/products/orchard/connectors/kalshi/","llms":"https://query.farm/products/orchard/connectors/kalshi/llms.txt","markdown":"https://query.farm/products/orchard/connectors/kalshi/index.md","json":"https://query.farm/products/orchard/api/v1/connectors/kalshi.json","objects":"https://query.farm/products/orchard/api/v1/connectors/kalshi/objects.json","search":"https://query.farm/products/orchard/api/v1/search.json?kind=object&connector=kalshi&q={query}"},"authentication":{"mode":"optional","guidance":"Market data is public; credentials are only for your own account (positions, balance).","interpretation":"Secret parameter required flags describe the upstream declaration; they do not override the service-level mode above. Keep secrets in environment variables or the deployment secret store. SQL values in angle brackets are placeholders, not automatic environment lookups. Native DuckDB and Haybarn 2.0.1 do not provide a SQL getenv() function, even when worker-supplied snippets mention it. Read environment variables in your application and pass credential values through client parameter bindings (for example, Python con.execute(\"CREATE SECRET stripe (TYPE stripe, api_key ?)\", [os.environ[\"STRIPE_API_KEY\"]]) after attaching the connector. Omit unused optional parameters and keep real values out of saved SQL and logs.","secrets":[{"type":"kalshi","description":"Kalshi API credentials for authenticated access. Optional for market data, which is public. Provide key_id (the API Key ID) and private_key (its RSA or Ed25519 private key, PEM). Required by the margin_* account functions.","documentation":"https://docs.kalshi.com/getting_started/api_keys","parameters":[{"name":"key_id","type":"VARCHAR","required":false,"redact":false,"description":"API Key ID shown on Kalshi's Account > API Keys page when the key is created"},{"name":"private_key","type":"VARCHAR","required":false,"redact":true,"description":"RSA or Ed25519 private key (PEM) downloaded once when the API key is created"}],"requiredBy":["markets","market","orderbook","candlesticks","trades","events","event","event_metadata","all_series","all_exchange_status","historical_markets","historical_trades","historical_candlesticks","all_historical_cutoff","margin_positions","margin_balance","margin_risk","margin_funding_history"],"createSql":"CREATE SECRET kalshi (\n    TYPE kalshi,\n    key_id      '<key_id>',\n    private_key '<PRIVATE_KEY>'  -- secret\n);"}]},"deployment":{"local":{"methods":[{"id":"uvx","label":"uvx","icon":"simple-icons:python","steps":[{"title":"Attach with uvx","description":"Needs uv. uvx builds the worker from its release tag on first attach and reuses the cached environment after that.","lang":"sql","code":"ATTACH 'kalshi' AS kalshi (\n  TYPE vgi,\n  LOCATION 'uvx --from git+https://github.com/Query-farm/vgi-kalshi@v1.5.1 vgi-kalshi'\n);"}]},{"id":"docker","label":"Docker","icon":"simple-icons:docker","steps":[{"title":"Attach the signed image","description":"Needs Docker, Podman or another OCI runtime. The extension runs the container and talks to it over stdio.","lang":"sql","code":"ATTACH 'kalshi' AS kalshi (\n  TYPE vgi,\n  LOCATION 'oci://ghcr.io/query-farm/vgi-kalshi:1.5.1'\n);"}]}],"pinnedMethods":[{"id":"uvx","label":"uvx","icon":"simple-icons:python","steps":[{"title":"Attach with uvx","description":"Needs uv. uvx builds the worker from its release tag on first attach and reuses the cached environment after that.","lang":"sql","code":"ATTACH 'kalshi' AS kalshi (\n  TYPE vgi,\n  LOCATION 'uvx --from git+https://github.com/Query-farm/vgi-kalshi@v1.5.1 vgi-kalshi'\n);"}]},{"id":"docker","label":"Docker","icon":"simple-icons:docker","steps":[{"title":"Attach the signed image","description":"Needs Docker, Podman or another OCI runtime. The extension runs the container and talks to it over stdio.","lang":"sql","code":"ATTACH 'kalshi' AS kalshi (\n  TYPE vgi,\n  LOCATION 'oci://ghcr.io/query-farm/vgi-kalshi:1.5.1'\n);"}]}]},"selfHost":{"instructions":"https://github.com/Query-farm/vgi-kalshi","connectionGuide":"https://query.farm/vgi/connect-to-a-worker/","guidance":"Deploy using the connector repository instructions and use its supported HTTP or SSH transport. Replace example URLs with your actual deployment; configure its authentication."},"queryFarm":{"available":true,"console":"https://auth.queryfarm.cloud/console/new?worker=kalshi","organizationMonthlyMinimumUsd":10,"pricing":"https://query.farm/products/orchard/hosted/"},"publicDemo":null},"setup":{"extensions":{"duckdb":"SET allow_extension_repositories = 'allowed';\n\nCREATE EXTENSION REPOSITORY IF NOT EXISTS query_farm\n    WITH PREFIX 'https://duckdb-extensions.query.farm';\n\nINSTALL vgi FROM query_farm;\nLOAD vgi FROM query_farm;","haybarn":"INSTALL vgi FROM community;\nLOAD vgi;"},"attachSql":"ATTACH 'kalshi' AS kalshi (\n  TYPE vgi,\n  LOCATION 'uvx --from git+https://github.com/Query-farm/vgi-kalshi@v1.5.1 vgi-kalshi'\n);","attachOptions":[{"name":"auth","type":"VARCHAR","description":"How to treat the optional 'kalshi' secret: 'auto' (default) signs when one is present and uses public access otherwise; 'required' fails the query when none resolves; 'off' never signs.","required":false,"default":"auto"}],"note":"Install and load VGI, attach the connector using the catalog alias shown here, then create required secrets. Replace placeholders and omit unused optional secret parameters. Satisfy file, network and credential prerequisites before executing a query."},"example":{"title":"Compare active Bitcoin prediction markets","sql":"SELECT ticker, title, yes_bid_dollars, yes_ask_dollars, volume_24h_fp FROM kalshi.main.markets('KXBTCD') WHERE status = 'active' ORDER BY volume_24h_fp DESC","requiresCredentials":null,"note":null,"objects":[{"name":"kalshi.main.markets","kind":"table_function","links":{"html":"https://query.farm/products/orchard/connectors/kalshi/#obj-main-markets","markdown":"https://query.farm/products/orchard/connectors/kalshi/objects/table_function.bWFpbg.bWFya2V0cw.md","json":"https://query.farm/products/orchard/api/v1/connectors/kalshi/objects/table_function.bWFpbg.bWFya2V0cw.json"}}],"evidence":{"status":"captured_result","capturedAt":"2026-12-01T06:16:30+00:00","engineVersion":"2.0.1","protocolVersion":"3.4.0","releaseTag":"v1.5.1","sample":{"columns":["ticker","title","yes_bid_dollars","yes_ask_dollars","volume_24h_fp"],"types":["VARCHAR","VARCHAR","DECIMAL(18,4)","DECIMAL(18,4)","DECIMAL(18,2)"],"rows":[["KXBTCD-26DEC0117-T57999.99","Bitcoin price on Dec 1, 2026?",0.94,0.95,51336.78],["KXBTCD-26DEC0117-T58999.99","Bitcoin price on Dec 1, 2026?",0.83,0.84,45391.41],["KXBTCD-26DEC0117-T61999.99","Bitcoin price on Dec 1, 2026?",0.1,0.11,40964.99],["KXBTCD-26DEC0417-T54999.99","Bitcoin price on Dec 4, 2026?",0.94,0.95,38539.47],["KXBTCD-26DEC0117-T62499.99","Bitcoin price on Dec 1, 2026?",0.05,0.06,33608.57]],"more":true}},"artifact":null},"objects":{"total":21,"index":"https://query.farm/products/orchard/api/v1/connectors/kalshi/objects.json","search":"https://query.farm/products/orchard/api/v1/search.json?kind=object&connector=kalshi&q={query}"},"agentTasks":["Using my Kalshi API key, list my open perpetual-futures positions with their size, entry price, and how far the mark is from Kalshi's estimated liquidation price.","Using my Kalshi API key, how much funding have my perps positions received or paid in the last 30 days, per market, and what is my account equity now?","Which Kalshi series cover crypto? List a few of their tickers and titles.","For the Kalshi series KXBTCD, which markets are currently open for trading, and what is the best yes bid on each?","Chart the last day of hourly closing prices for the most actively traded open market in the Kalshi series KXBTCD.","When does the next Kalshi KXBTCD event resolve, and what source settles it?","Look up the current bid and ask for one specific Kalshi market, given only its ticker: pick any open market in KXBTCD and quote it by ticker.","What were the last few trades on any open market in the Kalshi series KXBTCD, and which side was the aggressor on?"],"provenance":{"generatedAt":"2026-12-01T18:22:16+00:00","repository":"https://github.com/Query-farm/vgi-kalshi","harvest":{"status":"ok","method":"subprocess","error":null,"vgi_version":"9773130dde"},"catalogVerification":{"verified":true,"status":"passed","total":7,"passed":7,"failed":0,"needs_credentials":0,"location":"uvx --from git+https://github.com/Query-farm/vgi-kalshi@v1.5.1 vgi-kalshi","transport":"subprocess","environment":{"vgi_extension_version":"9773130dde","haybarn_version":"2.0.1rc3","engine_version":"v2.0.1","python":"3.12.4","platform":"darwin_arm64","protocol_version":"3.4.0"},"checked_at":"2026-12-01T06:13:55+00:00"},"interpretation":"Catalog verification records the harvest environment. It is not proof that every query or current live API call succeeds. Only an example with captured_result has a saved result for that exact SQL."},"interpretation":["Missing, null, or undeclared metadata means unknown; do not invent defaults, credential scope, platform support or endpoint URLs.","Search is keyword retrieval, not proof of a capability. Read the exact object declaration before generating SQL.","A table and a table function can have the same name. Preserve parentheses and use the matching overload and schema.","Service credentials, external data availability and deployment authentication are separate requirements."]}