sauce-api 0.9.3

API for searching for the original source of images.
Documentation

sauce-api

documentation crates.io

A simple-to-use async API for finding the source of an image.

Best used with Tokio, but async-std should work too.

Note

Tests only pass with --all-features

Supported Sources

If you wish to see more, please submit PRs or a request in an issue!

Usage

IQDB

use sauce_api::prelude::*;

async fn find_source(url: String) {
    let source = IQDB;
    let res: Result<SauceResult, String> = source.check_sauce(url).await; // Can take some time as IQDB is a bit slow.

    match res {
        Ok(result) => {
            println!("Found results! {:?}", result);
        }
        Err(e) => {
            eprintln!("Unable to find results: {}", e);
        }
    }
}

SauceNao

use sauce_api::prelude::*;

async fn find_source(url: String) {
    let mut source = SauceNao::new();
    source.set_api_key("an_api_key".to_string());
    let res: Result<SauceResult, String> = source.check_sauce(url).await;

    match res {
        Ok(result) => {
            println!("Found results! {:?}", result);
        }
        Err(e) => {
            eprintln!("Unable to find results: {}", e);
        }
    }
}

Requirements

sauce-api by default uses the native TLS framework, see this for specific details. You may opt-in to using rustls if you would like to by enabling the rustls feature like this:

sauce-api = { version = "0.6.0", features = ["rustls"] }