Open Secrets
A wrapper for the OpenSecrets REST API
Docs
https://docs.rs/legiscan/latest/open-secrets/
Quick Start
To get started, you'll need to instantiate a OpenSecretsProxy in your program. You have two options:
use OpenSecretsProxy;
// If you have a `LEGISCAN_API_KEY` set in your .env or environment
let proxy = new.unwrap;
// If you want to pass in the API key from elsewhere
let proxy = new_from_key;
If you, for some strange reason, want your response output as something besides JSON, you can adjust the output type like so:
use Doc;
proxy.with_output;
Now you're ready to make some calls to OpenSecrets.
// Lets get Nancy Pelosi's summary
let response = proxy.cand_summary.await.unwrap;
let json: Value = response.json.await.unwrap;
assert_eq!;