![]() ![]() ![]() Common errors here could include missing access keys or market closed messages if sending requests after hours. You’ll also see error messages (and headers) from the server as well. Should anything go wrong, you’ll see it here. Obviously, the right side has the response from the server. These are going to be where you’ll want to adjust and add your own values to change the request. In the center, you’ll see the request options including the body payload, headers, querystring parameters, and so on. On the left hand side, I’ve added all of Alpaca’s API methods organized with folders. Nothing fancy, but let’s take a look at what you’re looking at. ![]() In the above screenshot you’ll see a basic Alpaca Data API request. How it Works Making API requests is easy and fancy looking! This provides a great deal of flexibility between my applications and my own needs outside of the code. Without having to write or copy and paste some lengthy command to my terminal, or write code, I can easily use Insomnia instead. The other thing that’s nice here is that I can also make requests that quickly close out all of my positions or allow me to take other manual actions. These tools are extremely valuable in debugging code and just figuring out what calls your code is going to make. Does my code see what I’m seeing myself? Great! If not, then it’s time to investigate and debug. The end result leaves me with a more beautiful than command line tool that I can double check my code against. This makes copying requests to create new adjusted ones easy and also allows me to switch between environments ( brokerage services are offered through Alpaca Securities LLC). I used Insomnia, organized all of the API requests into folders, set up an environment with variables to use and override when using the live or paper trading API. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |