### Setup Development Environment Source: https://github.com/r007/edgarkit/blob/master/README.md Commands to clone the repository and build the project with all features enabled. ```bash git clone https://github.com/r007/edgarkit.git cd edgarkit cargo build --all-features cargo test --all-features ``` -------------------------------- ### Run Investment Adviser Example Source: https://github.com/r007/edgarkit/blob/master/README.md Launch the Investment Adviser CLI tool, which fetches the latest 10-K/10-Q filings and uses an LLM for investment recommendations. Ensure your OPENROUTER_API_KEY is set as an environment variable. ```bash export OPENROUTER_API_KEY="..." cargo run --release -- --ticker AAPL --model deepseek/deepseek-v3.2 ``` -------------------------------- ### Get Filing Directory and Links with Edgarkit Source: https://context7.com/r007/edgarkit/llms.txt Retrieves the directory listing for a specific EDGAR filing and generates download URLs for text filings. Requires an initialized `Edgar` client. ```rust use edgarkit::{Edgar, FilingOperations, FilingOptions}; #[tokio::main] async fn main() -> Result<(), Box> { let edgar = Edgar::new("MyApp contact@example.com")?; // Get directory listing for a specific filing let directory = edgar.filing_directory("320193", "0000320193-23-000106").await?; println!("Filing directory: {}", directory.directory.name); for item in &directory.directory.item { println!(" {} ({}, {} bytes)", item.name, item.type_, item.size); } // Generate text filing URLs for batch downloading let opts = FilingOptions::new().with_form_type("10-K").with_limit(3); let links = edgar.get_text_filing_links("320193", Some(opts)).await?; println!("\nText filing URLs:"); for (filing, text_url, sec_url) in links { println!(" {} - {}", filing.form, filing.filing_date); println!(" Text: {}", text_url); println!(" SEC.gov: {}", sec_url); } Ok(()) } ``` -------------------------------- ### Run IPO Scanner Example Source: https://github.com/r007/edgarkit/blob/master/README.md Execute the IPO scanner CLI tool, which scans recent EDGAR daily indices for S-1 filings (IPOs) and displays them in an interactive terminal UI. This command assumes you are in the `examples/ipo-scanner` directory. ```bash cargo run --release -- --weekly ``` -------------------------------- ### GET /company_tickers Source: https://context7.com/r007/edgarkit/llms.txt Fetches the complete list of company tickers registered with the SEC. ```APIDOC ## GET /company_tickers ### Description Fetches the complete list of company tickers registered with the SEC, useful for building company databases or ticker validation. ### Method GET ``` -------------------------------- ### Quick Start: Fetch Recent Filings Source: https://github.com/r007/edgarkit/blob/master/README.md Initialize the EdgarKit client with a valid user agent and fetch recent filings for a specific company. The SEC requires a specific user agent format: 'AppName contact@example.com'. ```rust use edgarkit::{Edgar, FilingOperations, FilingOptions}; #[tokio::main] async fn main() -> Result<(), Box> { // Initialize the client with a proper user agent // SEC.gov requires format: "AppName contact@example.com" let edgar = Edgar::new("MyApp contact@example.com")?; // Get recent 10-K filings for Apple (CIK: 320193) let options = FilingOptions::new() .with_form_type("10-K") .with_limit(5); let filings = edgar.filings("320193", Some(options)).await?; for filing in filings { println!("Filed: {} - {}", filing.filing_date, filing.form); } Ok(()) } ``` -------------------------------- ### Run Investment Adviser CLI by Ticker Source: https://github.com/r007/edgarkit/blob/master/examples/investment-adviser/README.md Execute the CLI tool to fetch filings for a specific company ticker and get an AI recommendation. Ensure your OpenRouter API key is exported as an environment variable. ```bash export OPENROUTER_API_KEY="..." cargo run --release -- \ --ticker AAPL \ --user-agent "YourApp you@example.com" \ --model deepseek/deepseek-v3.2 ``` -------------------------------- ### Get Quarterly Filing Index Source: https://context7.com/r007/edgarkit/llms.txt Retrieves the full quarterly index containing all filings for a specific quarter. Also provides functionality to list available daily index files. ```APIDOC ## GET /filings/quarterly ### Description Retrieves the full quarterly index containing all filings for a specific quarter. Supports filtering by form type and limiting the number of results. Also provides functionality to list available daily index files. ### Method GET ### Endpoint /filings/quarterly ### Query Parameters - **period** (EdgarPeriod) - Required - The specific quarter for which to retrieve filings. - **options** (FilingOptions) - Optional - Options to filter filings by form type and limit the number of results. ### Request Example ```rust use edgarkit::{Edgar, EdgarPeriod, Quarter, IndexOperations, FilingOptions}; #[tokio::main] async fn main() -> Result<(), Box> { let edgar = Edgar::new("MyApp contact@example.com")?; let period = EdgarPeriod::new(2024, Quarter::Q2)?; let filings = edgar.get_period_filings(period, None).await?; println!("Total filings in Q2 2024: {}", filings.len()); let options = FilingOptions::new() .with_form_type("10-K") .with_limit(100); let ten_ks = edgar.get_period_filings(period, Some(options)).await?; println!("10-K filings in Q2 2024: {}", ten_ks.len()); let index_listing = edgar.daily_index(Some(period)).await?; println!("\nAvailable daily index files:"); for item in index_listing.directory.item.iter().take(5) { println!(" {} ({})", item.name, item.size); } Ok(()) } ``` ### Response #### Success Response (200) - **filings** (Vec) - A list of filing entries for the specified quarter. - **index_listing** (DirectoryListing) - A listing of available daily index files when `daily_index` is called. #### Response Example ```json { "filings": [ { "form_type": "10-Q", "company_name": "Example Corp", "cik": "1234567890", "filing_date": "2024-07-31T00:00:00Z" } ], "index_listing": { "directory": { "name": "edgar/daily-index/2024/Q2", "item": [ { "name": "edgar/daily-index/2024/Q2/company.idx", "size": 102400 } ] } } } ``` ``` -------------------------------- ### Get Daily Filing Index with Edgarkit Source: https://context7.com/r007/edgarkit/llms.txt Retrieves the daily index file listing all filings for a specific date. Supports filtering by form types and CIKs, and limiting results. ```rust use edgarkit::{Edgar, EdgarDay, IndexOperations, FilingOptions}; #[tokio::main] async fn main() -> Result<(), Box> { let edgar = Edgar::new("MyApp contact@example.com")?; // Create a date (year, month, day) let day = EdgarDay::new(2024, 8, 15)?; // Get all filings for that day let filings = edgar.get_daily_filings(day, None).await?; println!("Total filings on 2024-08-15: {}", filings.len()); // Filter to specific form types and CIKs let options = FilingOptions::new() .with_form_types(vec!["10-K".to_string(), "8-K".to_string()]) .with_limit(20); let filtered = edgar.get_daily_filings(day, Some(options)).await?; for entry in &filtered { println!(" {} - {} (CIK: {})", entry.form_type, entry.company_name, entry.cik ); } Ok(()) } ``` -------------------------------- ### GET /company_facts Source: https://context7.com/r007/edgarkit/llms.txt Retrieves comprehensive XBRL financial data for a specific company identified by its CIK. ```APIDOC ## GET /company_facts ### Description Fetches comprehensive XBRL financial data for a company, including all reported facts organized by taxonomy (US-GAAP, DEI). ### Method GET ### Parameters #### Path Parameters - **cik** (integer) - Required - The Central Index Key (CIK) of the company. ``` -------------------------------- ### Get Quarterly Filing Index with Edgarkit Source: https://context7.com/r007/edgarkit/llms.txt Retrieves the full quarterly index containing all filings for a specific quarter. Allows filtering by form type and limiting results. Also shows how to list available daily index files for a given period. ```rust use edgarkit::{Edgar, EdgarPeriod, Quarter, IndexOperations, FilingOptions}; #[tokio::main] async fn main() -> Result<(), Box> { let edgar = Edgar::new("MyApp contact@example.com")?; // Create a period (year, quarter) let period = EdgarPeriod::new(2024, Quarter::Q2)?; // Get all filings for Q2 2024 let filings = edgar.get_period_filings(period, None).await?; println!("Total filings in Q2 2024: {}", filings.len()); // Filter to 10-K filings only let options = FilingOptions::new() .with_form_type("10-K") .with_limit(100); let ten_ks = edgar.get_period_filings(period, Some(options)).await?; println!("10-K filings in Q2 2024: {}", ten_ks.len()); // List available index files let index_listing = edgar.daily_index(Some(period)).await?; println!("\nAvailable daily index files:"); for item in index_listing.directory.item.iter().take(5) { println!(" {} ({})", item.name, item.size); } Ok(()) } ``` -------------------------------- ### Enable Specific EdgarKit Features Source: https://github.com/r007/edgarkit/blob/master/README.md Customize your EdgarKit build by enabling only the necessary features. This can reduce compile times and binary size. For example, enable 'search', 'filings', and 'company' features. ```toml [dependencies] edgarkit = { version = "0.1.0", features = ["search", "filings", "company"] } ``` -------------------------------- ### Get Daily Filing Index Source: https://context7.com/r007/edgarkit/llms.txt Retrieves the daily index file listing all filings for a specific date. Supports filtering by form type and CIK, and limiting the number of results. ```APIDOC ## GET /filings/daily ### Description Retrieves the daily index file listing all filings for a specific date, ideal for building filing databases. ### Method GET ### Endpoint /filings/daily ### Query Parameters - **date** (EdgarDay) - Required - The specific date for which to retrieve filings. - **options** (FilingOptions) - Optional - Options to filter filings by form types, CIKs, and limit the number of results. ### Request Example ```rust use edgarkit::{Edgar, EdgarDay, IndexOperations, FilingOptions}; #[tokio::main] async fn main() -> Result<(), Box> { let edgar = Edgar::new("MyApp contact@example.com")?; let day = EdgarDay::new(2024, 8, 15)?; let filings = edgar.get_daily_filings(day, None).await?; println!("Total filings on 2024-08-15: {}", filings.len()); let options = FilingOptions::new() .with_form_types(vec!["10-K".to_string(), "8-K".to_string()]) .with_limit(20); let filtered = edgar.get_daily_filings(day, Some(options)).await?; for entry in &filtered { println!(" {} - {} (CIK: {})", entry.form_type, entry.company_name, entry.cik ); } Ok(()) } ``` ### Response #### Success Response (200) - **filings** (Vec) - A list of filing entries for the specified day. #### Response Example ```json [ { "form_type": "10-K", "company_name": "Example Corp", "cik": "1234567890", "filing_date": "2024-08-15T00:00:00Z" } ] ``` ``` -------------------------------- ### GET /company_cik Source: https://context7.com/r007/edgarkit/llms.txt Resolves a stock ticker symbol or mutual fund ticker to the SEC's Central Index Key (CIK). ```APIDOC ## GET /company_cik ### Description Resolves a stock ticker symbol to the SEC's Central Index Key (CIK), which is required for most EDGAR queries. ### Method GET ### Parameters #### Query Parameters - **ticker** (string) - Required - The stock ticker symbol (e.g., AAPL) or mutual fund ticker. ``` -------------------------------- ### Get Recent Company Filings Source: https://context7.com/r007/edgarkit/llms.txt Retrieves a company's recent filings, with options to filter by form type, paginate, and control amendment inclusion. Requires an Edgar client and FilingOptions. ```rust use edgarkit::{Edgar, FilingOperations, FilingOptions}; #[tokio::main] async fn main() -> Result<(), Box> { let edgar = Edgar::new("MyApp contact@example.com")?; // Get all recent filings for Apple let all_filings = edgar.get_recent_filings("320193").await?; println!("Total recent filings: {}", all_filings.len()); // Filter to 10-K and 10-Q filings only, limit to 10 let options = FilingOptions::new() .with_form_types(vec!["10-K".to_string(), "10-Q".to_string()]) .with_limit(10); let filings = edgar.filings("320193", Some(options)).await?; for filing in &filings { println!("{} - {} (filed: {}, XBRL: {})", filing.form, filing.accession_number, filing.filing_date, filing.is_xbrl ); // For 8-K filings, show the items if let Some(items) = &filing.items { println!(" Items: {}", items); } } // Exclude amendments (only get original S-1, not S-1/A) let s1_only = FilingOptions::new() .with_form_type("S-1") .with_include_amendments(false); let originals = edgar.filings("320193", Some(s1_only)).await?; println!("\nOriginal S-1 filings (no amendments): {}", originals.len()); Ok(()) } ``` -------------------------------- ### Initialize Edgar Client Source: https://context7.com/r007/edgarkit/llms.txt Configures the main entry point for EDGAR operations. Requires a valid user agent string formatted as 'AppName contact@example.com' to comply with SEC policies. ```rust use edgarkit::{Edgar, EdgarConfig, EdgarUrls}; use std::time::Duration; #[tokio::main] async fn main() -> Result<(), Box> { // Simple initialization with user agent // SEC requires format: "AppName contact@example.com" let edgar = Edgar::new("MyFinanceApp contact@example.com")?; // Custom configuration with adjusted rate limit and timeout let config = EdgarConfig { user_agent: "ResearchTool/1.0 researcher@university.edu".to_string(), rate_limit: 5, // 5 requests per second (more conservative) timeout: Duration::from_secs(60), base_urls: EdgarUrls::default(), }; let custom_edgar = Edgar::with_config(config)?; Ok(()) } ``` -------------------------------- ### Run Investment Adviser CLI by CIK Source: https://github.com/r007/edgarkit/blob/master/examples/investment-adviser/README.md Execute the CLI tool using a company's CIK to fetch filings and obtain an AI-driven investment recommendation. The OpenRouter API key must be set as an environment variable. ```bash export OPENROUTER_API_KEY="..." cargo run --release -- \ --cik 320193 \ --user-agent "YourApp you@example.com" ``` -------------------------------- ### Run ipo-scanner Weekly Source: https://github.com/r007/edgarkit/blob/master/examples/ipo-scanner/README.md Execute the ipo-scanner tool to scan filings from the last 7 days. Remember to replace 'YourApp contact@you.com' with your application's name and contact information for the user-agent. ```bash cargo run --release -- --weekly --user-agent "YourApp contact@you.com" ``` -------------------------------- ### Execute Test Suites Source: https://github.com/r007/edgarkit/blob/master/README.md Various commands for running unit tests, full integration tests, or network-dependent integration tests. ```bash # Run unit tests cargo test --lib # Run all tests including integration tests cargo test --all-features # Run integration tests separately (requires network) cargo test --all-features -- --ignored ``` -------------------------------- ### Add EdgarKit to Cargo.toml Source: https://github.com/r007/edgarkit/blob/master/README.md Include EdgarKit and Tokio in your project's dependencies. Ensure Tokio is configured with the 'full' feature for comprehensive async capabilities. ```toml [dependencies] edgarkit = "0.1.0" tokio = { version = "1", features = ["full"] } ``` -------------------------------- ### Download Filing Content with EdgarKit Source: https://github.com/r007/edgarkit/blob/master/README.md Use this snippet to download the latest 10-K filing for a specific company by its CIK. Ensure you provide a valid User-Agent string for SEC compliance. ```rust use edgarkit::{Edgar, FilingOperations}; #[tokio::main] async fn main() -> Result<(), Box> { let edgar = Edgar::new("MyApp contact@example.com")?; // Get the latest 10-K for a company let content = edgar.get_latest_filing_content("320193", &["10-K"]).await?; // Save to file or process the content println!("Downloaded {} bytes", content.len()); Ok(()) } ``` -------------------------------- ### Search All EDGAR Filings with Pagination Source: https://context7.com/r007/edgarkit/llms.txt Fetches all matching EDGAR filings across multiple pages using parallel requests for efficient retrieval. Useful for comprehensive data collection. ```rust use edgarkit::{Edgar, SearchOperations, SearchOptions}; #[tokio::main] async fn main() -> Result<(), Box> { let edgar = Edgar::new("MyApp contact@example.com")?; // Get ALL S-1 filings for Q1 2024 (automatic pagination) let options = SearchOptions::new() .with_forms(vec!["S-1".to_string()]) .with_date_range("2024-01-01".to_string(), "2024-03-31".to_string()); // search_all fetches all pages in parallel batches of 7 let all_results = edgar.search_all(options).await?; println!("Retrieved {} S-1 filings from Q1 2024", all_results.len()); // Process all results for hit in all_results.iter().take(5) { let company = hit._source.display_names.first().unwrap_or(&"Unknown".to_string()); let cik = hit._source.ciks.first().unwrap_or(&"N/A".to_string()); println!(" {} (CIK: {}) filed {}", company, cik, hit._source.file_date); } Ok(()) } ``` -------------------------------- ### Retrieve Specific Financial Concept Source: https://context7.com/r007/edgarkit/llms.txt Fetches a single XBRL concept for a company. More efficient than loading all facts when specific data is needed. Requires an Edgar client initialized with contact information. ```rust use edgarkit::{Edgar, CompanyOperations}; #[tokio::main] async fn main() -> Result<(), Box> { let edgar = Edgar::new("MyApp contact@example.com")?; // Get Apple's revenue data specifically let concept = edgar.company_concept(320193, "us-gaap", "Revenues").await?; println!("Concept: {} / {}", concept.taxonomy, concept.tag); if let Some(label) = &concept.label { println!("Label: {}", label); } // Get USD-denominated values if let Some(usd_data) = concept.units.get("USD") { println!("\nAnnual revenues (10-K filings):"); for dp in usd_data.iter().filter(|d| d.form == "10-K").take(5) { let revenue_billions = dp.val.as_f64().unwrap_or(0.0) / 1_000_000_000.0; println!(" FY{}: ${:.2}B", dp.fy.unwrap_or(0), revenue_billions); } } Ok(()) } ``` -------------------------------- ### Retrieve Company Facts Source: https://context7.com/r007/edgarkit/llms.txt Fetches XBRL financial data organized by taxonomy. Access specific concepts like 'Revenues' through the taxonomies map. ```rust use edgarkit::{Edgar, CompanyOperations}; #[tokio::main] async fn main() -> Result<(), Box> { let edgar = Edgar::new("MyApp contact@example.com")?; // Get Apple's company facts let facts = edgar.company_facts(320193).await?; println!("Company: {} (CIK: {})", facts.entity_name, facts.cik); println!("US-GAAP concepts: {}", facts.taxonomies.us_gaap.len()); println!("DEI concepts: {}", facts.taxonomies.dei.len()); // Access specific financial data (e.g., Revenue) if let Some(revenue) = facts.taxonomies.us_gaap.get("Revenues") { if let Some(usd_values) = revenue.units.get("USD") { println!("\nRevenue history ({} data points):", usd_values.len()); for dp in usd_values.iter().take(3) { println!(" {} ({}): ${}", dp.end, dp.form, dp.val); } } } Ok(()) } ``` -------------------------------- ### Configure EdgarKit Rate Limiting Source: https://github.com/r007/edgarkit/blob/master/README.md Customize EdgarKit's behavior by adjusting the rate limit and timeout settings. This allows compliance with SEC.gov's fair access policy and optimizes request handling. ```rust use edgarkit::{Edgar, EdgarConfig, EdgarUrls}; use std::time::Duration; let config = EdgarConfig { user_agent: "MyApp contact@example.com".to_string(), rate_limit: 5, // 5 requests per second timeout: Duration::from_secs(30), base_urls: EdgarUrls::default(), }; let edgar = Edgar::with_config(config)?; ``` -------------------------------- ### Handle EdgarKit Errors Source: https://context7.com/r007/edgarkit/llms.txt Demonstrates matching against specific error variants like TickerNotFound, RateLimitExceeded, and general request errors. ```rust use edgarkit::{Edgar, EdgarError, FilingOperations, CompanyOperations}; #[tokio::main] async fn main() -> Result<(), Box> { let edgar = Edgar::new("MyApp contact@example.com")?; // Handle specific error types match edgar.company_cik("INVALID_TICKER").await { Ok(cik) => println!("CIK: {}", cik), Err(EdgarError::TickerNotFound) => { println!("Ticker not found in SEC database"); } Err(e) => println!("Other error: {}", e), } // Handle filing lookup errors match edgar.get_recent_filings("9999999999").await { Ok(filings) => println!("Found {} filings", filings.len()), Err(EdgarError::NotFound) => { println!("Company CIK not found"); } Err(EdgarError::RateLimitExceeded) => { println!("Rate limit exceeded - try again later"); } Err(EdgarError::RequestError(e)) => { println!("Network error: {}", e); } Err(e) => println!("Error: {}", e), } Ok(()) } ``` -------------------------------- ### Download Filing Content Source: https://context7.com/r007/edgarkit/llms.txt Downloads the content of a filing document, such as HTML or XML. Supports fetching the latest filing of specified types or content by a specific filing ID. Requires an Edgar client. ```rust use edgarkit::{Edgar, FilingOperations}; #[tokio::main] async fn main() -> Result<(), Box> { let edgar = Edgar::new("MyApp contact@example.com")?; // Get the latest 10-K or 10-Q for Apple let content = edgar.get_latest_filing_content("320193", &["10-K", "10-Q"]).await?; println!("Downloaded filing: {} bytes", content.len()); // Get content by filing ID (accession_number:filename format) let filing_content = edgar.get_filing_content_by_id( "320193", "0000320193-23-000106:aapl-20230930.htm" ).await?; println!("Specific filing content: {} bytes", filing_content.len()); Ok(()) } ``` -------------------------------- ### Retrieve Company Tickers Source: https://context7.com/r007/edgarkit/llms.txt Fetches registered company tickers and optional exchange information for database building or validation. ```rust use edgarkit::{Edgar, CompanyOperations}; #[tokio::main] async fn main() -> Result<(), Box> { let edgar = Edgar::new("MyApp contact@example.com")?; // Get all company tickers let tickers = edgar.company_tickers().await?; println!("Total registered companies: {}", tickers.len()); for ticker in tickers.iter().take(5) { println!(" {} (CIK: {}) - {}", ticker.ticker, ticker.cik, ticker.title); } // Get tickers with exchange information let exchange_tickers = edgar.company_tickers_with_exchange().await?; for t in exchange_tickers.iter().take(3) { println!("{}: {} on {}", t.ticker, t.name, t.exchange); } Ok(()) } ``` -------------------------------- ### Access EDGAR Index Files by Day Source: https://github.com/r007/edgarkit/blob/master/README.md Retrieve all filings from a specific day, optionally filtering by form type. This is useful for batch processing or historical analysis. Requires specifying the desired date and any filtering options. ```rust use edgarkit::{Edgar, EdgarDay, IndexOperations, FilingOptions}; #[tokio::main] async fn main() -> Result<(), Box> { let edgar = Edgar::new("MyApp contact@example.com")?; // Get all filings from a specific day let day = EdgarDay::new(2024, 8, 15)?; let options = FilingOptions::new().with_form_type("10-K"); let filings = edgar.get_daily_filings(day, Some(options)).await?; for filing in filings { println!("{} - {}", filing.company_name, filing.form_type); } Ok(()) } ``` -------------------------------- ### Handle EdgarKit Errors Source: https://github.com/r007/edgarkit/blob/master/README.md Demonstrates pattern matching on EdgarError types to handle common API response scenarios like missing companies or rate limiting. ```rust use edgarkit::{Edgar, EdgarError, FilingOperations}; match edgar.filings("invalid-cik", None).await { Ok(filings) => println!("Found {} filings", filings.len()), Err(EdgarError::NotFound) => println!("Company not found"), Err(EdgarError::RateLimitExceeded) => println!("Rate limit hit"), Err(e) => println!("Error: {}", e), } ``` -------------------------------- ### Access RSS Feeds for SEC News with Edgarkit Source: https://context7.com/r007/edgarkit/llms.txt Retrieves various SEC RSS feeds including press releases, speeches, investor alerts, and XBRL filings. Supports historical XBRL feeds with year and month parameters. ```rust use edgarkit::{Edgar, FeedOperations}; #[tokio::main] async fn main() -> Result<(), Box> { let edgar = Edgar::new("MyApp contact@example.com")?; // Get SEC press releases let press = edgar.press_release_feed().await?; println!("Press releases: {} items", press.channel.items.len()); for item in press.channel.items.iter().take(3) { println!(" {} ({})", item.title, item.pub_date); } // Get SEC speeches and statements let speeches = edgar.speeches_and_statements_feed().await?; println!("\nSpeeches/Statements: {} items", speeches.channel.items.len()); // Get investor alerts let alerts = edgar.investor_alerts_feed().await?; println!("Investor alerts: {} items", alerts.channel.items.len()); // Get XBRL filings feed let xbrl = edgar.xbrl_feed().await?; println!("XBRL filings: {} items", xbrl.channel.items.len()); // Get historical XBRL feed (available from 2005 onwards) let historical = edgar.historical_xbrl_feed(2024, 6).await?; println!("Historical XBRL (June 2024): {} items", historical.channel.items.len()); Ok(()) } ``` -------------------------------- ### Access Atom Feeds for Filings with Edgarkit Source: https://context7.com/r007/edgarkit/llms.txt Retrieves SEC Atom feeds for current filings or company-specific filing activity. Supports filtering by parameters like count and type. ```rust use edgarkit::{Edgar, FeedOperations, FeedOptions}; #[tokio::main] async fn main() -> Result<(), Box> { let edgar = Edgar::new("MyApp contact@example.com")?; // Get current filings feed let current = edgar.current_feed(None).await?; println!("Current filings: {} entries", current.entries.len()); for entry in current.entries.iter().take(5) { println!(" {} - {}", entry.title, entry.updated); } // Get current feed with parameters let opts = FeedOptions::new(None) .with_param("count", "25") .with_param("type", "10-K"); let filtered = edgar.current_feed(Some(opts)).await?; println!("\nFiltered feed: {} 10-K entries", filtered.entries.len()); // Get company-specific feed (Apple) let company_feed = edgar.company_feed("320193", None).await?; println!("\nApple filings: {} entries", company_feed.entries.len()); Ok(()) } ``` -------------------------------- ### Retrieve Cross-Company Frames Source: https://context7.com/r007/edgarkit/llms.txt Fetches aggregated XBRL data for a specific concept across all companies for a given period. Useful for peer comparisons and industry analysis. Requires an Edgar client. ```rust use edgarkit::{Edgar, CompanyOperations}; #[tokio::main] async fn main() -> Result<(), Box> { let edgar = Edgar::new("MyApp contact@example.com")?; // Get Assets for all companies for Q1 2024 // Period format: CY{year}Q{quarter}I for quarterly, CY{year} for annual let frame = edgar.frames("us-gaap", "Assets", "USD", "CY2023Q4I").await?; println!("Frame: {} / {} in {}", frame.taxonomy, frame.tag, frame.uom); println!("Period: {}", frame.ccp); println!("Companies reporting: {}", frame.pts); // Show top 5 by assets let mut sorted_data = frame.data_points.clone(); sorted_data.sort_by(|a, b| b.val.cmp(&a.val)); println!("\nTop 5 companies by assets:"); for dp in sorted_data.iter().take(5) { let assets_billions = dp.val as f64 / 1_000_000_000.0; println!(" {} (CIK {}): ${:.2}B", dp.entity_name, dp.cik, assets_billions); } Ok(()) } ``` -------------------------------- ### Search EDGAR Filings with Edgarkit Source: https://context7.com/r007/edgarkit/llms.txt Performs full-text searches on EDGAR filings using various criteria like form types, dates, companies, and keywords. Supports basic and advanced search options. ```rust use edgarkit::{Edgar, SearchOperations, SearchOptions}; #[tokio::main] async fn main() -> Result<(), Box> { let edgar = Edgar::new("MyApp contact@example.com")?; // Basic search for recent 10-K filings let options = SearchOptions::new() .with_forms(vec!["10-K".to_string()]) .with_count(10); let response = edgar.search(options).await?; println!("Found {} total 10-K filings", response.hits.total.value); for hit in &response.hits.hits { let company = hit._source.display_names.first().unwrap_or(&"Unknown".to_string()); println!(" {} - {} ({})", company, hit._source.form, hit._source.file_date); } // Advanced search with keyword query and date range let advanced = SearchOptions::new() .with_query(r#"artificial intelligence" OR "machine learning"#) .with_forms(vec!["10-K".to_string(), "10-Q".to_string()]) .with_date_range("2024-01-01".to_string(), "2024-12-31".to_string()) .with_count(20); let results = edgar.search(advanced).await?; println!("\nAI/ML mentions in 2024: {}", results.hits.total.value); // Search by specific CIK(s) let cik_search = SearchOptions::new() .with_ciks(vec!["320193".to_string(), "789019".to_string()]) // Apple, Microsoft .with_forms(vec!["8-K".to_string()]) .with_count(5); let cik_results = edgar.search(cik_search).await?; println!("\nRecent 8-K filings from Apple/Microsoft: {}", cik_results.hits.hits.len()); Ok(()) } ``` -------------------------------- ### Access Atom Feeds for Filings Source: https://context7.com/r007/edgarkit/llms.txt Retrieves SEC Atom feeds for current filings or company-specific filing activity. Supports filtering and parameterization of the feed. ```APIDOC ## GET /feeds/atom ### Description Retrieves SEC Atom feeds for current filings or company-specific filing activity. Supports filtering by parameters like count and type, and fetching feeds for a specific company by CIK. ### Method GET ### Endpoint /feeds/atom ### Query Parameters - **options** (FeedOptions) - Optional - Options to filter the feed, such as `count` and `type`. - **company_cik** (string) - Optional - The CIK of the company to retrieve filings for. ### Request Example ```rust use edgarkit::{Edgar, FeedOperations, FeedOptions}; #[tokio::main] async fn main() -> Result<(), Box> { let edgar = Edgar::new("MyApp contact@example.com")?; // Get current filings feed let current = edgar.current_feed(None).await?; println!("Current filings: {} entries", current.entries.len()); for entry in current.entries.iter().take(5) { println!(" {} - {}", entry.title, entry.updated); } // Get current feed with parameters let opts = FeedOptions::new(None) .with_param("count", "25") .with_param("type", "10-K"); let filtered = edgar.current_feed(Some(opts)).await?; println!("\nFiltered feed: {} 10-K entries", filtered.entries.len()); // Get company-specific feed (Apple) let company_feed = edgar.company_feed("320193", None).await?; println!("\nApple filings: {} entries", company_feed.entries.len()); Ok(()) } ``` ### Response #### Success Response (200) - **entries** (Vec) - A list of Atom feed entries. #### Response Example ```json { "entries": [ { "title": "Apple Inc. - Form 10-K", "updated": "2024-08-15T10:00:00Z", "id": "tag:sec.gov,2024:filing/1234567890-24-123456" } ] } ``` ``` -------------------------------- ### Access RSS Feeds for SEC News Source: https://context7.com/r007/edgarkit/llms.txt Retrieves various SEC RSS feeds including press releases, speeches, investor alerts, and XBRL filings. Supports historical XBRL feeds. ```APIDOC ## GET /feeds/rss ### Description Retrieves various SEC RSS feeds including press releases, speeches, investor alerts, and XBRL filings. Supports historical XBRL feeds by specifying year and month. ### Method GET ### Endpoint /feeds/rss ### Query Parameters - **feed_type** (string) - Required - Specifies the type of RSS feed to retrieve (e.g., "press_release", "speeches", "investor_alerts", "xbrl", "historical_xbrl"). - **year** (integer) - Optional - The year for historical XBRL feeds. - **month** (integer) - Optional - The month for historical XBRL feeds. ### Request Example ```rust use edgarkit::{Edgar, FeedOperations}; #[tokio::main] async fn main() -> Result<(), Box> { let edgar = Edgar::new("MyApp contact@example.com")?; // Get SEC press releases let press = edgar.press_release_feed().await?; println!("Press releases: {} items", press.channel.items.len()); for item in press.channel.items.iter().take(3) { println!(" {} ({})", item.title, item.pub_date); } // Get SEC speeches and statements let speeches = edgar.speeches_and_statements_feed().await?; println!("\nSpeeches/Statements: {} items", speeches.channel.items.len()); // Get investor alerts let alerts = edgar.investor_alerts_feed().await?; println!("Investor alerts: {} items", alerts.channel.items.len()); // Get XBRL filings feed let xbrl = edgar.xbrl_feed().await?; println!("XBRL filings: {} items", xbrl.channel.items.len()); // Get historical XBRL feed (available from 2005 onwards) let historical = edgar.historical_xbrl_feed(2024, 6).await?; println!("Historical XBRL (June 2024): {} items", historical.channel.items.len()); Ok(()) } ``` ### Response #### Success Response (200) - **channel.items** (Vec) - A list of items from the requested RSS feed. #### Response Example ```json { "channel": { "title": "SEC Press Releases", "items": [ { "title": "SEC Charges Company X for Misleading Investors", "link": "https://www.sec.gov/news/press-release/2024-123", "pub_date": "2024-08-15T09:00:00Z" } ] } } ``` ``` -------------------------------- ### Look Up Company CIK Source: https://context7.com/r007/edgarkit/llms.txt Resolves stock ticker symbols or mutual fund identifiers to their respective SEC Central Index Key (CIK). ```rust use edgarkit::{Edgar, CompanyOperations}; #[tokio::main] async fn main() -> Result<(), Box> { let edgar = Edgar::new("MyApp contact@example.com")?; // Get CIK for Apple let cik = edgar.company_cik("AAPL").await?; println!("Apple CIK: {}", cik); // Output: Apple CIK: 320193 // Get CIK for a mutual fund let mf_cik = edgar.mutual_fund_cik("VFIAX").await?; println!("Vanguard 500 Index CIK: {}", mf_cik); Ok(()) } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.