A trading API is a coded protocol that enables one application to communicate directly with another. Put differently, your script can fire an order, like “buy 10 shares of X company at $200,” straight to a broker’s servers.
Public’s commission-free Trading API lets you pull real-time balances, get quotes, and place stock, ETF, and multi-leg options orders. It’s free for personal use, offers tiered contract rebates ranging from $0.06 to $0.10, and provides 99.994% uptime with $250K instant buying power.
This blog will explain what a trading API is, how Public’s API works, and how it may support custom, automated workflows for those exploring options trading API capabilities.
A trading API is a brokerage interface that converts code into live market orders, and data pulls. Instead of clicking buttons on a platform, you send HTTPS requests that the broker’s servers translate into actions such as “GET account portfolio” or “POST place order.”
Because requests are machine-readable, you can automate strategies, back-test at scale, or feed positions into custom dashboards, often in milliseconds.
Why use an API for trading?
A trading API, including an options trading API, can support custom setups, especially for those who prefer to use code in their investment approach. Below are common use cases:
Automation: APIs allow you to automate repetitive tasks, such as placing trades or rebalancing your portfolio.
Speed and scale: Trading APIs can execute code that scans thousands of symbols faster than manual screens.
Customization: APIs provide dashboards, alerts, or chatbots that no off-the-shelf tool offers.
Data Access: APIs provide direct access to real-time and historical market data, supporting research and analysis.
Integration: APIs enable you to connect your trading with other applications, such as spreadsheets or alert systems.
For example, you might set up an API script to notify you when a stock’s price crosses a certain threshold, or to place a buy order if specific market conditions are met.
Public’s trading API: A closer look
If you’re exploring API trading, Public.com’s Trading API offers a developer-friendly way to program your trades while avoiding commissions and rebates on every stock and ETF options. It’s built for individual investors who want a more flexible and customizable trading setup, including an options trading workflow.
This API gives you read and write access to your trading data and allows you to:
Monitor your portfolio
Access real-time stocks and options quotes
Place orders via code
Manage multi-leg options trades
Track dividends and earned interest
Let’s dive deeper into its features.
Key features of Public’s trading API
Public gives you two doors into its commission-free stock trading API: one to “read” everything happening in your account and one to “write” new orders.
1. Read access
This access provides you with what you can see in real time.
Balances & buying power – know precisely how much cash your next trade can use (pulled with one call).
Whole-portfolio view – view stocks, ETFs, options, crypto, and bonds you maintain in a single interface.
Position detail & money history – every fill, dividend, deposit and withdrawal is stored for audits.
Live order tape – watch open tickets update second-by-second.
Yield tracking – track dividends and interest that flow straight into your dashboard.
2. Write access
This access helps you understand what you can do with the code.
Place trades on the fly – market, limit, stop, and stop-limit orders execute commission-free.
Control size, price, and time-in-force – supports fractional shares up to six decimals and DAY/GTC/IOC/OPG durations.
Route through cash, margin, or IRA accounts – entity accounts that land later this year.
Single-leg and multi-leg options order – build spreads, condors, or iron flies in one request.
Index-option, crypto, and bond endpoints – marked “coming soon,” so your API for trading scales with new markets.
Earn tiered rebates – $0.06–$0.10 back per stock or ETF options contract, which is rare in any brokerage API.
Who is Public’s API for?
Public’s API is designed for individual investors seeking to automate their own trading or build personal analytics tools. Some users may choose to explore options trading API functionality to structure trades, test strategies, or view market data through custom tools. It is not designed for commercial or third-party use. You are responsible for all trades made via your API key, and you must not redistribute, sublicense, or make the API or its data available to others.
How to get started with Public’s trading API
You can use Public’s Trading API to automate your trades, retrieve live portfolio data, and place orders directly through code. Below is a step-by-step process to help you set up and start using the API.
Step 1: Understand the basics
Before starting, learn how REST APIs work. You will send HTTP requests (like GET or POST) and receive responses in JSON format. Basic coding experience is helpful, especially in Python, JavaScript, or similar languages.
Step 2: Create or log in to your Public account
You will need an active Public Investing account to access the API. If you haven’t created one, sign up at Public. If you already have an account, log in and verify your identity.
Step 3: Request API Access
Open Public’s Trading API page and click on “Request access.” Fill out the “individual” or “required for business” form and wait for the approval email.
Step 4: Access the API documentation
Review the official API documentation provided by the Public. This guide explains how to authenticate, lists available endpoints, and outlines the requirements for request formatting.
Step 5: Generate your secret (API) key
Within your Public account dashboard, navigate to the API section and generate your personal key. This key is unique to you and must be kept confidential. Do not share your API key with anyone, as you are responsible for all actions taken with it.
Step 6: Set up your development environment
Install necessary libraries (such as requests for Python) and securely store your API key. Ensure your environment is set up to send HTTPS requests and handle responses.
Step 7: Make your first API request
Start by making a simple read request, like checking your account balance. This helps confirm that everything is connected properly before you proceed to execute trades.
Step 8: Build and test your strategy
Develop more complex workflows, such as automated trading strategies or custom alerts. You may use Public’s paper trading environment to test your code without risking real funds.
Step 9: Monitor and maintain your API usage
Regularly review your API actively. Monitor for unusual activity, rotate your API keys periodically, and stay informed about changes to the Public’s API or policies.
Example: Fetching a Stock Quote
You can use Public’s API to retrieve the latest quote for any supported security by specifying its symbol in your request. Here’s a generic example using Python:
Replace “SYMBOL” with the ticker of the security you want to look up. This approach allows you to fetch real-time price data for any available asset supported by the Public’s API.
This kind of setup may also be extended to retrieve options data or structure more complex queries for research purposes.
Important Note:
The Public Individual API is for personal, non-commercial use only. You may not use it to offer trading services, manage investments for others, or operate a business. Public reserves the right to throttle, limit, or revoke access at any time. You’re responsible for understanding API behavior and trade execution outcomes. Access does not guarantee availability, speed, or success of trades. For more, refer to theIndividual API Program Disclosures.
Conclusion
API trading can help you automate, customize, and enhance your investment experience. Public’s API offers a modern, accessible way for you as an investor to build personal trading tools and strategies, provided you use it within the boundaries of Public’s Individual API Program Agreement.
Before you get started, review all relevant documentation and disclosures. Remember, you are solely responsible for your API key, your application’s compliance, and any activity conducted through your credentials. Public may change, suspend, or terminate your access at any time, and the API is provided without any warranty or guarantee of availability or performance.
Explore the full documentation and program terms at Public API before diving in.