4 releases

0.1.3 Jan 22, 2024
0.1.2 Jan 22, 2024
0.1.1 Dec 21, 2023
0.1.0 Dec 19, 2023

#1345 in Web programming


581 lines

Direct Decisions API v1 Rust client


A client library for accessing the Direct Decisions v1 API.

You can view Direct Decisions API v1 docs here: https://api.directdecisions.com/v1

This is an asynchronous Rust client using reqwest. The plan in the future is to also provide a blocking(sync) version and a support for other HTTP clients as well.


The async client uses tokio and reqwest as dependencies. To use it you would need to setup your Cargo.toml to something like this:

ddclient = "0.1.1"
tokio = { version = "1", features = ["full"] }
reqwest = { version = "0.11", features = ["json"] }

And then use it in your code:

async fn main() -> Result<(), ApiError> {
    let client = Client::new("my-api-key".to_string());

    let v = client



This client implements all Direct API features.

  • Create votings
  • Retrieve voting information
  • Set voting choices
  • Delete votings
  • Vote with a ballot
  • Unvote
  • Get submitted ballot
  • Calculate results


Feel free to check out the examples in the examples directory. These examples cover both regular flow and error handling. Also, for specific errors you can check out the tests directory and APIError enum.


Each version of the client is tagged and the version is updated accordingly. To see the list of past versions, run git tag.


We love pull requests! Please see the contribution guidelines.


This library is distributed under the BSD-style license found in the LICENSE file.


~293K SLoC