This crate provides tools to query the SEC's EDGAR API.
Define USER_AGENT in your environment variables. According to the SEC, it must be in the format:
USER_AGENT="Sample Company Name AdminContact@<sample company domain>.com"
Sample Query:
```rust use secedgar::{ edgar::{edgarclient, getfeedentries, getfeedentrycontent}, edgarquery::{ cikquery::CIKQuery, filing::FilingTypeOption::10Q, edgarquerybuilder::{BuilderInput, EdgarQueryBuilder} }, };
async fn somefunc() { let ticker = "c"; // To save yourself a trip, you can store the file locally and query it instead. // The file can be downloaded from here. // let cikquery = CIKQuery::new(Some("./ignore/ticker.txt")) let cikquery = CIKQuery::new(None) .unwrap() .getcik(ticker) .await .unwrap(); let query = EdgarQueryBuilder::new(&cikquery) .setfilingtype(BuilderInput::TypeTInput(10Q)) .build() .unwrap(); let entries = getfeedentries(edgarclient().unwrap(), query).await.unwrap(); let filingtype = getfeedentrycontent(entries.first().unwrap()) .unwrap() .filingtype .value; } ```