Skip to content
This repository has been archived by the owner on Jul 16, 2023. It is now read-only.

Zarthus/opentdb-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

opentdb-rs

Build Status MIT licensed crates.io 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.