#trivia #api-bindings #open-trivia #otdb

opentdb

An implementation of the Open Trivia Database API in Rust https://opentdb.com

3 releases (1 stable)

1.0.0 Jan 3, 2019
0.1.1 Jan 2, 2019
0.1.0 Jan 2, 2019

#2984 in #api-bindings

MIT license

25KB
408 lines

opentdb-rs

Build Status MIT licensed Released API docs dependency status codecov

An implementation of the Open Trivia Database API in Rust.

The library is built with forward-compatibility in mind, you can handle your own custom things, provide your own custom base url, and handle custom error codes or elements that MAY be implemented in the future that aren't mapped to the library.

Library

Install

cargo add opentdb

Usage

For usage, review the examples here: examples/01_base_usage.rs

Limitations

  • Only 1 Category can be requested per API Call. To get questions from any category, don't specify a category.
  • A Maximum of 50 Questions can be retrieved per call.

License and Acknowledgements

opentdb-rs itself is licensed under the MIT license, opentdb-rs is not affiliated with the website or API it is using.

opentdb-rs depends on serde (for (de)serialization) and reqwest (for sending HTTP requests), percent-encoding for encoding URLs conform to RFCs. It also uses a dev-dependency mockito for integration tests.

The Open Trivia Database is a collection of user-contributed trivia questions. This project would not be possible without it.

All data provided by their API is available under the Creative Commons Attribution-ShareAlike 4.0 International License as is written on the Open Trivia Database website.

Dependencies

~22MB
~452K SLoC