Verifying Your Streaming API Key with a Browser Extension
Learn how to verify if your streaming API key is functioning by leveraging a browser extension.
Due to the need for real-time data, many users opt to acquire foreign exchange (forex) data through WebSockets, which offer exceptionally low latency. To establish this access, a Streaming API Key, also known as a WebSocket Key, serves as the essential credential.
This tutorial will explore the process of acquiring a Streaming API Key and delve into methods for verifying its functionality. However, it’s important to note that browser extensions are not a secure means of checking these credentials.
Verifying Streaming API Key Functionality: A Step-by-Step Guide
To begin with, let’s establish a foundation for acquiring your Streaming API Key by initiating our fourteen-day complimentary WebSocket trial.
Initiate Account Creation: Access the registration portal by navigating to https://tradermade.com/signup.
Credential Verification: After successfully logging in with your established credentials, you will be directed to our comprehensive dashboard. This serves as a centralized hub, providing access to your REST API Key and Streaming API Key, pertinent details regarding your WebSocket data or additional subscription plans, active trials, and any purchases completed through our platform.
Obtaining Your Streaming API Key
Upon successful login with your credentials, you will be presented with your user dashboard, which resembles the image provided. To acquire your Streaming API Key, locate and click the button labeled “START WEBSOCKET TRIAL” (highlighted in red within the screenshot above). Following this action, you will be directed to a dedicated “Thank You” message page.
Automated Welcome Email
After successfully initiating your WebSocket trial, you will receive an automated email message welcoming you to the platform.
Accessing the WebSocket Subscription Page
Within those above automated welcome email, you will find a designated button labeled “DASHBOARD.” As you click this button, you will be taken to the dedicated WebSocket Subscription page, which serves as the portal for managing your data feed.
Verification of Trial Activation and Locating Your Streaming API Key
Upon accessing your dashboard, a prominent notification displayed in the top left corner confirms the successful activation of your WebSocket Trial (similar to the green box highlighted in the illustrative image).
Furthermore, in the “Live Streaming Plan” section ( See the bottom right segment of your dashboard), you will find your unique Streaming API Key. It is imperative to safeguard this key, as it will be required to retrieve real-time streaming data in subsequent steps.
Acquiring the Necessary Chrome Extension
We recommend procuring the “Simple WebSocket Client” Chrome extension to verify the functionality of your Streaming API Key. This extension can be readily found within the Chrome Web Store.
Concurrent Utilization of Resources
For the subsequent procedures, it is recommended that you keep both the “Simple WebSocket Client” Chrome extension and our WebSocket Documentation page open within your web browser for seamless reference.
Verifying Streaming API Key Functionality: A Step-by-Step Guide
We will now delve into a series of straightforward steps to verify the functionality of your Streaming API Key directly within your web browser. As previously referenced, upon launching the “Simple WebSocket Client” extension, you will encounter the following interface:
Locating the WebSocket Endpoint
Navigate to our WebSocket Documentation page and locate the designated section for the “WebSocket Address” or “WebSocket URL.” This information will be critical for establishing the connection in the following steps.
Initiating the Connection
Within the “Simple WebSocket Client” Chrome extension, locate the designated field for entering the WebSocket URL. This URL can be found on our WebSocket Documentation page under the heading “WebSocket Address” or “WebSocket URL.”
For your reference, the standard protocol is:
wss://marketdata.tradermade.com/feedadv
Once you have entered the complete URL, click the designated “Open” button to initiate the connection with the TraderMade web server. A “Connected” message displayed within the “Message Log” area of the extension indicates a successful connection.
WebSocket Protocol Selection and Request Transmission
It’s important to acknowledge that HTTP/1.1 hosts can employ a mechanism for protocol upgrades, enabling an existing connection to shift to a different protocol. However, for this specific use case, we will leverage the WebSocket URL (wss://) provided within our WebSocket Documentation page. This protocol facilitates real-time, bidirectional data exchange.
To proceed, navigate to our WebSocket Documentation page and locate the designated command line you need to transmit as a request. This section will likely be visually highlighted (in red, for instance) for your ease of reference.
Transmission of Requests and Real-Time Data Reception
After acquiring your Streaming API Key from the previous steps, you will incorporate it into the request command line. Within our WebSocket Documentation page, locate the designated section for the command line (often highlighted for clarity). Replace the placeholder text “Use Your Streaming API Key” with your actual key.
Furthermore, you can tailor the request by specifying the desired currency pair symbols to monitor real-time exchange rates. For this example, we will utilize “EURUSD” and “GBPUSD.”
Once you have customized the command line with your Streaming API Key and chosen currency pairs, enter it within the designated “Request” field of the “Simple WebSocket Client” Chrome extension (referencing Image 8, which is not included here for security reasons). Subsequently, click the “Send” button to transmit the request.
Upon successful transmission, you should receive a response displaying real-time Bid, Ask, and mid-price data for the requested currency pairs in a lightning-fast manner. This response will populate within the “Message Log” area of the extension (referencing the blue rectangle in Image 9, which is not included).
WebSocket Object and Connection Management
The WebSocket Object serves a critical function by establishing and managing the connection between your web browser and the TraderMade web server. This connection facilitates the bidirectional exchange of data in real-time.
Verification of Streaming API Key Functionality
The successful reception of real-time exchange rates for your chosen currency pairs (EURUSD and GBPUSD) serves as a confirmation that your Streaming API Key is functioning correctly. The response will include timestamps alongside Bid, Ask, and mid-price data, delivered in a real-time stream.
This data retrieval exemplifies how the WebSocket protocol facilitates a real-time connection between your client application (web browser) and the TraderMade web server, enabling the conveyance of live streaming rates for your desired currency pairs.
Important Note: Remember to click the “Close” button before transmitting a subsequent request.
WebSocket Protocol and Full-Duplex Communication
Whenever you establish a connection and transmit a request, the WebSocket protocol leverages an underlying TCP connection to activate a full-duplex, bi-directional communication channel. This real-time, two-way communication occurs between a web client (your browser) and the web server.
Conclusion
The comprehensive tutorial will empower you to verify the functionality of your Streaming API Key. Should you encounter any technical inquiries or have tips for improvement, please do not hesitate to contact us via email or live chat. Our market data experts are eager to assist you and resolve any questions you may have.
Originally published on our website: How to check your Streaming API Key using Browser Extension