EUR/USD 1.14143 -0.01% GBP/USD 1.34360 +0.04% USD/JPY 162.479 -0.0% USD/CHF 0.81043 +0.06% AUD/USD 0.70055 +0.08% USD/CAD 1.40769 +0.04% NZD/USD 0.58628 +0.2% BTC/USD 65,543.00 +0.53% ETH/USD 1,923.61 +1.08% · EUR/USD 1.14143 -0.01% GBP/USD 1.34360 +0.04% USD/JPY 162.479 -0.0% USD/CHF 0.81043 +0.06% AUD/USD 0.70055 +0.08% USD/CAD 1.40769 +0.04% NZD/USD 0.58628 +0.2% BTC/USD 65,543.00 +0.53% ETH/USD 1,923.61 +1.08% ·
2 min read python forex api

Streaming API Client Example for Python Users

We have released the new Sample Client that will be very useful for Python Programmers.

Streaming API Client Example for Python Users

Python developers building on live-rates.com now have a ready-to-run Sample Client for the Streaming API. It removes the boilerplate and gets real-time forex data flowing into a Python application in just a few lines of code.

The example leans on python-socketio, keeping the integration path short for anyone who prefers pushed data over polling.

Key takeaways
  • A Python Sample Client is available for the Streaming API.
  • The Streaming API is powered by socket.io, a JavaScript-based engine.
  • Streaming pushes data to the socket; REST requires on-demand requests for each refresh.
  • The integration relies on the python-socketio project.
  • Only a few lines of code are needed to start receiving live data.

What the Sample Client Provides

The Sample Client is a ready-made script aimed at Python programmers who want a fast on-ramp to the live-rates.com Streaming API.

Why the Streaming API

The Streaming API has become the most preferred way of getting real-time financial data among live-rates.com users. It is powered by socket.io, a JavaScript-based engine, and delivers rate updates as they happen.

Streaming vs REST

The Streaming API pushes incoming data to the client socket. The REST API, by contrast, requires an on-demand request every time fresh data is needed, as explained in this article.

How the Python Integration Works

Thanks to the python-socketio project, the integration is very simple. A Python application can begin receiving live data with just a few lines of code by using the provided Sample Code.

FAQ

Who is the Sample Client for?

It is aimed at Python programmers who want to connect to the live-rates.com Streaming API without writing the socket plumbing from scratch.

What engine powers the Streaming API?

The Streaming API is powered by socket.io, a JavaScript-based engine.

How is the Streaming API different from the REST API?

The Streaming API pushes incoming data to the client socket, while the REST API requires an on-demand request each time fresh data is needed.

Which library does the Python example depend on?

The example depends on the python-socketio project, which makes the integration very simple.

How much code is needed to start receiving data?

Only a few lines of code are needed to start receiving live data inside a Python application.

Ready to stream real-time forex data into a Python app? Pick a plan on the Live-Rates plans page and connect the Sample Client to start receiving rates.

Real-time forex rates for your app

Live bid/ask for the pairs you need, updated every second, with a simple JSON & XML API. Try it free for 7 days.