API

Get Started

WelcomeQuickstartGuidesChangelogSDKs and ToolsAdditional InfoFAQ

Authorization

POSTCreate personal access token

List Accounts

GETGet accounts

Account Details

GETGet account portfolio v2GETGet history

Tax Lot Selling

GETGet unrealized tax lotsGETGet unrealized tax lots for symbolGETGet unrealized tax lots csv

Instrument Details

GETGet all instrumentsGETGet instrumentGETSearch bonds

Market Data

POSTGet quotesGETGet bond detailsPOSTGet option expirationsPOSTGet option chainGETGet bars v2GETGet bars v2 with aggregation

Orders

POSTPreflight single legPOSTPreflight multi legPOSTPlace orderPUTReplace orderPOSTSearch ordersPOSTPlace multileg orderGETGet orderDELETECancel order

Option Details

GETGet option greeksPOSTGet strategy quote

Event Contracts

POSTGet event summaryGETGet event categoriesGETGet event details
HelpFeedback

Get Started

FAQ

Answers to common questions about building with the Public API.

Getting started

How do I authenticate with the Public API?

Generate a secret key on the API settings page, exchange it for an access token with POST /userapiauthservice/personal/access-tokens, then send Authorization: Bearer YOUR_ACCESS_TOKEN with every request. The Quickstart walks through each step.

How long does an access token last?

You choose when you create it. Set validityInMinutes in the request body when you exchange your secret key for a token. See Generate a new access token.

Is there an SDK?

Yes. There is an official Python SDK, a Public CLI, and Postman collections for every endpoint. Find them all on SDKs and Tools.

What are the rate limits?

10 requests per second per account, across all endpoints. Requests over the limit return 429, so retry with exponential backoff.

Can I have more than one brokerage account?

Yes. You can open multiple brokerage accounts on Public, for example to separate strategies or AI agents. Trading endpoints take an accountId, so each request targets one account.

Where can I get help?

Email api-support@public.com, or open an issue on the relevant GitHub repository to report a bug or request a feature.

Account capabilities

How can I tell if an account has margin?

brokerageAccountType is MARGIN in the Get accounts response.

How can I tell if an account can trade crypto?

There's no field or non-mutating check for it today. Instrument lookup and preflight can succeed, and placement then fails with error 50154 (crypto is not enabled for account). Treat that error as the signal. See Account capabilities.

Orders & trading

What can I trade through the API?

Stocks and ETFs, equity and index options, corporate bonds and treasuries, prediction markets, and crypto.

How do I check an order before placing it?

Use the preflight endpoints for single-leg and multi-leg orders. They return the estimated cost, commission, and fees without placing anything. Order limits are enforced at placement, so preflight is the way to validate an order first. See Order Limits.

Does a successful preflight mean the order will be accepted?

No. Some checks only run at placement, such as crypto entitlement, so still handle rejections from the place order request. See Validating orders with preflight.

Is there an endpoint that lists all orders?

No. Use Portfolio v2 for open orders, Get order for a single order, Search orders for up to 500 orders from the last 30 days, and history for posted transactions. See Finding and tracking orders.

Is there a WebSocket, webhook, or stream for orders and fills?

No. Poll for order and fill status within the 10 requests per second per account limit. See Polling for updates.

Does Get order return individual fills?

No. It returns aggregate fields such as filledQuantity and averagePrice, with no per-fill records, execution IDs, or per-fill fees. Use history for execution amounts and fees once they post.

Can I match history transactions to the orders that created them?

Not with an ID. History rows don't include the order ID, so track each order you submit and match by symbol, side, quantity, and timestamp. See Reconciling history with orders.

Why isn't a filled trade in my history yet?

History can post after an order shows as filled. Build reconciliation to retry with backoff so late postings are picked up.

Can I trade fractional shares or by dollar amount?

Yes. Market and limit orders accept a fractional quantity or a dollar amount. During regular hours, fractional orders have a $5 minimum and a $250,000 maximum. Extended-hours orders must be whole shares.

Can I trade outside regular market hours?

Yes. Set equityMarketSession to EXTENDED to trade from 4:00 a.m. to 8:00 p.m. ET (DAY orders in whole shares only), or to TWENTY_FOUR_HOURS to trade around the clock, five days a week. See Market sessions.

Which order types are supported?

MARKET, LIMIT, STOP, and STOP_LIMIT, with DAY or GTD time in force. See Advanced Orders for a request body for each.

How long can a good-till-date order stay open?

Up to 90 days. Set timeInForce to GTD and expirationTime to the exact time the order should expire. See Time in force.

Can I change an order without cancelling it?

Yes. Send a PUT request to the order endpoint to cancel and replace an open equity, options, or crypto quantity order in a single request. Set orderIdto the order you're replacing and requestId to a new UUID. See Cancel and replace.

Can I change a bracket order after placing it?

Only its exit legs. The entry can't be replaced, and the exit legs can change limitPrice and stopPrice only, with quantity, orderType, and expiration resubmitted unchanged.

Do you support bracket, stop-loss, or take-profit orders?

Yes. Set orderClass to BRACKET, OCO, or OTO with takeProfit and/or stopLoss, and the exit legs are placed automatically when the entry order fills. See Placing your first bracket order.

How do bracket exit legs behave?

Exit legs inherit the entry's time in force and expiration. An invalid leg rejects the whole bracket with 400, and cancelling an unfilled entry cancels both exit legs. See Bracket order legs.

Can I short stocks?

Yes, from a margin account. Check the instrument's shortingAvailability first; hard-to-borrow names report a borrow rate in hardToBorrowPercentageRate. See Placing your first short order.

How do I place an order without using margin?

Set useMargin to false on the order. It is then evaluated against cash-only buying power. If you omit it, margin is applied when your account allows it.

Can I choose which tax lots to sell?

Yes. When you sell to close an equity position, include taxLotMatchingInstructions to name the lots to sell. See Selling specific tax lots.

What are the crypto trading fees?

Crypto fees are tiered by monthly trading volume, from 0.60% for the first $10K down to 0.10% above $100M. The full table is in the Changelog.

Options

How many option contracts can I trade in one order?

Up to 1,999 contracts for equity options and 1,499 for SPY and QQQ, and multi-leg orders can have up to 6 legs. See Order Limits for index options and price increments.

How are option Greeks calculated?

See How Greeks Are Calculated. Greeks are also included in the option chain response.

Prediction markets

How are event contracts priced?

Between $0.00 and $1.00. The price is the market's implied probability, and a contract pays $1.00 if it settles in your favor and $0.00 if it doesn't. See Trading prediction markets.

Can I sell an event contract before it settles?

Yes, through the API. Place a SELL order for the same contract while its outcome is in BUY_AND_SELL mode. The Public MCP server can only buy event contracts, so sell from the Public app or the API.

How do I find the 15-minute market trading right now?

See Trading 15-minute prediction markets for the API and a Python script, or Trading prediction markets with the Public MCP to ask an AI assistant.

MCP & AI agents

Which AI assistants can connect to my Public account?

Claude and Claude Code, ChatGPT and Codex, Meta Muse, Perplexity, and Grok connect through the hosted MCP server. OpenClaw and Perplexity Computer connect through the Public Agent Skill.

What is the difference between OAuth and API key connections?

Most assistants connect with OAuth, so you sign in to Public and never share a key. Meta Muse and the Public Agent Skill connect with a Public API key instead. Treat that key like a password, because anyone with it can view your account and place trades.

Are trades placed through an AI assistant real?

Yes. An order placed through any MCP client or agent is a real order using real money in your Public account. Review the preflight details before you confirm.