Skip to main content

Crate appblocklist

Crate appblocklist 

Source
Expand description

Client for the AppBlockList App Lookup API.

One call takes an iOS bundle ID, an App Store ID (with or without the id prefix) or an Android package name and returns the app’s name, developer, store genre, age rating, ranked filtering categories and IAB category.

let client = appblocklist::Client::from_env()?;
let app = client.lookup("com.zhiliaoapp.musically")?;
if app.found && app.in_category(&["Social Networking"]) {
    println!("block {}", app.bundle_id);
}

A 404 is not an error: it comes back as an App with found == false.

Structs§

App
One answer from the lookup endpoint.
Client
Blocking API client. Cheap to clone; clones share a connection pool.

Enums§

Error
Everything that can go wrong in a lookup.

Constants§

DEFAULT_BASE_URL
API root. The lookup endpoint is DEFAULT_BASE_URL + "/app".
ENV_API_KEY
Environment variable read by Client::from_env.
MAX_ID_LENGTH
Longest ID the API accepts.
USER_AGENT
User-Agent sent with every request.
VERSION
Version of this crate.

Functions§

parse_response
Turn an HTTP status and body into a result, exactly as Client::lookup does. Useful for replaying recorded answers in tests.
validate_id
Trim an ID and check it locally: non-empty, at most 200 characters, no whitespace inside. The API does the full format check.