# Rusty Xkcd
[](https://crates.io/crates/rusty_xkcd)
[](https://docs.rs/rusty_xkcd)
[](https://gitlab.com/Kixiron/rusty_xkcd)
[](https://travis-ci.org/Kixiron/rusty_xkcd)
[](https://gitlab.com/Kixiron/rusty_xkcd/pipelines)
[](https://github.com/Kixiron/rusty_xkcd/blob/master/LICENSE)
[](https://github.com/Kixiron/rusty_xkcd)
[](https://github.com/Kixiron/rusty_xkcd/pull/new/master)
Rusty Xkcd is an API wrapper for the [Xkcd API](https://xkcd.com/json.html).
It aims to give full access to the Xkcd API with maximum performance, control, and reliability.
## Xkcd Comics
Using rusty_xkcd to interact with the xkcd api is easy!
To start, add this line to your `Cargo.toml`
```toml
[dependencies]
rusty_xkcd = "0.1.2"
```
Then import the crate to wherever you want to use it
```rust
extern crate rusty_xkcd;
use rusty_xkcd::Comic;
```
Now you're ready to start using the `Comic` API!
To get the latest xkcd comic, use `get_latest_comic()`
```rust
let comic = Comic::get_latest_comic().unwrap();
```
To get a comic by number, use `get_comic()`
```rust
let comic = Comic::get_comic(100).unwrap();
```
And finally, to get a random xkcd comic, use `get_random_comic()`
```rust
let comic = Comic::get_random_comic().unwrap();
```
# Coming Soon
[Explain Xkcd](https://www.explainxkcd.com)
[What If](https://what-if.xkcd.com)