Crates.io | radar-rs |
lib.rs | radar-rs |
version | 0.1.0 |
source | src |
created_at | 2023-07-21 02:19:54.846138 |
updated_at | 2024-02-03 18:09:37.32368 |
description | A unofficial library to access Cloudflare Radar data via Cloudflare API. |
homepage | |
repository | https://github.com/bgpkit/radar-rs |
max_upload_size | |
id | 922011 |
size | 17,383 |
radar-rs
: unofficial Cloudflare Radar Rust SDKThe library is still in very early development. Use with caution.
radar-rs
is an unofficial Cloudflare Radar API Rust SDK. This library provides
a convenient way to access the Cloudflare Radar API, such as BGP routing stats.
Add the following to your Cargo.toml
:
[dependencies]
radar-rs = "0.1"
Add your API token to the environment variable CF_API_TOKEN
.
Then you can use the library as follows:
use radar_rs::RadarClient;
fn main(){
let client = RadarClient::new().unwrap();
let global_stats = client.get_bgp_routing_stats(None, None).unwrap();
println!("global stats: {:?}", global_stats);
assert!(global_stats.stats.routes_total > 1_000_000);
}
The use of the Cloudflare data is under CC BY-SA 4.0
license.
This library does not provide any direct access to the API data.
See Cloudflare Radar about page for more details.
See Cloudflare Radar API getting started guide for detailed steps on obtaining a API token.
Once you have the API token, you can set it as an environment variable CF_API_TOKEN
.