Files
open-meteo-cli/src/ip_api.rs
T

6 lines
241 B
Rust

pub fn extract_coords_and_city(ip: &str) -> Result<serde_json::Value, ureq::Error> {
let url = format!("http://ip-api.com/json/{}?fields=16592", ip);
let body: serde_json::Value = ureq::get(&url).call()?.into_json()?;
Ok(body)
}