| Crates.io | binlist_rs |
| lib.rs | binlist_rs |
| version | 0.1.1 |
| created_at | 2025-07-22 23:05:20.414052+00 |
| updated_at | 2025-07-22 23:23:43.469701+00 |
| description | Rust wrapper for Binlist API |
| homepage | |
| repository | https://github.com/Junaid433/binlist_rs |
| max_upload_size | |
| id | 1764191 |
| size | 53,341 |
binlist_rs is a lightweight and async Rust wrapper for the Binlist API (https://binlist.net/). It allows you to perform BIN lookups with full support for proxies, custom error types, and structured JSON responses.
Add this to your Cargo.toml:
[dependencies]
binlist_rs = "0.1.1"
Replace version with the latest from https://crates.io/crates/binlist\_rs
use binlist_rs::BinLookup;
#[tokio::main]
async fn main() {
let bin = "531462";
let mut lookup = BinLookup::new();
let result = lookup.lookup(bin, None).await;
if let Ok(info) = result {
println!("Scheme: {}", info.scheme.unwrap_or("Unknown".into()));
if let Some(country) = info.country {
println!("Country: {}", country.name.unwrap_or("Unknown".into()));
}
} else {
println!("Failed to look up BIN.");
}
}
BinLookup::new(): Initializes the client.lookup(bin: &str, proxy_url: Option<&str>): Performs the API request.Result<CardInfo, LookupError>.scheme, brand, type, prepaidcountry: name, emoji, currency, coordinatesbank: nameAll errors implement std::error::Error:
LookupError::BINLookupErrorLookupError::ReqwestErrorLookupError::RateLimitExceededSupports:
http://, https://socks5://, socks5h://Example:
let proxy = Some("socks5://127.0.0.1:9050");
MIT ยฉ 2025 Junaid Rahman (https://github.com/junaid433)
Powered by the awesome Binlist API (https://binlist.net).