Dotnet SDK

Dotnet SDK for

The Dotnet SDK spiceai is the easiest way to query from Dotnet.

It uses Apache Arrow Flight to efficiently stream data to the client and Apache Arrow Records as data frames.


  • .Net 6.0+ or .Net Standard 2.0+


Add Spice SDK

dotnet add package spiceai


  1. Create a SpiceClient by passing in your API key to SpiceClientBuilder. Get your free API key at

using Spice;

var client = new SpiceClientBuilder()
  1. Execute a query and get back an Apache Arrow Flight Client Record Batch Stream Reader.

var reader = await client.Query("SELECT * FROM eth.recent_blocks LIMIT 10;");
  1. Iterate through the reader to access the records.

var enumerator = result.GetAsyncEnumerator();
while (await enumerator.MoveNextAsync())
    var batch = enumerator.Current;
    // Process batch

Usage with local Spice runtime

Follow the quickstart guide to install and run spice locally.

using Spice;

var client = new SpiceClientBuilder()
var data = await client.Query("SELECT trip_distance, total_amount FROM taxi_trips ORDER BY trip_distance DESC LIMIT 10;");

Check Spice OSS documentation to learn more.

Last updated