Crate aletheia

source ·
Expand description

Aletheia is a client library for the Guardian’s content API.

It is built on top of reqwest and provides a similar interface for building queries. Responses returned by the client are deserialized into structs, mirroring the types used by the API.

Keys to start querying the API can be obtained here:

More information on the API can be found here:


use std::error::Error;
use aletheia::{GuardianContentClient, Result};
use aletheia::enums::{Field, OrderBy, OrderDate};

async fn main() -> Result<()> {
    let mut client = GuardianContentClient::new("your-api-key");

    let response = client
        .show_fields(vec![Field::Byline, Field::LastModified])

    let results = response.results;



Enum types that prevent passing illegal parameters to the Guardian’s content API.
Error variants.
Structs for deserializing the Guardian’s content API responses.


The main asynchronous client used to build requests to send to the Guardian’s content API. This client maintains a private internal asynchronous client implemented by reqwest::Client

Type Definitions

A wrapper around Rust’s core::result::Result<T, E> which defaults to aletheia’s own Error type.