You've successfully subscribed to Alpaca Learn | Developer-First API for Crypto and Stocks
Great! Next, complete checkout for full access to Alpaca Learn | Developer-First API for Crypto and Stocks
Welcome back! You've successfully signed in.
Success! Your account is fully activated, you now have access to all content.
Success! Your billing info is updated.
Billing info update failed.
App Development

No-Code Trading With Alpaca and Zapier

Akshay Rakheja
Akshay Rakheja

What is Zapier?

Zapier is a no-code tool that lets multiple applications talk to each other, helping to automate repetitive tasks that require interaction between applications. It helps you automate workflows where you need a certain event to happen and take an action.

A workflow created using Zapier is called a Zap. Every Zap has a trigger and one or more actions. A trigger is an event that starts a Zap, and an action is what your Zap does for you. When a Zap runs, each action it completes counts as one task1. You can learn more about Zapier triggers and actions here.

Zapier’s Integration with Alpaca

Now that we know what Zapier is and how it works, let’s take a look at what it can help us do in regards to Alpaca. Alpaca has an integration with Zapier that lets you perform actions on your live trading account. This integration lets you set a trigger event and actions to go along with it. This lets you choose from a wide variety of possible triggers that can help you trigger an action on your Alpaca account.

Let’s take a look at how our workflow is going to be split up:

  1. Choose an app and event trigger
  2. Define an action on Alpaca (buy/sell trade)
  3. Test our workflow (Zap)

Create your Zap

Before we begin creating our Zap, you will need to create an account with Zapier. You can do that here. You must also have an Alpaca account that is funded to link with Zapier. An Alpaca account can be created here. Once you have created an account with both Alpaca and Zapier, navigate to the Zapier dashboard and click on the “Create Zap” button on the left toolbar.

Choose an App

There are over 5000 applications to choose from when setting a Trigger. For this article, we will use Twitter to set a Trigger.

From the list of applications as shown above, select twitter.

Create a Trigger

Once the application is selected, we need to choose an event Trigger. This is the event that our Zap will look for when taking an action on our Alpaca account. Twitter offers several trigger options to choose from. Some of them are “Liked Tweet”,”Search Mention” and “User Tweet”. We will go ahead and select “User Tweet” as our event as shown in the image below. “User Tweet” triggers an event when a specific user of our choice tweets.

Once our event is set, Zapier will prompt you to connect your Twitter account. Follow the prompts presented by Zapier to connect your Twitter account. Now that our account is set, we need to specify a specific Twitter user, who when tweets, should trigger our event. For our hypothetical example, we will choose @AlpacaWeb3 as the account to trigger our events. Whenever this account tweets, we will place an action on Alpaca.

Create an Action

Now that we've set our Trigger, we will set our trade action on Alpaca. In this example, we will buy $10 worth of ETHUSD. As we did while selecting Twitter from a list of applications, we will select Alpaca here. Please select Alpaca tagged “Latest” and “Beta” as the action app for this step. This is the application on the top left in the image below.

Alpaca’s integration with Zapier supports a range of trading endpoints that we can use to automate our workflow. The possible action events are shown in the image below. Once we have selected Alpaca as our action application, we need to choose an event type. We need to select "Place Order."

Once the event type is selected, Zapier will prompt you to connect your Alpaca account with Zapier as shown below.  Please follow the steps to connect your Alpaca account with Zapier. Once connected, Zapier will have access to your live trading account.

Now that we have connected our Alpaca account, we can go ahead and set up the action event. This is where the magic happens. In order to place a $10 Buy order for “ETHUSD”, you will need to set the following fields:

  1. Symbol : ETHUSD
  2. Side: Buy
  3. Notional Value : 10
  4. Type: Market
  5. Time in Force: gtc

Please refer to Alpaca docs for a better understanding of the required fields when placing a trade. You can place a trade for any asset tradable on Alpaca (Eg: AAPL, COIN, SNAP, BTCUSD, etc.) in the example above.

Once we have set our action event, we are ready to test our Zap. You can do this by clicking on the “Test and Review” button. Testing your Zap with the example settings noted above will create a real order on Alpaca. You should see a $10 buy order for “ETHUSD” on Alpaca dashboard similar to what is shown below.

Similarly, we can set up Zaps to place a sell order on Alpaca using similar trigger events as we saw above.

Publish your Zap

Hooray!! You have finally completed your Zap and are now ready to publish it. You now know how to create a Zap, using Twitter to set a trigger and place a trade on Alpaca when someone tweets.

Sources

  1. https://zapier.com/learn/zapier-quick-start-guide/quick-start-the-basics/

Alpaca and Zapier are not affiliated and neither are responsible for the liabilities of the other.

Alpaca does not prepare, edit, or endorse Third Party Content. Alpaca does not guarantee the accuracy, timeliness, completeness or usefulness of Third Party Content, and is not responsible or liable for any content, advertising, products, or other materials on or available from third party sites.

Please note that this article is for general informational purposes only. All screenshots are for illustrative purposes only. The views and opinions expressed are those of the author and do not reflect or represent the views and opinions of Alpaca. Alpaca does not recommend any specific securities or investment strategies.

All investments involve risk and the past performance of a security, or financial product does not guarantee future results or returns. Keep in mind that while diversification may help spread risk it does not assure a profit, or protect against loss. There is always the potential of losing money when you invest in securities, or other financial products. Investors should consider their investment objectives and risks carefully before investing.

Securities brokerage services are provided by Alpaca Securities LLC ("Alpaca Securities"), member FINRA/SIPC, a wholly-owned subsidiary of AlpacaDB, Inc. Technology and services are offered by AlpacaDB, Inc.

Cryptocurrency is highly speculative in nature, involves a high degree of risks, such as volatile market price swings, market manipulation, flash crashes, and cybersecurity risks. Cryptocurrency is not regulated or is lightly regulated in most countries. Cryptocurrency trading can lead to large, immediate and permanent loss of financial value. You should have appropriate knowledge and experience before engaging in cryptocurrency trading. For additional information please click here.

Cryptocurrency services are made available by Alpaca Crypto LLC ("Alpaca Crypto"), a FinCEN registered money services business (NMLS # 2160858), and a wholly-owned subsidiary of AlpacaDB, Inc. Alpaca Crypto is not a member of SIPC or FINRA. Cryptocurrencies are not stocks and your cryptocurrency investments are not protected by either FDIC or SIPC. Depending on your location, cryptocurrency services may be provided by West Realm Shires Services, Inc., d/b/a FTX US (NMLS #1957771). Please see the Disclosure Library for more information.

This is not an offer, solicitation of an offer, or advice to buy or sell securities or cryptocurrencies, or open a brokerage account or cryptocurrency account in any jurisdiction where Alpaca Securities, Alpaca Crypto, or FTX US respectively, are not registered or licensed, as applicable.






App DevelopmentTrading APIUse Cases