pub struct Client { /* private fields */ }Expand description
An async HTTP client for the SEC EDGAR API.
Handles rate limiting, User-Agent headers, and JSON deserialization.
Construct via ClientBuilder.
§Example
let client = edgar_rs::ClientBuilder::new("MyApp/1.0 contact@example.com")
.build()?;
let tickers = client.get_tickers().await?;Implementations§
Source§impl Client
impl Client
Sourcepub async fn get_tickers(&self) -> Result<HashMap<String, Ticker>>
pub async fn get_tickers(&self) -> Result<HashMap<String, Ticker>>
Fetches the complete mapping of CIK numbers to ticker symbols. The returned map is keyed by CIK number as a string.
Sourcepub async fn get_submission(&self, cik: Cik) -> Result<Submission>
pub async fn get_submission(&self, cik: Cik) -> Result<Submission>
Fetches company submission data for the given CIK. Includes company metadata and recent filing history.
Sourcepub async fn get_document(
&self,
cik: Cik,
accession: &str,
primary_doc: &str,
) -> Result<String>
pub async fn get_document( &self, cik: Cik, accession: &str, primary_doc: &str, ) -> Result<String>
Fetches a specific filing document from EDGAR.
The accession number should be in dashed format (e.g., "0000320193-24-000123");
dashes are stripped automatically for the URL path.
Sourcepub async fn get_company_concept(
&self,
cik: Cik,
taxonomy: &str,
tag: &str,
) -> Result<CompanyConcept>
pub async fn get_company_concept( &self, cik: Cik, taxonomy: &str, tag: &str, ) -> Result<CompanyConcept>
Fetches all XBRL disclosures for a single concept from a company.
Taxonomy is typically "us-gaap", "dei", "ifrs-full", "srt", or "invest".
Tag is the concept name, e.g., "AccountsPayableCurrent" or "Revenues".
Sourcepub async fn get_company_facts(&self, cik: Cik) -> Result<CompanyFacts>
pub async fn get_company_facts(&self, cik: Cik) -> Result<CompanyFacts>
Fetches all XBRL facts for a company in a single call. The response can be very large (multi-MB) as it includes every concept the company has ever reported.
Sourcepub async fn get_frame(
&self,
taxonomy: &str,
tag: &str,
unit: &str,
period: &str,
) -> Result<Frame>
pub async fn get_frame( &self, taxonomy: &str, tag: &str, unit: &str, period: &str, ) -> Result<Frame>
Fetches aggregated XBRL data across all companies for a given concept, unit, and period.
Period format examples:
"CY2023"for annual"CY2023Q1"for quarterly duration"CY2023Q1I"for quarterly instantaneous
Sourcepub async fn search(
&self,
query: &str,
options: Option<&SearchOptions>,
) -> Result<SearchResult>
pub async fn search( &self, query: &str, options: Option<&SearchOptions>, ) -> Result<SearchResult>
Performs a full-text search across EDGAR filings.
The query string supports wildcards (*), boolean operators (OR, NOT),
and exact phrase matching with quotes.