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::lookupdoes. 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.