Expand description
The official Rust client library for the InternetData API: the licensed IP intelligence databases, their metadata and their checksums.
Start with Client::builder and an API key carrying the db.download
scope. Every database published today is licensed, so a keyless client is
answered 401 - the key is nevertheless OPTIONAL, and a client built without
one sends no Authorization header at all. There is no per-address lookup
here: the database catalog and the files behind it are reached through
Client::database, and the OAuth sign-in, by device flow or by
authorization code, through Client::oauth.
let client = internetdata::Client::builder().api_key("your-api-key").build()?;
for database in client.database().list().await? {
println!("{}: {}", database.base, database.standing);
}§Async only
Everything here is async on tokio, and there is no blocking facade.
reqwest::blocking builds its own runtime and PANICS when constructed inside
one, so a facade would fail for exactly the callers most likely to reach for
it. A caller with no runtime writes the three lines that make the cost
visible:
let runtime = tokio::runtime::Runtime::new()?;
let client = internetdata::Client::builder().api_key("your-api-key").build()?;
let databases = runtime.block_on(client.database().list())?;Structs§
- Authorization
UrlOptions - What
OauthApi::authorization_url_withasks for. A value left unset, or set empty, is left out of the URL rather than sent empty. - Checksums
- Checksums
Response - Client
- A client for the InternetData API.
- Client
Builder - Builds a
Client. With nothing set it talks to production with no key, which every endpoint published today answers401to. - Database
- Database : One database FAMILY, with your organization’s license beside it. A license covers the family, while a download names a specific version, so the ids passed to
downloadandchecksumcome fromversions. - Database
Api - The database catalog and its downloads, which is the whole of InternetData’s public surface.
- Database
Metadata - DatabaseMetadata : The build document written by the exporter, served through unchanged.
- Database
Metadata Column - Database
Version - Device
Authorization - A device sign-in that has started and is waiting for the person.
- Device
Authorization Options - What
OauthApi::device_authorization_withasks for. A value left unset, or set empty, is left out of the request rather than sent empty. - Download
- Download : One download ATTEMPT, refusals included.
- Oauth
Api - The OAuth authorization server behind the API: the device flow, the authorization code flow with PKCE, token refresh and revocation.
- Oauth
Error Response - What the authorization server said when it refused.
- Oauth
Metadata - The authorization server’s discovery document (RFC 8414).
- Oauth
Options - One call’s overrides for an
OauthApimethod. - Pkce
- One sign-in’s PKCE pair, from
OauthApi::create_pkce:challengegoes into the authorization URL,verifieronly to the exchange.Debugleaves the verifier out. - Token
Response - What a successful token exchange hands over.
Enums§
- Database
Format - DatabaseFormat : A file format a database version is published in. A file format a database version is published in.
- Error
- What every failure from this crate is.
- Error
Kind - Why a request failed.
- License
Type - What your license permits you to do with the data. Null when there is no license, which is every family with standing
unlicensed. - Oauth
Error - What every
OauthApicall fails with. - Outcome
- Standing
- Standing : Where your license for a database family stands today.
licensedis a live grant,expiredone whose term has ended, andunlicenseda database published but never bought. An Open database (open) downloads whatever this says. Where your license for a database family stands today.licensedis a live grant,expiredone whose term has ended, andunlicenseda database published but never bought. An Open database (open) downloads whatever this says.
Constants§
- DEFAULT_
BASE_ URL - The production API. Override it with
ClientBuilder::base_url.