In order to start using Alpaca Web API, you will need to obtain your API key. An API key consists of two strings,
one called Key ID which always appears in your dashboard, and Secret Key, which appears only once when generating
it. Make sure you keep both in your hands.
Current version of the Alpaca API, which has been updated to support our newest features, including margin, shorting, and extended hours.
Basic usage examples showing how to do specific tasks
using the Alpaca API.
Alpaca also provides software development kits (“SDKs”) here
for Python, C#, Go, and Node to help interact with the Alpaca API.
API v2 Alpaca is a modern platform for algorithmic trading. Alpaca’s API is the interface for your trading algo to communicate with Alpaca’s brokerage service.
The API allows your trading algo to access real-time price, fundamentals, place orders and manage your portfolio, in either REST (pull) or streaming (push) style.
In order to start trading with Alpaca API, please sign up here.
Once you have signed up and have familiarized yourself with our API, please check out our python client to begin writing your own algo!
How-To Code Examples
How-To Welcome to the how-to section of our documentation! Here, you’ll find some examples of how to do specific tasks using the Alpaca API in supported programming languages.
Before running these examples, it is recommended that you set the following environment variables to the corresponding values found on your dashboard. Please be aware of whether you’re using the values for your paper trading account or for your live trading account.
Client SDK Official Alpaca SDKs Alpaca provides and supports the following open-source SDKs in a number of languages. You can leverage these libraries to easily access our API in your own application code or your trading scripts.
Python: alpaca-trade-api-python / PyPI .NET/C#: alpaca-trade-api-charp / NuGet Go: alpaca-trade-api-go Node: alpaca-trade-api-js Community-Made SDKs In addition to the SDKs directly supported by Alpaca, individual members of our community have created and contributed their own wrappers for these other languages.