What is the Vega Node gRPC API and why should I use it over REST?
gRPC is a modern, open source remote procedure call (RPC) framework that can run anywhere. It enables client and server applications to communicate transparently, and makes it easier to build connected systems.
Vega Node APIs support gRPC, including streaming/observing updates.
The APIs use protocol buffers (protobuf) as their underlying message format and are transmitted in binary. REST uses text-based JSON and is therefore larger in size. gRPC also uses HTTP/2 which is faster than REST’s HTTP/1.1.
Another gRPC advantage for a trading system is that it supports streaming, allowing clients to efficiently receive new data from markets. With Vega, a client can send a single request and the server can reply with a stream of multiple responses. gRPC also supports bi-directional streaming, however this is not currently implemented.
gRPC API clients
We recommend using one of the API client libraries to connect to a Vega node. They are available for the following languages:
- Python (https://pypi.org/project/Vega-API-client/)
- Go (coming soon)
- Java (coming soon)
- .NET (coming soon)
Our API How-to Guides include examples that use gRPC API clients.
What’s the default port for Vega gRPC APIs?
The out of the box configuration will run gRPC services on port 3002. This can be changed in configuration for the node, or mapped elsewhere in a proxy server.