Open gRPC API Reference docs


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:

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.

Are there gRPC endpoints for Vega Wallet?

Not currently. Please let us know your interest on the community forums or Discord chat server. In the mean time please see the REST based Wallet API.

Do you have any code examples for gRPC?

See the Getting started how-to guide for an example in Python using the API client library mentioned above.

Alternatively, there are a selection of code examples on the repo on GitHub. You can also run code samples directly against the Vega testnet using Gitpod.